diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000000000000000000000000000000000..3277a6e4607a74b2b59e24fce951e68c8703fcfc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +version: 2 +updates: + # Update github actions: + - package-ecosystem: github-actions + directory: '/' + labels: ["A1-insubstantial", "R0-silent"] + schedule: + interval: daily + # Update Rust dependencies: + - package-ecosystem: "cargo" + directory: "/" + labels: ["A1-insubstantial", "R0-silent"] + schedule: + interval: "daily" + groups: + # We assume these crates to be semver abiding and can therefore group them together. + known_good_semver: + patterns: + - "syn" + - "quote" + - "log" + - "paste" + - "*serde*" + - "clap" + update-types: + - "minor" + - "patch" diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index e0bdf908a167f80a9de53d116a108542506077e4..3da699a354f69cf31ecd4c2870a39741abd255d1 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -9,10 +9,9 @@ permissions: jobs: check-licenses: runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - repo: [polkadot, substrate, cumulus] + env: + LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0'" + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout sources uses: actions/checkout@v3 @@ -21,16 +20,26 @@ jobs: node-version: "18.x" registry-url: "https://npm.pkg.github.com" scope: "@paritytech" - - name: Check the licenses for ${{ matrix.repo }} + + - name: Check the licenses in Polkadot run: | shopt -s globstar - echo "install" - npm install -g @paritytech/license-scanner@0.0.5 - echo "run for ${{ matrix.repo }}" - cd ${{ matrix.repo }} npx @paritytech/license-scanner scan \ - --ensure-licenses=Apache-2.0 \ - --ensure-licenses=GPL-3.0-only \ - ./**/*.rs - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + --ensure-licenses ${{ env.LICENSES }} \ + -- ./polkadot/**/*.rs + + - name: Check the licenses in Cumulus + run: | + shopt -s globstar + npx @paritytech/license-scanner scan \ + --ensure-licenses ${{ env.LICENSES }} \ + --exclude ./cumulus/parachain-template \ + -- ./cumulus/**/*.rs + + - name: Check the licenses in Substrate + run: | + shopt -s globstar + npx @paritytech/license-scanner scan \ + --ensure-licenses ${{ env.LICENSES }} \ + --exclude ./substrate/bin/node-template \ + -- ./substrate/**/*.rs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6fbc17a182fddaf531e39b24919f01e18832d0c..2e0465ba1eb1b350e105a67703bd51ce13f544ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ workflow: variables: CI_IMAGE: "paritytech/ci-unified:bullseye-1.70.0-2023-05-23-v20230706" - BUILDAH_IMAGE: "quay.io/buildah/stable:v1.29" + # BUILDAH_IMAGE is defined in group variables BUILDAH_COMMAND: "buildah --storage-driver overlay2" RELENG_SCRIPTS_BRANCH: "master" RUSTY_CACHIER_SINGLE_BRANCH: master @@ -333,3 +333,58 @@ cancel-pipeline-cargo-clippy: extends: .cancel-pipeline-template needs: - job: cargo-clippy + +cancel-pipeline-build-linux-stable: + extends: .cancel-pipeline-template + needs: + - job: build-linux-stable + +cancel-pipeline-build-linux-stable-cumulus: + extends: .cancel-pipeline-template + needs: + - job: build-linux-stable-cumulus + +cancel-pipeline-build-linux-substrate: + extends: .cancel-pipeline-template + needs: + - job: build-linux-substrate + +cancel-pipeline-test-node-metrics: + extends: .cancel-pipeline-template + needs: + - job: test-node-metrics + +cancel-pipeline-test-frame-ui: + extends: .cancel-pipeline-template + needs: + - job: test-frame-ui + +cancel-pipeline-quick-benchmarks: + extends: .cancel-pipeline-template + needs: + - job: quick-benchmarks + +cancel-pipeline-check-try-runtime: + extends: .cancel-pipeline-template + needs: + - job: check-try-runtime + +cancel-pipeline-test-frame-examples-compile-to-wasm: + extends: .cancel-pipeline-template + needs: + - job: test-frame-examples-compile-to-wasm + +cancel-pipeline-build-short-benchmark: + extends: .cancel-pipeline-template + needs: + - job: build-short-benchmark + +cancel-pipeline-check-runtime-migration-rococo: + extends: .cancel-pipeline-template + needs: + - job: check-runtime-migration-rococo + +cancel-pipeline-check-runtime-migration-westend: + extends: .cancel-pipeline-template + needs: + - job: check-runtime-migration-westend diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 0364c3607606516103ab6dd920725eaade38b3dd..636f7e47afad81fb9b99ada0eeaad768ec17bedf 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -88,7 +88,7 @@ build-staking-miner: - job: build-malus artifacts: false script: - - time cargo build --locked --release --package staking-miner + - time cargo build -q --locked --release --package staging-staking-miner # # pack artifacts # - mkdir -p ./artifacts # - mv ./target/release/staking-miner ./artifacts/. @@ -146,7 +146,7 @@ build-short-benchmark: - .run-immediately - .collect-artifacts script: - - cargo build --profile release --locked --features=runtime-benchmarks + - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot - mkdir -p artifacts - target/release/polkadot --version - cp ./target/release/polkadot ./artifacts/ @@ -265,6 +265,19 @@ build-runtime-testing: - job: build-runtime-starters artifacts: false +build-short-benchmark-cumulus: + stage: build + extends: + - .docker-env + - .common-refs + - .run-immediately + - .collect-artifacts + script: + - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot-parachain + - mkdir -p artifacts + - target/release/polkadot-parachain --version + - cp ./target/release/polkadot-parachain ./artifacts/ + # substrate build-linux-substrate: @@ -353,4 +366,3 @@ build-subkey-linux: # after_script: [""] # tags: # - osx - diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index efd57ba1d863317af8e4f8f42c23e96129bec471..f88f5808637b89f452fdc77fb3031d40788cc0ba 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -121,30 +121,6 @@ test-rust-feature-propagation: --runtime ./target/release/wbuild/"$NETWORK"-runtime/target/wasm32-unknown-unknown/release/"$NETWORK"_runtime.wasm \ on-runtime-upgrade --checks=pre-and-post live --uri wss://${NETWORK}-try-runtime-node.parity-chains.parity.io:443 -check-runtime-migration-polkadot: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .check-runtime-migration - variables: - NETWORK: "polkadot" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - -check-runtime-migration-kusama: - stage: check - # DAG - needs: - - job: check-runtime-migration-polkadot - artifacts: false - extends: - - .docker-env - - .test-pr-refs - - .check-runtime-migration - variables: - NETWORK: "kusama" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - check-runtime-migration-westend: stage: check extends: @@ -153,7 +129,6 @@ check-runtime-migration-westend: - .check-runtime-migration variables: NETWORK: "westend" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 check-runtime-migration-rococo: stage: check @@ -167,7 +142,6 @@ check-runtime-migration-rococo: - .check-runtime-migration variables: NETWORK: "rococo" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 find-fail-ci-phrase: stage: check diff --git a/.gitlab/pipeline/short-benchmarks.yml b/.gitlab/pipeline/short-benchmarks.yml index 2993338cabb15f5d3c01b91d39e0d5a1b4477f35..81601fba32acfcc57415d1da57bb7b5a7c724956 100644 --- a/.gitlab/pipeline/short-benchmarks.yml +++ b/.gitlab/pipeline/short-benchmarks.yml @@ -2,6 +2,9 @@ # Here are all jobs that are executed during "short-benchmarks" stage # Run all pallet benchmarks only once to check if there are any errors + +# run short-benchmarks for relay chain runtimes from polkadot + short-benchmark-polkadot: &short-bench stage: short-benchmarks extends: @@ -12,6 +15,8 @@ short-benchmark-polkadot: &short-bench artifacts: true variables: RUNTIME: polkadot + tags: + - benchmark script: - ./artifacts/polkadot benchmark pallet --execution wasm --wasm-execution compiled --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 @@ -24,3 +29,60 @@ short-benchmark-westend: <<: *short-bench variables: RUNTIME: westend + +# run short-benchmarks for system parachain runtimes from cumulus + +.short-benchmark-cumulus: &short-bench-cumulus + stage: short-benchmarks + extends: + - .common-refs + - .docker-env + needs: + - job: build-short-benchmark-cumulus + artifacts: true + variables: + RUNTIME_CHAIN: benchmarked-runtime-chain + tags: + - benchmark + script: + - ./artifacts/polkadot-parachain benchmark pallet --wasm-execution compiled --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1 + +short-benchmark-asset-hub-polkadot: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: asset-hub-polkadot-dev + +short-benchmark-asset-hub-kusama: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: asset-hub-kusama-dev + +short-benchmark-asset-hub-westend: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: asset-hub-westend-dev + +short-benchmark-bridge-hub-polkadot: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: bridge-hub-polkadot-dev + +short-benchmark-bridge-hub-kusama: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: bridge-hub-kusama-dev + +short-benchmark-bridge-hub-rococo: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: bridge-hub-rococo-dev + +short-benchmark-collectives-polkadot: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: collectives-polkadot-dev + +short-benchmark-glutton-kusama: + <<: *short-bench-cumulus + variables: + RUNTIME_CHAIN: glutton-kusama-dev-1300 diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml index a83ab8c2bfaa60b60dc0b6524939c06f5e5efd06..c81750d49f9295063378ccfb724af467bcb3c630 100644 --- a/.gitlab/pipeline/test.yml +++ b/.gitlab/pipeline/test.yml @@ -147,7 +147,10 @@ test-doc: extends: - .docker-env - .common-refs - - .run-immediately + # DAG + needs: + - job: test-rustdoc + artifacts: false variables: # Enable debug assertions since we are running optimized builds for testing # but still want to have debug assertions. @@ -160,10 +163,7 @@ test-rustdoc: extends: - .docker-env - .common-refs - # DAG - needs: - - job: test-doc - artifacts: false + - .run-immediately variables: SKIP_WASM_BUILD: 1 RUSTDOCFLAGS: "-Dwarnings" @@ -196,6 +196,8 @@ test-node-metrics: # but still want to have debug assertions. RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" script: + # Build the required workers. + - cargo build --bin polkadot-execute-worker --bin polkadot-prepare-worker --profile testnet --verbose --locked - mkdir -p artifacts - time cargo test --profile testnet --locked @@ -210,7 +212,7 @@ test-deterministic-wasm: - .common-refs # DAG needs: - - job: test-frame-support + - job: test-frame-ui artifacts: false script: - .gitlab/test_deterministic_wasm.sh @@ -293,7 +295,7 @@ node-bench-regression-guard: # if this fails (especially after rust version upgrade) run # ./substrate/.maintain/update-rust-stable.sh -test-frame-support: +test-frame-ui: stage: test extends: - .docker-env @@ -312,9 +314,8 @@ test-frame-support: # Ensure we run the UI tests. RUN_UI_TESTS: 1 script: - - time cargo test --locked -p frame-support-test --features=frame-feature-testing,no-metadata-docs,try-runtime,experimental --manifest-path ./substrate/frame/support/test/Cargo.toml - - time cargo test --locked -p frame-support-test --features=frame-feature-testing,frame-feature-testing-2,no-metadata-docs,try-runtime,experimental --manifest-path ./substrate/frame/support/test/Cargo.toml - - SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --locked -- --ignored timeout + - time cargo test --locked -q --profile testnet -p frame-support-test --features=frame-feature-testing,no-metadata-docs,try-runtime,experimental + - time cargo test --locked -q --profile testnet -p frame-support-test --features=frame-feature-testing,frame-feature-testing-2,no-metadata-docs,try-runtime,experimental - cat /cargo_target_dir/debug/.fingerprint/memory_units-759eddf317490d2b/lib-memory_units.json || true # This job runs all benchmarks defined in the `/bin/node/runtime` once to check that there are no errors. diff --git a/.gitlab/pipeline/zombienet/polkadot.yml b/.gitlab/pipeline/zombienet/polkadot.yml index e4c56a7d6209f824d521e9baa230d8db50602d4b..87b821742c675b39294c8bfccead1058cf3f9e33 100644 --- a/.gitlab/pipeline/zombienet/polkadot.yml +++ b/.gitlab/pipeline/zombienet/polkadot.yml @@ -4,19 +4,24 @@ # common settings for all zombienet jobs .zombienet-polkadot-common: before_script: + - export BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" # from build-linux-stable job - export DEBUG=zombie,zombie::network-node - export ZOMBIENET_INTEGRATION_TEST_IMAGE="${POLKADOT_IMAGE}":${PIPELINE_IMAGE_TAG} + - export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}" - export COL_IMAGE="${COLANDER_IMAGE}":${PIPELINE_IMAGE_TAG} - export MALUS_IMAGE="${MALUS_IMAGE}":${PIPELINE_IMAGE_TAG} - echo "Zombienet Tests Config" - echo "gh-dir ${GH_DIR}" - echo "local-dir ${LOCAL_DIR}" - echo "polkadot image ${ZOMBIENET_INTEGRATION_TEST_IMAGE}" + - echo "polkadot secondary image ${ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}" - echo "colander image ${COL_IMAGE}" - echo "malus image ${MALUS_IMAGE}" stage: zombienet image: "${ZOMBIENET_IMAGE}" needs: + - job: build-linux-stable + artifacts: true - job: build-push-image-malus artifacts: true - job: build-push-image-polkadot-debug @@ -64,21 +69,29 @@ zombienet-polkadot-functional-0002-parachains-disputes: --local-dir="${LOCAL_DIR}/functional" --test="0002-parachains-disputes.zndsl" -zombienet-polkadot-functional-0003-parachains-disputes-garbage-candidate: +zombienet-polkadot-functional-0003-beefy-and-mmr: extends: - .zombienet-polkadot-common script: - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh --local-dir="${LOCAL_DIR}/functional" - --test="0003-parachains-garbage-candidate.zndsl" + --test="0003-beefy-and-mmr.zndsl" -zombienet-polkadot-functional-0004-beefy-and-mmr: +zombienet-polkadot-functional-0004-parachains-disputes-garbage-candidate: extends: - .zombienet-polkadot-common script: - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh --local-dir="${LOCAL_DIR}/functional" - --test="0003-beefy-and-mmr.zndsl" + --test="0004-parachains-garbage-candidate.zndsl" + +zombienet-polkadot-functional-0005-parachains-disputes-past-session: + extends: + - .zombienet-polkadot-common + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --local-dir="${LOCAL_DIR}/functional" + --test="0005-parachains-disputes-past-session.zndsl" zombienet-polkadot-smoke-0001-parachains-smoke-test: extends: @@ -168,3 +181,27 @@ zombienet-polkadot-malus-0001-dispute-valid: - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh --local-dir="${LOCAL_DIR}/integrationtests" --test="0001-dispute-valid-block.zndsl" + +zombienet-polkadot-async-backing-compatibility: + extends: + - .zombienet-polkadot-common + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --local-dir="${LOCAL_DIR}/async_backing" + --test="001-async-backing-compatibility.zndsl" + +zombienet-polkadot-async-backing-runtime-upgrade: + extends: + - .zombienet-polkadot-common + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --local-dir="${LOCAL_DIR}/async_backing" + --test="002-async-backing-runtime-upgrade.zndsl" + +zombienet-polkadot-async-backing-collator-mix: + extends: + - .zombienet-polkadot-common + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --local-dir="${LOCAL_DIR}/async_backing" + --test="003-async-backing-collator-mix.zndsl" diff --git a/.gitlab/test_deterministic_wasm.sh b/.gitlab/test_deterministic_wasm.sh index 5b04013e1df3d5d6b49f5c78c230ceb2e56cf3f8..4f1d2981ff2b4535b7fba056f9f67500965a9359 100755 --- a/.gitlab/test_deterministic_wasm.sh +++ b/.gitlab/test_deterministic_wasm.sh @@ -1,15 +1,17 @@ #!/usr/bin/env bash +set -e #shellcheck source=../common/lib.sh source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/common/lib.sh" # build runtime -WASM_BUILD_NO_COLOR=1 cargo build --verbose --release -p kusama-runtime -p polkadot-runtime -p westend-runtime +WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime # make checksum sha256sum target/release/wbuild/*-runtime/target/wasm32-unknown-unknown/release/*.wasm > checksum.sha256 -# clean up - FIXME: can we reuse some of the artifacts? + cargo clean + # build again -WASM_BUILD_NO_COLOR=1 cargo build --verbose --release -p kusama-runtime -p polkadot-runtime -p westend-runtime +WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime # confirm checksum sha256sum -c checksum.sha256 diff --git a/Cargo.lock b/Cargo.lock index 40aaf2d0d9e7e18d428e68768e07fa05bb6990e0..13bc2327daef899c8b0bfdbcaf575069e9ed0a1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -499,11 +499,12 @@ dependencies = [ [[package]] name = "ark-scale" -version = "0.0.3" +version = "0.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d028cd1025d002fa88c10cd644d29028a7b40806579b608c6ba843b937bbb23" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" dependencies = [ "ark-ec", + "ark-ff", "ark-serialize", "ark-std", "parity-scale-codec", @@ -512,7 +513,7 @@ dependencies = [ [[package]] name = "ark-secret-scalar" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" dependencies = [ "ark-ec", "ark-ff", @@ -560,7 +561,7 @@ dependencies = [ [[package]] name = "ark-transcript" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" dependencies = [ "ark-ff", "ark-serialize", @@ -697,9 +698,6 @@ version = "1.0.0" dependencies = [ "assert_matches", "asset-hub-kusama-runtime", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", "frame-support", "frame-system", "integration-tests-common", @@ -710,15 +708,12 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", - "sp-core", "sp-runtime", - "sp-weights", - "xcm", + "staging-xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -770,7 +765,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "primitive-types", "scale-info", @@ -788,37 +783,33 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "asset-hub-polkadot-integration-tests" version = "1.0.0" dependencies = [ - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", + "asset-hub-kusama-runtime", "frame-support", "frame-system", "integration-tests-common", + "pallet-asset-conversion", "pallet-assets", "pallet-balances", "pallet-xcm", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", - "sp-core", "sp-runtime", - "sp-weights", - "xcm", + "staging-xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -866,7 +857,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", "scale-info", @@ -884,10 +875,10 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -896,9 +887,6 @@ version = "1.0.0" dependencies = [ "assert_matches", "asset-hub-westend-runtime", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", "frame-support", "frame-system", "integration-tests-common", @@ -909,15 +897,12 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", - "sp-core", "sp-runtime", - "sp-weights", - "xcm", + "staging-xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -967,7 +952,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "primitive-types", "scale-info", @@ -985,11 +970,11 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "westend-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -1015,15 +1000,15 @@ dependencies = [ "parachains-common", "parachains-runtimes-test-utils", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sp-consensus-aura", "sp-core", "sp-io", "sp-runtime", "sp-std", + "staging-xcm", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-executor", ] [[package]] @@ -1043,10 +1028,10 @@ dependencies = [ "sp-api", "sp-runtime", "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -1255,12 +1240,13 @@ dependencies = [ [[package]] name = "bandersnatch_vrfs" version = "0.0.1" -source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" dependencies = [ "ark-bls12-381", "ark-ec", "ark-ed-on-bls12-381-bandersnatch", "ark-ff", + "ark-scale", "ark-serialize", "ark-std", "dleq_vrf", @@ -1865,7 +1851,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "scale-info", "serde", @@ -1883,10 +1869,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -1927,7 +1913,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", "scale-info", @@ -1946,10 +1932,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -1957,27 +1943,20 @@ name = "bridge-hub-rococo-integration-tests" version = "1.0.0" dependencies = [ "bp-messages", - "cumulus-pallet-parachain-system", + "cumulus-pallet-dmp-queue", "cumulus-pallet-xcmp-queue", "frame-support", - "frame-system", "integration-tests-common", - "pallet-assets", - "pallet-balances", "pallet-bridge-messages", "pallet-xcm", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", - "sp-core", - "sp-runtime", - "sp-weights", - "xcm", + "staging-xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -2033,7 +2012,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "rococo-runtime-constants", "scale-info", @@ -2053,11 +2032,11 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -2102,9 +2081,9 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -2138,9 +2117,9 @@ dependencies = [ "sp-runtime", "sp-std", "sp-trie", + "staging-xcm", + "staging-xcm-builder", "static_assertions", - "xcm", - "xcm-builder", ] [[package]] @@ -2355,7 +2334,7 @@ name = "chain-spec-builder" version = "2.0.0" dependencies = [ "ansi_term", - "clap 4.4.0", + "clap 4.4.2", "node-cli", "rand 0.8.5", "sc-chain-spec", @@ -2366,9 +2345,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8" dependencies = [ "android-tzdata", "iana-time-zone", @@ -2376,7 +2355,7 @@ dependencies = [ "num-traits", "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -2486,20 +2465,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" dependencies = [ "clap_builder", - "clap_derive 4.4.0", - "once_cell", + "clap_derive 4.4.2", ] [[package]] name = "clap_builder" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstream", "anstyle", @@ -2513,7 +2491,7 @@ version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "586a385f7ef2f8b4d86bddaa0c094794e7ccbfe5ffef1f434fe928143fc783a5" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", ] [[package]] @@ -2531,9 +2509,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", @@ -2582,30 +2560,25 @@ dependencies = [ name = "collectives-polkadot-integration-tests" version = "0.1.0" dependencies = [ - "asset-hub-polkadot-runtime", "collectives-polkadot-runtime", "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", "frame-support", - "frame-system", "integration-tests-common", "pallet-assets", - "pallet-balances", "pallet-core-fellowship", "pallet-salary", "pallet-xcm", "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", "sp-core", "sp-runtime", - "sp-weights", - "xcm", + "staging-xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -2653,7 +2626,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", "scale-info", @@ -2672,10 +2645,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -2732,7 +2705,7 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#0e948f3c28cbacecdd3020403c4841c0eb339213" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" dependencies = [ "ark-ec", "ark-ff", @@ -2864,7 +2837,7 @@ dependencies = [ "parachains-common", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "scale-info", "smallvec", @@ -2880,10 +2853,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -3113,7 +3086,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.0", + "clap 4.4.2", "criterion-plot", "futures", "is-terminal", @@ -3278,7 +3251,7 @@ dependencies = [ name = "cumulus-client-cli" version = "0.1.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -3442,7 +3415,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "polkadot-node-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-test-client", "portpicker", @@ -3555,7 +3528,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", - "xcm", + "staging-xcm", ] [[package]] @@ -3577,7 +3550,7 @@ dependencies = [ "lazy_static", "log", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sc-client-api", "scale-info", "sp-core", @@ -3591,8 +3564,8 @@ dependencies = [ "sp-tracing", "sp-trie", "sp-version", + "staging-xcm", "trie-db", - "xcm", ] [[package]] @@ -3645,7 +3618,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] @@ -3667,9 +3640,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -3684,7 +3657,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] @@ -3706,14 +3679,14 @@ version = "0.1.0" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "scale-info", "sp-api", "sp-runtime", "sp-std", "sp-trie", - "xcm", + "staging-xcm", ] [[package]] @@ -3762,9 +3735,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -3896,7 +3869,7 @@ dependencies = [ "pallet-balances", "pallet-transaction-payment", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "sc-block-builder", "sc-consensus", @@ -3971,7 +3944,7 @@ name = "cumulus-test-service" version = "0.1.0" dependencies = [ "async-trait", - "clap 4.4.0", + "clap 4.4.2", "criterion 0.5.1", "cumulus-client-cli", "cumulus-client-consensus-common", @@ -4461,10 +4434,11 @@ checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" [[package]] name = "dleq_vrf" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" dependencies = [ "ark-ec", "ark-ff", + "ark-scale", "ark-secret-scalar", "ark-serialize", "ark-std", @@ -5218,7 +5192,7 @@ dependencies = [ "Inflector", "array-bytes", "chrono", - "clap 4.4.0", + "clap 4.4.2", "comfy-table", "frame-benchmarking", "frame-support", @@ -5310,7 +5284,7 @@ dependencies = [ name = "frame-election-solution-type-fuzzer" version = "2.0.0-alpha.5" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "frame-election-provider-solution-type", "frame-election-provider-support", "frame-support", @@ -5892,10 +5866,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -6435,7 +6409,6 @@ dependencies = [ "asset-hub-polkadot-runtime", "asset-hub-westend-runtime", "bp-messages", - "bp-runtime", "bridge-hub-kusama-runtime", "bridge-hub-polkadot-runtime", "bridge-hub-rococo-runtime", @@ -6446,24 +6419,19 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "frame-support", - "frame-system", - "kusama-runtime", "kusama-runtime-constants", - "lazy_static", "pallet-assets", - "pallet-balances", "pallet-bridge-messages", "pallet-im-online", "pallet-message-queue", "pallet-staking", "pallet-xcm", - "parachain-info", "parachains-common", "parity-scale-codec", "paste", "penpal-runtime", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime", "polkadot-runtime-constants", @@ -6477,13 +6445,11 @@ dependencies = [ "sp-consensus-beefy", "sp-core", "sp-runtime", - "sp-tracing", - "sp-weights", + "staging-kusama-runtime", + "staging-xcm", "westend-runtime", "westend-runtime-constants", - "xcm", "xcm-emulator", - "xcm-executor", ] [[package]] @@ -6915,119 +6881,6 @@ dependencies = [ "substrate-wasm-builder", ] -[[package]] -name = "kusama-runtime" -version = "1.0.0" -dependencies = [ - "binary-merkle-tree", - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-remote-externalities", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal 0.4.1", - "kusama-runtime-constants", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-beefy", - "pallet-beefy-mmr", - "pallet-bounties", - "pallet-child-bounties", - "pallet-collective", - "pallet-conviction-voting", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-election-provider-support-benchmarking", - "pallet-elections-phragmen", - "pallet-fast-unstake", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-message-queue", - "pallet-mmr", - "pallet-multisig", - "pallet-nis", - "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", - "pallet-nomination-pools-runtime-api", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-preimage", - "pallet-proxy", - "pallet-ranked-collective", - "pallet-recovery", - "pallet-referenda", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-society", - "pallet-staking", - "pallet-staking-runtime-api", - "pallet-state-trie-migration", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-whitelist", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", - "separator", - "serde", - "serde_derive", - "serde_json", - "smallvec", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-mmr-primitives", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "tiny-keccak", - "tokio", - "xcm", - "xcm-builder", - "xcm-executor", -] - [[package]] name = "kusama-runtime-constants" version = "1.0.0" @@ -8345,7 +8198,7 @@ name = "node-bench" version = "0.9.0-dev" dependencies = [ "array-bytes", - "clap 4.4.0", + "clap 4.4.2", "derive_more", "fs_extra", "futures", @@ -8382,7 +8235,7 @@ version = "3.0.0-dev" dependencies = [ "array-bytes", "assert_cmd", - "clap 4.4.0", + "clap 4.4.2", "clap_complete", "criterion 0.4.0", "frame-benchmarking-cli", @@ -8508,7 +8361,7 @@ dependencies = [ name = "node-inspect" version = "0.9.0-dev" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "parity-scale-codec", "sc-cli", "sc-client-api", @@ -8562,7 +8415,7 @@ dependencies = [ name = "node-runtime-generate-bags" version = "3.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "generate-bags", "kitchensink-runtime", ] @@ -8571,7 +8424,7 @@ dependencies = [ name = "node-template" version = "4.0.0-dev" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", @@ -8614,7 +8467,7 @@ dependencies = [ name = "node-template-release" version = "3.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "flate2", "fs_extra", "glob", @@ -10083,7 +9936,6 @@ dependencies = [ name = "pallet-nfts-runtime-api" version = "4.0.0-dev" dependencies = [ - "frame-support", "pallet-nfts", "parity-scale-codec", "sp-api", @@ -10942,7 +10794,7 @@ dependencies = [ "log", "pallet-balances", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", "scale-info", "serde", @@ -10950,9 +10802,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -10975,9 +10827,9 @@ dependencies = [ "sp-runtime", "sp-std", "sp-tracing", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -10995,8 +10847,8 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", + "staging-xcm", + "staging-xcm-builder", ] [[package]] @@ -11016,7 +10868,7 @@ dependencies = [ name = "parachain-template-node" version = "0.1.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "color-print", "cumulus-client-cli", "cumulus-client-collator", @@ -11063,10 +10915,10 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-timestamp", + "staging-xcm", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "xcm", ] [[package]] @@ -11103,7 +10955,7 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-common", "scale-info", "smallvec", @@ -11118,10 +10970,10 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -11147,10 +10999,10 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -11175,16 +11027,16 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sp-consensus-aura", "sp-core", "sp-io", "sp-runtime", "sp-std", "sp-tracing", + "staging-xcm", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-executor", ] [[package]] @@ -11428,7 +11280,7 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "scale-info", @@ -11445,10 +11297,10 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -11746,7 +11598,7 @@ dependencies = [ name = "polkadot-cli" version = "1.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "frame-benchmarking-cli", "futures", "log", @@ -12063,7 +11915,7 @@ dependencies = [ "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-primitives-test-helpers", "sp-core", @@ -12220,7 +12072,7 @@ dependencies = [ "polkadot-node-core-pvf-prepare-worker", "polkadot-node-metrics", "polkadot-node-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "rand 0.8.5", "slotmap", @@ -12269,7 +12121,7 @@ dependencies = [ "landlock", "libc", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "sc-executor", "sc-executor-common", @@ -12291,13 +12143,12 @@ dependencies = [ "futures", "parity-scale-codec", "polkadot-node-core-pvf-common", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "rayon", "sp-core", "sp-maybe-compressed-blob", "sp-tracing", - "tikv-jemalloc-ctl", "tokio", "tracing-gum", ] @@ -12310,7 +12161,7 @@ dependencies = [ "libc", "parity-scale-codec", "polkadot-node-core-pvf-common", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "rayon", "sc-executor", @@ -12367,7 +12218,7 @@ name = "polkadot-node-metrics" version = "1.0.0" dependencies = [ "assert_cmd", - "bs58 0.4.0", + "bs58 0.5.0", "futures", "futures-timer", "hyper", @@ -12420,7 +12271,7 @@ dependencies = [ "futures", "parity-scale-codec", "polkadot-erasure-coding", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "schnorrkel 0.9.1", "serde", @@ -12431,7 +12282,7 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-runtime", "thiserror", - "zstd 0.11.2+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] @@ -12551,22 +12402,6 @@ dependencies = [ "tracing-gum", ] -[[package]] -name = "polkadot-parachain" -version = "1.0.0" -dependencies = [ - "bounded-collections", - "derive_more", - "frame-support", - "parity-scale-codec", - "polkadot-core-primitives", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "polkadot-parachain-bin" version = "1.0.0" @@ -12579,7 +12414,7 @@ dependencies = [ "bridge-hub-kusama-runtime", "bridge-hub-polkadot-runtime", "bridge-hub-rococo-runtime", - "clap 4.4.0", + "clap 4.4.2", "collectives-polkadot-runtime", "color-print", "contracts-rococo-runtime", @@ -12640,6 +12475,7 @@ dependencies = [ "sp-session", "sp-timestamp", "sp-transaction-pool", + "staging-xcm", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -12647,7 +12483,22 @@ dependencies = [ "tempfile", "tokio", "wait-timeout", - "xcm", +] + +[[package]] +name = "polkadot-parachain-primitives" +version = "1.0.0" +dependencies = [ + "bounded-collections", + "derive_more", + "frame-support", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -12655,7 +12506,6 @@ name = "polkadot-performance-test" version = "1.0.0" dependencies = [ "env_logger 0.9.3", - "kusama-runtime", "log", "polkadot-erasure-coding", "polkadot-node-core-pvf-prepare-worker", @@ -12664,6 +12514,7 @@ dependencies = [ "quote", "sc-executor-common", "sp-maybe-compressed-blob", + "staging-kusama-runtime", "thiserror", ] @@ -12675,7 +12526,7 @@ dependencies = [ "hex-literal 0.4.1", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "serde", "sp-api", @@ -12830,13 +12681,13 @@ dependencies = [ "sp-transaction-pool", "sp-trie", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", "tiny-keccak", "tokio", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -12886,8 +12737,8 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "staging-xcm", "static_assertions", - "xcm", ] [[package]] @@ -12907,7 +12758,7 @@ dependencies = [ name = "polkadot-runtime-metrics" version = "1.0.0" dependencies = [ - "bs58 0.4.0", + "bs58 0.5.0", "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", @@ -12940,7 +12791,7 @@ dependencies = [ "pallet-timestamp", "pallet-vesting", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-primitives-test-helpers", "polkadot-runtime-metrics", @@ -12963,10 +12814,10 @@ dependencies = [ "sp-staking", "sp-std", "sp-tracing", + "staging-xcm", + "staging-xcm-executor", "static_assertions", "thousands", - "xcm", - "xcm-executor", ] [[package]] @@ -12984,7 +12835,6 @@ dependencies = [ "futures", "hex-literal 0.4.1", "is_executable", - "kusama-runtime", "kusama-runtime-constants", "kvdb", "kvdb-rocksdb", @@ -13028,7 +12878,7 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", @@ -13089,6 +12939,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-kusama-runtime", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -13176,7 +13027,7 @@ version = "1.0.0" dependencies = [ "assert_matches", "async-trait", - "clap 4.4.0", + "clap 4.4.2", "color-eyre", "futures", "futures-timer", @@ -13230,7 +13081,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -13258,12 +13109,12 @@ dependencies = [ "sp-transaction-pool", "sp-trie", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "test-runtime-constants", "tiny-keccak", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -13279,7 +13130,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime-common", @@ -13322,11 +13173,11 @@ dependencies = [ name = "polkadot-voter-bags" version = "1.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "generate-bags", - "kusama-runtime", "polkadot-runtime", "sp-io", + "staging-kusama-runtime", "westend-runtime", ] @@ -14084,9 +13935,8 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" name = "remote-ext-tests-bags-list" version = "1.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "frame-system", - "kusama-runtime", "kusama-runtime-constants", "log", "pallet-bags-list-remote-tests", @@ -14094,6 +13944,7 @@ dependencies = [ "polkadot-runtime-constants", "sp-core", "sp-tracing", + "staging-kusama-runtime", "tokio", "westend-runtime", "westend-runtime-constants", @@ -14172,7 +14023,7 @@ dependencies = [ [[package]] name = "ring" version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#0e948f3c28cbacecdd3020403c4841c0eb339213" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" dependencies = [ "ark-ec", "ark-ff", @@ -14253,7 +14104,7 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "sp-api", "sp-block-builder", @@ -14266,10 +14117,10 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -14327,7 +14178,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -14358,13 +14209,13 @@ dependencies = [ "sp-transaction-pool", "sp-trie", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", "tiny-keccak", "tokio", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -14792,7 +14643,7 @@ version = "0.10.0-dev" dependencies = [ "array-bytes", "chrono", - "clap 4.4.0", + "clap 4.4.2", "fdlimit", "futures", "futures-timer", @@ -15896,7 +15747,7 @@ dependencies = [ name = "sc-storage-monitor" version = "0.1.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "fs4", "log", "sc-client-db", @@ -16335,18 +16186,18 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", @@ -16534,10 +16385,10 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -16935,9 +16786,9 @@ dependencies = [ [[package]] name = "sp-ark-bls12-377" -version = "0.4.0-beta" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e61a06f286f4e8565a67865ef52e83edabf447881898c94527ffc7b839177" +checksum = "f9b60ba7d8fbb82e21f5be499b02438c9a79365acb441a4dc3993179f09c4cc9" dependencies = [ "ark-bls12-377", "ark-ff", @@ -16950,9 +16801,9 @@ dependencies = [ [[package]] name = "sp-ark-bls12-381" -version = "0.4.0-beta" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3352feef6c9c34022fa766a0c9a86a88a83d280a3e5b34781a1a9af98377a130" +checksum = "c2cd101171d2e988a4e1b2320ad3f26f8746a263110c7153213fe86293e0552b" dependencies = [ "ark-bls12-381", "ark-ff", @@ -16965,9 +16816,9 @@ dependencies = [ [[package]] name = "sp-ark-bw6-761" -version = "0.4.0-beta" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf069165e230aef3c4680edea2d8ab3caa89c039e0b61fad2b8e061fb393668" +checksum = "d94d66ba98893cc42dfe81d5b5dee9142577176bdbdba80ec25a37d8cdffdbd5" dependencies = [ "ark-bw6-761", "ark-ff", @@ -16979,9 +16830,9 @@ dependencies = [ [[package]] name = "sp-ark-ed-on-bls12-377" -version = "0.4.0-beta" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63f1fe8e7e87cb0258d61212b019d4d0fd230293ec42a564eb671c83d437497" +checksum = "37f6ea96c9b1cd4cbd05d741225ff7f6328ab035bda16cf3fac105c87ad98959" dependencies = [ "ark-ed-on-bls12-377", "ark-ff", @@ -16995,9 +16846,9 @@ dependencies = [ [[package]] name = "sp-ark-ed-on-bls12-381-bandersnatch" -version = "0.4.0-beta" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "838ddc5508aff3e89f930e7e7f3565d0786ac27868cfd61587afe681011e1140" +checksum = "4db7a801260397cd58077befcee87acfdde8c189f48718bba1bc3783c799b67b" dependencies = [ "ark-ec", "ark-ed-on-bls12-381-bandersnatch", @@ -17012,9 +16863,9 @@ dependencies = [ [[package]] name = "sp-ark-models" -version = "0.4.0" +version = "0.4.1-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28fa906b809d7a346b2aa32a4bd0c884a75f9f588f9a4a07272f63eaf8a10765" +checksum = "cd77599e09f12893739e1ef822ae065f2f46c3be040ba1979bb786ae21059f44" dependencies = [ "ark-ec", "ark-ff", @@ -17163,6 +17014,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-consensus-sassafras" +version = "0.3.4-dev" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" @@ -17184,7 +17050,7 @@ dependencies = [ "bitflags 1.3.2", "blake2", "bounded-collections", - "bs58 0.4.0", + "bs58 0.5.0", "criterion 0.4.0", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -17424,7 +17290,7 @@ dependencies = [ name = "sp-npos-elections-fuzzer" version = "2.0.0-alpha.5" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "honggfuzz", "rand 0.8.5", "sp-npos-elections", @@ -17851,11 +17717,124 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "staking-miner" +name = "staging-kusama-runtime" +version = "1.0.0" +dependencies = [ + "binary-merkle-tree", + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-remote-externalities", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "kusama-runtime-constants", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-mmr", + "pallet-multisig", + "pallet-nis", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-recovery", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "separator", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-transaction-pool", + "sp-trie", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", + "substrate-wasm-builder", + "tiny-keccak", + "tokio", +] + +[[package]] +name = "staging-staking-miner" version = "1.0.0" dependencies = [ "assert_cmd", - "clap 4.4.0", + "clap 4.4.2", "exitcode", "frame-election-provider-support", "frame-remote-externalities", @@ -17863,7 +17842,6 @@ dependencies = [ "frame-system", "futures-util", "jsonrpsee", - "kusama-runtime", "log", "pallet-balances", "pallet-election-provider-multi-phase", @@ -17884,6 +17862,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-version", + "staging-kusama-runtime", "sub-tokens", "thiserror", "tokio", @@ -17891,6 +17870,74 @@ dependencies = [ "westend-runtime", ] +[[package]] +name = "staging-xcm" +version = "1.0.0" +dependencies = [ + "bounded-collections", + "derivative", + "environmental", + "hex", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-weights", + "xcm-procedural", +] + +[[package]] +name = "staging-xcm-builder" +version = "1.0.0" +dependencies = [ + "assert_matches", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-assets", + "pallet-balances", + "pallet-salary", + "pallet-transaction-payment", + "pallet-xcm", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-parachains", + "polkadot-test-runtime", + "primitive-types", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", +] + +[[package]] +name = "staging-xcm-executor" +version = "1.0.0" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "staging-xcm", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -18009,7 +18056,7 @@ dependencies = [ name = "subkey" version = "3.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "sc-cli", ] @@ -18051,7 +18098,7 @@ dependencies = [ name = "substrate-frame-cli" version = "4.0.0-dev" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "frame-support", "frame-system", "sc-cli", @@ -18254,30 +18301,10 @@ version = "4.0.0-dev" dependencies = [ "futures", "sc-service", - "substrate-test-utils-derive", "tokio", "trybuild", ] -[[package]] -name = "substrate-test-utils-derive" -version = "0.10.0-dev" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "substrate-test-utils-test-crate" -version = "0.1.0" -dependencies = [ - "sc-service", - "substrate-test-utils", - "tokio", -] - [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" @@ -18519,7 +18546,7 @@ version = "1.0.0" dependencies = [ "dlmalloc", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sp-io", "sp-std", "substrate-wasm-builder", @@ -18530,7 +18557,7 @@ dependencies = [ name = "test-parachain-adder-collator" version = "1.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "futures", "futures-timer", "log", @@ -18539,7 +18566,7 @@ dependencies = [ "polkadot-node-core-pvf", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-service", "polkadot-test-service", @@ -18568,7 +18595,7 @@ dependencies = [ "dlmalloc", "log", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sp-io", "sp-std", "substrate-wasm-builder", @@ -18579,7 +18606,7 @@ dependencies = [ name = "test-parachain-undying-collator" version = "1.0.0" dependencies = [ - "clap 4.4.0", + "clap 4.4.2", "futures", "futures-timer", "log", @@ -18588,7 +18615,7 @@ dependencies = [ "polkadot-node-core-pvf", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-service", "polkadot-test-service", @@ -19255,7 +19282,7 @@ version = "0.10.0-dev" dependencies = [ "assert_cmd", "async-trait", - "clap 4.4.0", + "clap 4.4.2", "frame-remote-externalities", "frame-try-runtime", "hex", @@ -19358,7 +19385,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -20402,7 +20429,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -20433,13 +20460,13 @@ dependencies = [ "sp-tracing", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "tiny-keccak", "tokio", "westend-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] @@ -20794,61 +20821,11 @@ dependencies = [ "libc", ] -[[package]] -name = "xcm" -version = "1.0.0" -dependencies = [ - "bounded-collections", - "derivative", - "hex", - "hex-literal 0.4.1", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-io", - "sp-weights", - "xcm-procedural", -] - -[[package]] -name = "xcm-builder" -version = "1.0.0" -dependencies = [ - "assert_matches", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-assets", - "pallet-balances", - "pallet-salary", - "pallet-transaction-payment", - "pallet-xcm", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-runtime-parachains", - "polkadot-test-runtime", - "primitive-types", - "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", - "sp-weights", - "xcm", - "xcm-executor", -] - [[package]] name = "xcm-emulator" version = "0.1.0" dependencies = [ - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", @@ -20859,10 +20836,10 @@ dependencies = [ "log", "pallet-balances", "pallet-message-queue", - "parachain-info", "parachains-common", "parity-scale-codec", "paste", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-parachains", "sp-arithmetic", @@ -20870,28 +20847,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "sp-trie", - "xcm", - "xcm-executor", -] - -[[package]] -name = "xcm-executor" -version = "1.0.0" -dependencies = [ - "environmental", - "frame-benchmarking", - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-weights", - "xcm", + "sp-tracing", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -20911,8 +20869,8 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-tracing", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -20933,13 +20891,13 @@ dependencies = [ "parity-scale-codec", "paste", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", "sp-io", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -20955,7 +20913,7 @@ dependencies = [ "pallet-xcm", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", "scale-info", "sp-core", @@ -20963,9 +20921,9 @@ dependencies = [ "sp-runtime", "sp-std", "sp-tracing", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "xcm-simulator", ] @@ -20982,16 +20940,16 @@ dependencies = [ "pallet-xcm", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", "scale-info", "sp-core", "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "xcm-simulator", ] diff --git a/Cargo.toml b/Cargo.toml index 48081ad14a312b0c46c6de30f776d87b2b17179b..4db27b98e90788775663aed31cbc10c851316318 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -385,6 +385,7 @@ members = [ "substrate/primitives/consensus/common", "substrate/primitives/consensus/grandpa", "substrate/primitives/consensus/pow", + "substrate/primitives/consensus/sassafras", "substrate/primitives/consensus/slots", "substrate/primitives/core", "substrate/primitives/core/hashing", @@ -432,11 +433,9 @@ members = [ "substrate/test-utils", "substrate/test-utils/cli", "substrate/test-utils/client", - "substrate/test-utils/derive", "substrate/test-utils/runtime", "substrate/test-utils/runtime/client", "substrate/test-utils/runtime/transaction-pool", - "substrate/test-utils/test-crate", "substrate/utils/binary-merkle-tree", "substrate/utils/build-script-utils", "substrate/utils/fork-tree", diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a0ef181827983bf89b32f8f955e470f222eb2864 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +> NOTE: We have recently made significant changes to our repository structure. In order to +streamline our development process and foster better contributions, we have merged three separate +repositories Cumulus, Substrate and Polkadot into this repository. Read more about the changes [ +here](https://polkadot-public.notion.site/Polkadot-SDK-FAQ-fbc4cecc2c46443fb37b9eeec2f0d85f). + +# Polkadot SDK + +![](https://cms.polkadot.network/content/images/2021/06/1-xPcVR_fkITd0ssKBvJ3GMw.png) + +[![StackExchange](https://img.shields.io/badge/StackExchange-Community%20&%20Support-222222?logo=stackexchange)](https://substrate.stackexchange.com/) + +The Polkadot SDK repository provides all the resources needed to start building on the Polkadot +network, a multi-chain blockchain platform that enables different blockchains to interoperate and +share information in a secure and scalable way. The Polkadot SDK comprises three main pieces of +software: + +## [Polkadot](./polkadot/) +[![PolkadotForum](https://img.shields.io/badge/Polkadot_Forum-e6007a?logo=polkadot)](https://forum.polkadot.network/) [![Polkadot-license](https://img.shields.io/badge/License-GPL3-blue)](./polkadot/LICENSE) + +Implementation of a node for the https://polkadot.network in Rust, using the Substrate framework. +This directory currently contains runtimes for the Polkadot, Kusama, Westend, and Rococo networks. +In the future, these will be relocated to the [`runtimes`](https://github.com/polkadot-fellows/runtimes/) repository. + +## [Substrate](./substrate/) + [![SubstrateRustDocs](https://img.shields.io/badge/Rust_Docs-Substrate-24CC85?logo=rust)](https://paritytech.github.io/substrate/master/substrate/index.html) [![Substrate-license](https://img.shields.io/badge/License-GPL3%2FApache2.0-blue)](./substrate/README.md#LICENSE) + +Substrate is the primary blockchain SDK used by developers to create the parachains that make up +the Polkadot network. Additionally, it allows for the development of self-sovereign blockchains +that operate completely independently of Polkadot. + +## [Cumulus](./cumulus/) +[![CumulusRustDocs](https://img.shields.io/badge/Rust_Docs-Cumulus-222222?logo=rust)](https://paritytech.github.io/cumulus/cumulus_client_collator/index.html) [![Cumulus-license](https://img.shields.io/badge/License-GPL3-blue)](./cumulus/LICENSE) + +Cumulus is a set of tools for writing Substrate-based Polkadot parachains. + +## Upstream Dependencies + +Below are the primary upstream dependencies utilized in this project: + +- [parity-scale-codec](https://crates.io/crates/parity-scale-codec) +- [parity-db](https://crates.io/crates/parity-db) +- [parity-common](https://github.com/paritytech/parity-common) +- [trie](https://github.com/paritytech/trie) + +## Security + +The security policy and procedures can be found in [docs/SECURITY.md](./docs/SECURITY.md). + +## Contributing & Code of Conduct + +Ensure you follow our [contribution guidelines](./docs/CONTRIBUTING.md). In every interaction and contribution, this project adheres to the [Contributor Covenant Code of Conduct](./docs/CODE_OF_CONDUCT.md). + +## Additional Resources + +- For monitoring upcoming changes and current proposals related to the technical implementation of the Polkadot network, visit the [`Requests for Comment (RFC)`](https://github.com/polkadot-fellows/RFCs) repository. While it's maintained by the Polkadot Fellowship, the RFC process welcomes contributions from everyone. + diff --git a/cumulus/bridges/bin/runtime-common/Cargo.toml b/cumulus/bridges/bin/runtime-common/Cargo.toml index 6c0f576a7dd804cca06b01628187388bf0b3e587..b139f835c1a013b049f5c621f571d4377f234475 100644 --- a/cumulus/bridges/bin/runtime-common/Cargo.toml +++ b/cumulus/bridges/bin/runtime-common/Cargo.toml @@ -41,8 +41,8 @@ sp-std = { path = "../../../../substrate/primitives/std", default-features = fal sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false } # Polkadot dependencies -xcm = { path = "../../../../polkadot/xcm", default-features = false } -xcm-builder = { path = "../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../polkadot/xcm/xcm-builder", default-features = false } [dev-dependencies] bp-test-utils = { path = "../../primitives/test-utils" } diff --git a/cumulus/bridges/bin/runtime-common/src/integrity.rs b/cumulus/bridges/bin/runtime-common/src/integrity.rs index a0af3b981f307dfa1592b8a9199dcd8fb002aced..290c22f835d2a488e4f312f0a4811f730925fc15 100644 --- a/cumulus/bridges/bin/runtime-common/src/integrity.rs +++ b/cumulus/bridges/bin/runtime-common/src/integrity.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/lib.rs b/cumulus/bridges/bin/runtime-common/src/lib.rs index 817922bc907d8d5f27d7c698a1df460361865f9f..ae6f40b142145dc265a69e8c78ef313f5ce9340f 100644 --- a/cumulus/bridges/bin/runtime-common/src/lib.rs +++ b/cumulus/bridges/bin/runtime-common/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/messages.rs b/cumulus/bridges/bin/runtime-common/src/messages.rs index a650f082774618881fc1c635a75f9f211e429047..ac66adae6614b168855b285b4ef4f3cd74ecb068 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/messages_api.rs b/cumulus/bridges/bin/runtime-common/src/messages_api.rs index 199e062fe9826cc44527ffe825a44a530fb618ef..ccf1c754041ed84dc302f0660fdd5bde8dc8d533 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages_api.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages_api.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs b/cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs index b067523c305b99aeb5ec9859b9c6b7b6eb77df1e..d80a88f1068c8975426105f881d963e1c3053ee5 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ use crate::{ }, }; -use bp_messages::storage_keys; +use bp_messages::{storage_keys, MessagePayload}; use bp_polkadot_core::parachains::ParaHash; use bp_runtime::{ record_all_trie_keys, Chain, Parachain, RawStorageProof, StorageProofSize, UnderlyingChainOf, @@ -45,8 +45,8 @@ use xcm::v3::prelude::*; /// Prepare inbound bridge message according to given message proof parameters. fn prepare_inbound_message( params: &MessageProofParams, - destination: InteriorMultiLocation, -) -> Vec { + successful_dispatch_message_generator: impl Fn(usize) -> MessagePayload, +) -> MessagePayload { // we only care about **this** message size when message proof needs to be `Minimal` let expected_size = match params.size { StorageProofSize::Minimal(size) => size as usize, @@ -58,20 +58,15 @@ fn prepare_inbound_message( return vec![0u8; expected_size] } - // else let's prepare successful message. For XCM bridge hubs, it is the message that - // will be pushed further to some XCM queue (XCMP/UMP) - let location = xcm::VersionedInteriorMultiLocation::V3(destination); - let location_encoded_size = location.encoded_size(); - - // we don't need to be super-precise with `expected_size` here - let xcm_size = expected_size.saturating_sub(location_encoded_size); - let xcm = xcm::VersionedXcm::<()>::V3(vec![Instruction::ClearOrigin; xcm_size].into()); - - // this is the `BridgeMessage` from polkadot xcm builder, but it has no constructor - // or public fields, so just tuple - // (double encoding, because `.encode()` is called on original Xcm BLOB when it is pushed - // to the storage) - (location, xcm).encode().encode() + // else let's prepare successful message. + let msg = successful_dispatch_message_generator(expected_size); + assert!( + msg.len() >= expected_size, + "msg.len(): {} does not match expected_size: {}", + expected_size, + msg.len() + ); + msg } /// Prepare proof of messages for the `receive_messages_proof` call. @@ -84,7 +79,7 @@ fn prepare_inbound_message( /// function. pub fn prepare_message_proof_from_grandpa_chain( params: MessageProofParams, - message_destination: InteriorMultiLocation, + message_generator: impl Fn(usize) -> MessagePayload, ) -> (FromBridgedChainMessagesProof>>, Weight) where R: pallet_bridge_grandpa::Config>>, @@ -97,7 +92,7 @@ where params.message_nonces.clone(), params.outbound_lane_data.clone(), params.size, - prepare_inbound_message(¶ms, message_destination), + prepare_inbound_message(¶ms, message_generator), encode_all_messages, encode_lane_data, ); @@ -127,7 +122,7 @@ where /// `prepare_message_proof_from_grandpa_chain` function. pub fn prepare_message_proof_from_parachain( params: MessageProofParams, - message_destination: InteriorMultiLocation, + message_generator: impl Fn(usize) -> MessagePayload, ) -> (FromBridgedChainMessagesProof>>, Weight) where R: pallet_bridge_parachains::Config, @@ -141,7 +136,7 @@ where params.message_nonces.clone(), params.outbound_lane_data.clone(), params.size, - prepare_inbound_message(¶ms, message_destination), + prepare_inbound_message(¶ms, message_generator), encode_all_messages, encode_lane_data, ); @@ -291,3 +286,53 @@ where pallet_bridge_parachains::initialize_for_benchmarks::(bridged_header); (bridged_block_number, bridged_header_hash) } + +/// Returns callback which generates `BridgeMessage` from Polkadot XCM builder based on +/// `expected_message_size` for benchmark. +pub fn generate_xcm_builder_bridge_message_sample( + destination: InteriorMultiLocation, +) -> impl Fn(usize) -> MessagePayload { + move |expected_message_size| -> MessagePayload { + // For XCM bridge hubs, it is the message that + // will be pushed further to some XCM queue (XCMP/UMP) + let location = xcm::VersionedInteriorMultiLocation::V3(destination); + let location_encoded_size = location.encoded_size(); + + // we don't need to be super-precise with `expected_size` here + let xcm_size = expected_message_size.saturating_sub(location_encoded_size); + let xcm_data_size = xcm_size.saturating_sub( + // minus empty instruction size + xcm::v3::Instruction::<()>::ExpectPallet { + index: 0, + name: vec![], + module_name: vec![], + crate_major: 0, + min_crate_minor: 0, + } + .encoded_size(), + ); + + log::trace!( + target: "runtime::bridge-benchmarks", + "generate_xcm_builder_bridge_message_sample with expected_message_size: {}, location_encoded_size: {}, xcm_size: {}, xcm_data_size: {}", + expected_message_size, location_encoded_size, xcm_size, xcm_data_size, + ); + + let xcm = xcm::VersionedXcm::<()>::V3( + vec![xcm::v3::Instruction::<()>::ExpectPallet { + index: 0, + name: vec![42; xcm_data_size], + module_name: vec![], + crate_major: 0, + min_crate_minor: 0, + }] + .into(), + ); + + // this is the `BridgeMessage` from polkadot xcm builder, but it has no constructor + // or public fields, so just tuple + // (double encoding, because `.encode()` is called on original Xcm BLOB when it is pushed + // to the storage) + (location, xcm).encode().encode() + } +} diff --git a/cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs b/cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs index badb17efa0841430721ab07ce293bc086306a988..07a99d2c0a16c381799c02e58cb9c4b574e2ad1c 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/messages_generation.rs b/cumulus/bridges/bin/runtime-common/src/messages_generation.rs index 8dbf3abd683cfff79e3068f70d6c4ecab5e91bd3..3c550a9bd0fd546ba90753b8871e049e65a702e3 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages_generation.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages_generation.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs b/cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs index 44e554ecb24f807cfc716f6dbf14f124382382f0..77c23db3b2ba2d01aef0d2c45a20377eaf8ea129 100644 --- a/cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs +++ b/cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ use bp_messages::{ use bp_runtime::messages::MessageDispatchResult; use bp_xcm_bridge_hub_router::XcmChannelStatusProvider; use codec::{Decode, Encode}; -use frame_support::{dispatch::Weight, traits::Get, CloneNoBound, EqNoBound, PartialEqNoBound}; +use frame_support::{traits::Get, weights::Weight, CloneNoBound, EqNoBound, PartialEqNoBound}; use pallet_bridge_messages::{ Config as MessagesConfig, OutboundLanesCongestedSignals, Pallet as MessagesPallet, WeightInfoExt as MessagesPalletWeights, diff --git a/cumulus/bridges/bin/runtime-common/src/mock.rs b/cumulus/bridges/bin/runtime-common/src/mock.rs index 9c41d17fa9957fd5dd5bf43fd868bcac06fe50f3..45ef790d74482b01948a74cdb0a53c332aa41896 100644 --- a/cumulus/bridges/bin/runtime-common/src/mock.rs +++ b/cumulus/bridges/bin/runtime-common/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs b/cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs index aad53673c3ad3eb36b1b16b2543203e50986c794..63dc78385e46ebb537f06e88a139efacaeeb3832 100644 --- a/cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs +++ b/cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/bin/runtime-common/src/priority_calculator.rs b/cumulus/bridges/bin/runtime-common/src/priority_calculator.rs index 590de05fb1c66c839c711e8dce37963136488de9..3d53f9da8c20e9503959b2aa8dc97807eacd5c67 100644 --- a/cumulus/bridges/bin/runtime-common/src/priority_calculator.rs +++ b/cumulus/bridges/bin/runtime-common/src/priority_calculator.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -51,13 +51,13 @@ mod integrity_tests { use bp_messages::MessageNonce; use bp_runtime::PreComputedSize; use frame_support::{ - dispatch::{DispatchClass, DispatchInfo, Dispatchable, Pays, PostDispatchInfo}, + dispatch::{DispatchClass, DispatchInfo, Pays, PostDispatchInfo}, traits::Get, }; use pallet_bridge_messages::WeightInfoExt; use pallet_transaction_payment::OnChargeTransaction; use sp_runtime::{ - traits::{UniqueSaturatedInto, Zero}, + traits::{Dispatchable, UniqueSaturatedInto, Zero}, transaction_validity::TransactionPriority, FixedPointOperand, SaturatedConversion, Saturating, }; diff --git a/cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs b/cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs index 4e577e88a4118283127392db926d219411334c33..f0c2cbf44509b3340028927a5b374461c2e94d12 100644 --- a/cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs +++ b/cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ use bp_relayers::{RewardsAccountOwner, RewardsAccountParams}; use bp_runtime::{Parachain, ParachainIdOf, RangeInclusiveExt, StaticStrProvider}; use codec::{Decode, Encode}; use frame_support::{ - dispatch::{CallableCallFor, DispatchInfo, Dispatchable, PostDispatchInfo}, + dispatch::{CallableCallFor, DispatchInfo, PostDispatchInfo}, traits::IsSubType, weights::Weight, CloneNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, @@ -47,7 +47,7 @@ use pallet_transaction_payment::{Config as TransactionPaymentConfig, OnChargeTra use pallet_utility::{Call as UtilityCall, Config as UtilityConfig, Pallet as UtilityPallet}; use scale_info::TypeInfo; use sp_runtime::{ - traits::{DispatchInfoOf, Get, PostDispatchInfoOf, SignedExtension, Zero}, + traits::{DispatchInfoOf, Dispatchable, Get, PostDispatchInfoOf, SignedExtension, Zero}, transaction_validity::{ TransactionPriority, TransactionValidity, TransactionValidityError, ValidTransactionBuilder, }, diff --git a/cumulus/bridges/modules/grandpa/src/benchmarking.rs b/cumulus/bridges/modules/grandpa/src/benchmarking.rs index aa222d6e4de6f0ffa9eabe93436bb3726129bd31..182b2f56eb1c57a165cf2eb1e86b585d70fd1801 100644 --- a/cumulus/bridges/modules/grandpa/src/benchmarking.rs +++ b/cumulus/bridges/modules/grandpa/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/grandpa/src/call_ext.rs b/cumulus/bridges/modules/grandpa/src/call_ext.rs index 7a6c61007dec86def244014d8b33e964dd994cef..e0648d5dd0f1d9cd26b2d9cdcc6dc983ef082bb2 100644 --- a/cumulus/bridges/modules/grandpa/src/call_ext.rs +++ b/cumulus/bridges/modules/grandpa/src/call_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/grandpa/src/lib.rs b/cumulus/bridges/modules/grandpa/src/lib.rs index 425712ad9a20e4d2f21fe40e47127c6bc3c6ba23..22df604bf18951073996f8f2195aefc78c62639b 100644 --- a/cumulus/bridges/modules/grandpa/src/lib.rs +++ b/cumulus/bridges/modules/grandpa/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/grandpa/src/mock.rs b/cumulus/bridges/modules/grandpa/src/mock.rs index bd305dfef9dc05967d6fc966fe599318c9acb6d2..f88a0a3e6a6ee187222a6fb8eb1628e22b37abbe 100644 --- a/cumulus/bridges/modules/grandpa/src/mock.rs +++ b/cumulus/bridges/modules/grandpa/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/grandpa/src/storage_types.rs b/cumulus/bridges/modules/grandpa/src/storage_types.rs index 59fcb5d3f077ff624c0aa360215e46cf8be696e3..6d1a7882dd4996c600e8ae1cb149410b60af3bf4 100644 --- a/cumulus/bridges/modules/grandpa/src/storage_types.rs +++ b/cumulus/bridges/modules/grandpa/src/storage_types.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/grandpa/src/weights.rs b/cumulus/bridges/modules/grandpa/src/weights.rs index 4b94f7adfe73b8b65180a0652c46a72a1521342e..89ed70d13ac3359f23fa6b756d3a8e07ff8b7092 100644 --- a/cumulus/bridges/modules/grandpa/src/weights.rs +++ b/cumulus/bridges/modules/grandpa/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/benchmarking.rs b/cumulus/bridges/modules/messages/src/benchmarking.rs index 04f64b53b305f74600d151d539f7b32b5dc4ce78..8c4e6fbf00ca42dd4a61c85c14d90fbff72ed042 100644 --- a/cumulus/bridges/modules/messages/src/benchmarking.rs +++ b/cumulus/bridges/modules/messages/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/inbound_lane.rs b/cumulus/bridges/modules/messages/src/inbound_lane.rs index 359e9022b0b60c1e155648582ab0066b0281999d..966ec939e70e22e830ee30157d2d7da74d59733c 100644 --- a/cumulus/bridges/modules/messages/src/inbound_lane.rs +++ b/cumulus/bridges/modules/messages/src/inbound_lane.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/lib.rs b/cumulus/bridges/modules/messages/src/lib.rs index 67c6fb23cf16765067ef815b91521e349b1ebf1c..b87c64d160752862a59a14f6591bf64f363004e8 100644 --- a/cumulus/bridges/modules/messages/src/lib.rs +++ b/cumulus/bridges/modules/messages/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/mock.rs b/cumulus/bridges/modules/messages/src/mock.rs index 67f7b78a487aa64dfddf74cc215cbed9207de6f2..aebb7eafa7871d13cd8140d5a352978ca36433dd 100644 --- a/cumulus/bridges/modules/messages/src/mock.rs +++ b/cumulus/bridges/modules/messages/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/outbound_lane.rs b/cumulus/bridges/modules/messages/src/outbound_lane.rs index 45b0f4e680955e9faf868b3503bdbc4bc3f747dd..f92e9ccfd95c61ac9797e6423eae5d4e8f02dc2c 100644 --- a/cumulus/bridges/modules/messages/src/outbound_lane.rs +++ b/cumulus/bridges/modules/messages/src/outbound_lane.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/weights.rs b/cumulus/bridges/modules/messages/src/weights.rs index 9880f1dd1ea3d45fb1aa6a3cee3255468fa11a0b..5b6863984ec78c0e250c54a0ed3363d1278f196f 100644 --- a/cumulus/bridges/modules/messages/src/weights.rs +++ b/cumulus/bridges/modules/messages/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/messages/src/weights_ext.rs b/cumulus/bridges/modules/messages/src/weights_ext.rs index 3aefd6be7ca787202c83935bf25eda8d55811922..aeb3a581a69ee6ebb233ca6ec5e0f0bd4d25a408 100644 --- a/cumulus/bridges/modules/messages/src/weights_ext.rs +++ b/cumulus/bridges/modules/messages/src/weights_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -29,8 +29,8 @@ pub const EXPECTED_DEFAULT_MESSAGE_LENGTH: u32 = 128; /// calls we're checking here would fit 1KB. const SIGNED_EXTENSIONS_SIZE: u32 = 1024; -/// Number of extra bytes (excluding size of storage value itself) of storage proof, built at -/// Rialto chain. This mostly depends on number of entries (and their density) in the storage trie. +/// Number of extra bytes (excluding size of storage value itself) of storage proof. +/// This mostly depends on number of entries (and their density) in the storage trie. /// Some reserve is reserved to account future chain growth. pub const EXTRA_STORAGE_PROOF_SIZE: u32 = 1024; diff --git a/cumulus/bridges/modules/parachains/src/benchmarking.rs b/cumulus/bridges/modules/parachains/src/benchmarking.rs index 59c4642cde9997b5046afa491f59fc11b88ae17b..27e06a12a1d93486d93aa258afc1d7de4713df2c 100644 --- a/cumulus/bridges/modules/parachains/src/benchmarking.rs +++ b/cumulus/bridges/modules/parachains/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/parachains/src/call_ext.rs b/cumulus/bridges/modules/parachains/src/call_ext.rs index ea842a61b3e800e5c745a5616a3bc2ad35b068f2..99640dadc61f4a422ec41db4fe196f752b206d06 100644 --- a/cumulus/bridges/modules/parachains/src/call_ext.rs +++ b/cumulus/bridges/modules/parachains/src/call_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/parachains/src/lib.rs b/cumulus/bridges/modules/parachains/src/lib.rs index be46fae3c9253d5276fc4dec6d96ba8e0579623a..b2ef0bf52bd3d5b5f619a6b8e28bbf8228c1a72c 100644 --- a/cumulus/bridges/modules/parachains/src/lib.rs +++ b/cumulus/bridges/modules/parachains/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/parachains/src/mock.rs b/cumulus/bridges/modules/parachains/src/mock.rs index a7030f0ae0310ecacaae6361d42facf0129a3cca..14afe38417105a789f9eb13ca913c1be91e6f789 100644 --- a/cumulus/bridges/modules/parachains/src/mock.rs +++ b/cumulus/bridges/modules/parachains/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/parachains/src/weights.rs b/cumulus/bridges/modules/parachains/src/weights.rs index 1e81dba72fe99ea1ecd968feb93f73d0e5417680..9182ec466117b2c642910148a1240a10ae438b8a 100644 --- a/cumulus/bridges/modules/parachains/src/weights.rs +++ b/cumulus/bridges/modules/parachains/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/parachains/src/weights_ext.rs b/cumulus/bridges/modules/parachains/src/weights_ext.rs index eecdfe903593eb7b62cf3e5f7ddf9971699272fe..13bc9ad2bbce0f26d5946cf8198e689597e5f968 100644 --- a/cumulus/bridges/modules/parachains/src/weights_ext.rs +++ b/cumulus/bridges/modules/parachains/src/weights_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/benchmarking.rs b/cumulus/bridges/modules/relayers/src/benchmarking.rs index d66a11ff06d027ede93518d5fb79f6b906c7998d..2d74ab38f9dbd1711b62df5e6bebd697fda1b988 100644 --- a/cumulus/bridges/modules/relayers/src/benchmarking.rs +++ b/cumulus/bridges/modules/relayers/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/lib.rs b/cumulus/bridges/modules/relayers/src/lib.rs index a71c218443b3d40f7fda1eb81d2317b2b5518075..b9b98ca7e253fdb952125e2079752484e37241a2 100644 --- a/cumulus/bridges/modules/relayers/src/lib.rs +++ b/cumulus/bridges/modules/relayers/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/mock.rs b/cumulus/bridges/modules/relayers/src/mock.rs index b3fcb24cdd20d6c5aeb4471719caffafd9c945e7..4713ec91658afa9ad4e0c2d13055a0921cf1be88 100644 --- a/cumulus/bridges/modules/relayers/src/mock.rs +++ b/cumulus/bridges/modules/relayers/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/payment_adapter.rs b/cumulus/bridges/modules/relayers/src/payment_adapter.rs index a9536cfc0275f319c32e20d48500aacfe7eba991..b2d9c676bddc493700a45fc957235dbb9516296b 100644 --- a/cumulus/bridges/modules/relayers/src/payment_adapter.rs +++ b/cumulus/bridges/modules/relayers/src/payment_adapter.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/stake_adapter.rs b/cumulus/bridges/modules/relayers/src/stake_adapter.rs index 055b6a111ec724a457e9919b93c986d03f650137..88af9b1877bfe85614f081ee66dbb28586b1d34b 100644 --- a/cumulus/bridges/modules/relayers/src/stake_adapter.rs +++ b/cumulus/bridges/modules/relayers/src/stake_adapter.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/weights.rs b/cumulus/bridges/modules/relayers/src/weights.rs index 1bc195a5424728d2b1e4df39d058b72511091e81..2e064a3936df3a0661fc08af48be87520c04dba0 100644 --- a/cumulus/bridges/modules/relayers/src/weights.rs +++ b/cumulus/bridges/modules/relayers/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/relayers/src/weights_ext.rs b/cumulus/bridges/modules/relayers/src/weights_ext.rs index d459b0686bd7e51eed4fdd88113ec9b507842559..9cd25c47c3782f709249dd9b1fd24e4c6ec8ab7f 100644 --- a/cumulus/bridges/modules/relayers/src/weights_ext.rs +++ b/cumulus/bridges/modules/relayers/src/weights_ext.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml b/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml index 4f244a9e6a7054d1949f9c6277a6cdd7acc5eb2d..6ad3c57ca73a788cc09d8fb9e9b1d3510027e4c2 100644 --- a/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml +++ b/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml @@ -26,8 +26,8 @@ sp-std = { path = "../../../../substrate/primitives/std", default-features = fal # Polkadot Dependencies -xcm = { path = "../../../../polkadot/xcm", default-features = false } -xcm-builder = { path = "../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../polkadot/xcm/xcm-builder", default-features = false } [dev-dependencies] sp-io = { path = "../../../../substrate/primitives/io" } diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs b/cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs index b32b983daf72c9ed4b104a3a28cc43011a0865d0..4bbe414f66355bfb2fc866cc74b89f7b97988837 100644 --- a/cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs +++ b/cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -22,10 +22,7 @@ use crate::{Bridge, Call}; use bp_xcm_bridge_hub_router::{BridgeState, MINIMAL_DELIVERY_FEE_FACTOR}; use frame_benchmarking::benchmarks_instance_pallet; -use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get, Hooks}, -}; +use frame_support::traits::{EnsureOrigin, Get, Hooks, UnfilteredDispatchable}; use sp_runtime::traits::Zero; use xcm::prelude::*; diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs b/cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs index 87e050b45c73645ac169cbf68480929d3662b53f..5cf94fc83fd9dffda2e1fa614608eb53ea13922e 100644 --- a/cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs +++ b/cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs b/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs index 5ad7be4890a176c16cd88037207361a952fafe78..cd50b98a168853eec6a37c9a4806271574454cca 100644 --- a/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs +++ b/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs b/cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs index 04909f3b2e838c058fc12fc9314333fa78ca3e8a..62936e997f3cd0aaea17859b49d7c0edf6b65989 100644 --- a/cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs +++ b/cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs b/cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs index b3b25ba6eddd7b36991db10d3a6165b7d9933e3c..94016c1da0cb1235dec6717bd6da79ff4dab74f4 100644 --- a/cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs +++ b/cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs b/cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs index 7363e5af02a2ccff76e2f1d54883673ead3583bd..486fba60e1f8836d0eec2feece7919205cf6c372 100644 --- a/cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs +++ b/cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs index 525b2e62ceab0583c43791aae850c2cd6b7715e5..feef61c7f20a1655f86ffbcc52809bfd9fef41e5 100644 --- a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs +++ b/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs b/cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs index af50a97b28b3dc486023dfeb38de9a005aa0aa96..3a919648df47f091b76f0e16b9cd98b22f1970ff 100644 --- a/cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs +++ b/cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs b/cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs index a1f6ae1a1a9a37a1ed11d52c37993c8c0b570695..bf8d8e07c3a61c83a8f1f0cc253c45557dd1b703 100644 --- a/cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs +++ b/cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs b/cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs index 37b1a9ebb927ca5e58987d38c481b75a197ccfaf..b726c62ac42b3270d72c7eebc6d3f5faff54c166 100644 --- a/cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs +++ b/cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs b/cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs index 635a4c96054ad40d4f47394c547591674c2b68f1..5e4758645d9ea63fedbd17b39c88ee208e725f96 100644 --- a/cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs +++ b/cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-kusama/src/lib.rs b/cumulus/bridges/primitives/chain-kusama/src/lib.rs index b758484aefeb41c3adb80f2c47189c2e4cddd8f0..e234a87b6cf680e1b0b2aba39d04704b85b8c896 100644 --- a/cumulus/bridges/primitives/chain-kusama/src/lib.rs +++ b/cumulus/bridges/primitives/chain-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-polkadot/src/lib.rs b/cumulus/bridges/primitives/chain-polkadot/src/lib.rs index eb62c1729adfdeb4865d826fd342deecfb969bc7..9585fd4d71634ea9af59d6a64206e7dcfc3c80ca 100644 --- a/cumulus/bridges/primitives/chain-polkadot/src/lib.rs +++ b/cumulus/bridges/primitives/chain-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-rococo/src/lib.rs b/cumulus/bridges/primitives/chain-rococo/src/lib.rs index 140069d756959ffcfddd6b10788ef660e66ebcd4..cf7cd16990f8642fbe039310d54de36b5859330e 100644 --- a/cumulus/bridges/primitives/chain-rococo/src/lib.rs +++ b/cumulus/bridges/primitives/chain-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/chain-wococo/src/lib.rs b/cumulus/bridges/primitives/chain-wococo/src/lib.rs index 8247b63238ce4924a70f2797e3c82225f0df43c8..c64451993ee7a8bba32b7f7cd7e00cbeab5dd048 100644 --- a/cumulus/bridges/primitives/chain-wococo/src/lib.rs +++ b/cumulus/bridges/primitives/chain-wococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/justification/mod.rs b/cumulus/bridges/primitives/header-chain/src/justification/mod.rs index 44548b8d3ffd95a26bf43780c1d0b391a2886dff..24c453a0790c90c04b4573a85a66a276a8e6fa89 100644 --- a/cumulus/bridges/primitives/header-chain/src/justification/mod.rs +++ b/cumulus/bridges/primitives/header-chain/src/justification/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs b/cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs index 2484fc4d6b2bf9df26e8a9cff72f4d0e65a6e2b4..e2d7a8e804c20bcaeef48e3ba96c29911a3c6012 100644 --- a/cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs +++ b/cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs b/cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs index 353960734cc9dc9ccff37334e1859e672e02afbb..bb8aaadf327ecccde64365ce5860c5b3095079e7 100644 --- a/cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs +++ b/cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs b/cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs index 99ccdd50616b0facc43359d5c27a32011a3f09b1..6552b359170a89d9b9816a8e933dacaf70d6d248 100644 --- a/cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs +++ b/cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs b/cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs index a9d5f4c1f7362691745130365b5365e6e6bb6ed4..f899c6c8efc06c6a1dfa38c38c4050993b09b5af 100644 --- a/cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs +++ b/cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/lib.rs b/cumulus/bridges/primitives/header-chain/src/lib.rs index ea6c58f4c09791fb9784e9a5e80fce1aef7d497c..7008dfa6063aedaa2d4869eef87f3a076a7b2380 100644 --- a/cumulus/bridges/primitives/header-chain/src/lib.rs +++ b/cumulus/bridges/primitives/header-chain/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/src/storage_keys.rs b/cumulus/bridges/primitives/header-chain/src/storage_keys.rs index c4dbe53bd9a7f39c41dce8c6b550058cdce08174..55d095afbf2ae5ab00848676e455bf6da3c91166 100644 --- a/cumulus/bridges/primitives/header-chain/src/storage_keys.rs +++ b/cumulus/bridges/primitives/header-chain/src/storage_keys.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/tests/implementation_match.rs b/cumulus/bridges/primitives/header-chain/tests/implementation_match.rs index db96961832d4ba489e58178662c67829346dddb5..f664a419621f67e7153adf3d9195546cca80fd0f 100644 --- a/cumulus/bridges/primitives/header-chain/tests/implementation_match.rs +++ b/cumulus/bridges/primitives/header-chain/tests/implementation_match.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs b/cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs index f3c133481fb896a83ef42e9ffa642347822ddba9..0bc084cc1a97069dd4dff35f41ad53e6fde69319 100644 --- a/cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs +++ b/cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs b/cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs index bdc90a3b07cf6d3de85d67d8e6b05137eefb85a4..21bcd7e86b51e2f898024999a86c8ac403286bba 100644 --- a/cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs +++ b/cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/strict.rs b/cumulus/bridges/primitives/header-chain/tests/justification/strict.rs index 9568f7f7cf9a3b7c71cca415e792af1a15f3ce52..188c9f5baba26b10f50fd8ed875b0cc856c3ec8d 100644 --- a/cumulus/bridges/primitives/header-chain/tests/justification/strict.rs +++ b/cumulus/bridges/primitives/header-chain/tests/justification/strict.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/header-chain/tests/tests.rs b/cumulus/bridges/primitives/header-chain/tests/tests.rs index 7c525a9303adcd3ca9c9d469f19da59e030cad50..269fde09bb71ce3df3d955811f9da3e10c100ef3 100644 --- a/cumulus/bridges/primitives/header-chain/tests/tests.rs +++ b/cumulus/bridges/primitives/header-chain/tests/tests.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + mod justification { mod equivocation; mod optimizer; diff --git a/cumulus/bridges/primitives/messages/src/lib.rs b/cumulus/bridges/primitives/messages/src/lib.rs index 8cafd58650f35ef7a39f065c62b1415c287bb18a..e48914f7591866a5621c791193e26edd03959b9c 100644 --- a/cumulus/bridges/primitives/messages/src/lib.rs +++ b/cumulus/bridges/primitives/messages/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/messages/src/source_chain.rs b/cumulus/bridges/primitives/messages/src/source_chain.rs index 5e4be53c53a521758519c018a5e1f31b591b28e0..73092c3cce0a575283dd3a856bdfc197e0e4d969 100644 --- a/cumulus/bridges/primitives/messages/src/source_chain.rs +++ b/cumulus/bridges/primitives/messages/src/source_chain.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/messages/src/storage_keys.rs b/cumulus/bridges/primitives/messages/src/storage_keys.rs index 4edf9828cfde02e44f65ecc0d3d869f66e5d9b50..8eedf8fcc7ac98ae300ca0485a0827afd3cd1bb5 100644 --- a/cumulus/bridges/primitives/messages/src/storage_keys.rs +++ b/cumulus/bridges/primitives/messages/src/storage_keys.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/messages/src/target_chain.rs b/cumulus/bridges/primitives/messages/src/target_chain.rs index 3d73ca500139a2d01eacb36b502282425ed3e3af..388ce16ccdc06d3e2c42c3a094aae4d6180a0d09 100644 --- a/cumulus/bridges/primitives/messages/src/target_chain.rs +++ b/cumulus/bridges/primitives/messages/src/target_chain.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/parachains/src/lib.rs b/cumulus/bridges/primitives/parachains/src/lib.rs index 21e78e0009f4f311079ddc551b6d71ba768edb82..262b9c6f977529e23d2a0b1515a578cc9455f7ac 100644 --- a/cumulus/bridges/primitives/parachains/src/lib.rs +++ b/cumulus/bridges/primitives/parachains/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/polkadot-core/src/lib.rs b/cumulus/bridges/primitives/polkadot-core/src/lib.rs index 36ef58eed4dd78542d200f74f5455afa3aea001c..b35d97ec79ae2275a5ab885a2f7eb4948e45969d 100644 --- a/cumulus/bridges/primitives/polkadot-core/src/lib.rs +++ b/cumulus/bridges/primitives/polkadot-core/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/polkadot-core/src/parachains.rs b/cumulus/bridges/primitives/polkadot-core/src/parachains.rs index 7268d9c70afa0f7016a442bb157bf662554227d8..223956171f86499397842f491d809eb2f8d81a63 100644 --- a/cumulus/bridges/primitives/polkadot-core/src/parachains.rs +++ b/cumulus/bridges/primitives/polkadot-core/src/parachains.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify @@ -37,7 +37,8 @@ use parity_util_mem::MallocSizeOf; /// Parachain id. /// -/// This is an equivalent of the `polkadot_parachain::Id`, which is a compact-encoded `u32`. +/// This is an equivalent of the `polkadot_parachain_primitives::Id`, which is a compact-encoded +/// `u32`. #[derive( Clone, CompactAs, @@ -64,7 +65,7 @@ impl From for ParaId { /// Parachain head. /// -/// This is an equivalent of the `polkadot_parachain::HeadData`. +/// This is an equivalent of the `polkadot_parachain_primitives::HeadData`. /// /// The parachain head means (at least in Cumulus) a SCALE-encoded parachain header. #[derive( diff --git a/cumulus/bridges/primitives/relayers/src/lib.rs b/cumulus/bridges/primitives/relayers/src/lib.rs index 21f66a2ffa10041107b9d02f3521ccd8f6db7309..c529eea536d73e91aa4293aa23813f9273f6f8b5 100644 --- a/cumulus/bridges/primitives/relayers/src/lib.rs +++ b/cumulus/bridges/primitives/relayers/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/relayers/src/registration.rs b/cumulus/bridges/primitives/relayers/src/registration.rs index 7ab20844bdf934ba37393c316f532cb7bcfbdfa1..bc2d0d127aefec3c6982b17915202cc0f87984f2 100644 --- a/cumulus/bridges/primitives/relayers/src/registration.rs +++ b/cumulus/bridges/primitives/relayers/src/registration.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/chain.rs b/cumulus/bridges/primitives/runtime/src/chain.rs index 43fdaf8da1b7ffb4c29e6e3513f81b7b461a099e..5caaebd42babc32124ec724f10129f84f39423f7 100644 --- a/cumulus/bridges/primitives/runtime/src/chain.rs +++ b/cumulus/bridges/primitives/runtime/src/chain.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/extensions.rs b/cumulus/bridges/primitives/runtime/src/extensions.rs index 96ee9d1e6ec9130e173894624fe389198acce7ac..253350d17e74faa13c97ab2a0ee1876fce69693f 100644 --- a/cumulus/bridges/primitives/runtime/src/extensions.rs +++ b/cumulus/bridges/primitives/runtime/src/extensions.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/lib.rs b/cumulus/bridges/primitives/runtime/src/lib.rs index f4f52866de95d30b8e898a753d52bceed0d5445f..ece782e352bc21e6044cd93191957ac25a040b2a 100644 --- a/cumulus/bridges/primitives/runtime/src/lib.rs +++ b/cumulus/bridges/primitives/runtime/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/messages.rs b/cumulus/bridges/primitives/runtime/src/messages.rs index e3ce37ed5922da46521d96f125e2e95d6b3dcb53..0f219e984f7289b231c888c55e0e2acfb8829a88 100644 --- a/cumulus/bridges/primitives/runtime/src/messages.rs +++ b/cumulus/bridges/primitives/runtime/src/messages.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/storage_proof.rs b/cumulus/bridges/primitives/runtime/src/storage_proof.rs index 09641376666af9feecb3f9255dc02e6fdf2adca0..1b706aa66c16fc73a21ce83f550bea8a8fe128e5 100644 --- a/cumulus/bridges/primitives/runtime/src/storage_proof.rs +++ b/cumulus/bridges/primitives/runtime/src/storage_proof.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/runtime/src/storage_types.rs b/cumulus/bridges/primitives/runtime/src/storage_types.rs index e555f60e87f5fb1084914d541d5405a66e8e02e5..91c5451805a9861d9e58c462f9ab5849409d59a7 100644 --- a/cumulus/bridges/primitives/runtime/src/storage_types.rs +++ b/cumulus/bridges/primitives/runtime/src/storage_types.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/test-utils/Cargo.toml b/cumulus/bridges/primitives/test-utils/Cargo.toml index c379c6792cbcd75257b1deaa95f3078a300e6601..fc6e5859141ebe6dfa17bc854e1740eb9a90907c 100644 --- a/cumulus/bridges/primitives/test-utils/Cargo.toml +++ b/cumulus/bridges/primitives/test-utils/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors.workspace = true edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false [dependencies] bp-header-chain = { path = "../header-chain", default-features = false } diff --git a/cumulus/bridges/primitives/test-utils/src/keyring.rs b/cumulus/bridges/primitives/test-utils/src/keyring.rs index a4e818a3b88806b18e3394e506bb2fc4a167196c..b99132de3ec36bf0f58a454635876708258d1c0f 100644 --- a/cumulus/bridges/primitives/test-utils/src/keyring.rs +++ b/cumulus/bridges/primitives/test-utils/src/keyring.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/test-utils/src/lib.rs b/cumulus/bridges/primitives/test-utils/src/lib.rs index 5a7d0cca279a0c78c94e4e80ab671c59eb7d2262..4d3b84759938b98116a7157b5445804df464cc66 100644 --- a/cumulus/bridges/primitives/test-utils/src/lib.rs +++ b/cumulus/bridges/primitives/test-utils/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs b/cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs index 0dd329f9e4a0e4fdf3571b0121793e4c78c33e3e..dbedb7a52c7fee85e35c7fadc67d11d8cfa434dc 100644 --- a/cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs +++ b/cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common is free software: you can redistribute it and/or modify diff --git a/cumulus/client/cli/Cargo.toml b/cumulus/client/cli/Cargo.toml index 40c53ae919af113cb313d08bbd74199732e28b93..6c44d5f5fd3b6631a7cfa0449d9d04adaa300a1f 100644 --- a/cumulus/client/cli/Cargo.toml +++ b/cumulus/client/cli/Cargo.toml @@ -5,7 +5,7 @@ authors.workspace = true edition.workspace = true [dependencies] -clap = { version = "4.3.24", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } url = "2.4.0" diff --git a/cumulus/client/cli/src/lib.rs b/cumulus/client/cli/src/lib.rs index 3ad68eb04ead3722489122155eaa483250360d06..1b18ed064373fdd58224b70da022a969ad641eb6 100644 --- a/cumulus/client/cli/src/lib.rs +++ b/cumulus/client/cli/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/collator/src/lib.rs b/cumulus/client/collator/src/lib.rs index 647107a7c7c73a58c7301cd26a461da3c3d7354e..f17ae488310608d461238a134597cd875311ba6b 100644 --- a/cumulus/client/collator/src/lib.rs +++ b/cumulus/client/collator/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/client/collator/src/service.rs b/cumulus/client/collator/src/service.rs index c798cb84c23fd9a5f64df6b752b1048e7c6f98ab..c06be006fc17fd5153f0c0478a6786692f841ecb 100644 --- a/cumulus/client/collator/src/service.rs +++ b/cumulus/client/collator/src/service.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/collator.rs b/cumulus/client/consensus/aura/src/collator.rs index 37cf1ea57c3d5dca7f128c89e4578f515de97cdc..b00c3952e2bc90e057dc464ac4b9179927cd67da 100644 --- a/cumulus/client/consensus/aura/src/collator.rs +++ b/cumulus/client/consensus/aura/src/collator.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/collators/basic.rs b/cumulus/client/consensus/aura/src/collators/basic.rs index d6f30aa672b51b187b2694ac04e5920514afbd21..3c904915ceafb9b97fa6493d4db21b8b1609585b 100644 --- a/cumulus/client/consensus/aura/src/collators/basic.rs +++ b/cumulus/client/consensus/aura/src/collators/basic.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/collators/lookahead.rs b/cumulus/client/consensus/aura/src/collators/lookahead.rs index 9663ef5ad3ab238afbd883b4c3a0507000fef892..58d8e9d1a062f7538b498f34c1f510593d2f5412 100644 --- a/cumulus/client/consensus/aura/src/collators/lookahead.rs +++ b/cumulus/client/consensus/aura/src/collators/lookahead.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/collators/mod.rs b/cumulus/client/consensus/aura/src/collators/mod.rs index 55128dfdc8502c8795109d256e7c223ece59ea28..4c7b759daf736f69de48b586b082a7d01534d7e3 100644 --- a/cumulus/client/consensus/aura/src/collators/mod.rs +++ b/cumulus/client/consensus/aura/src/collators/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs index 919e0da39b1a98663427dc632b0949037e526f7f..5cd65ed5546bae392df811e8043ac44214f6a7eb 100644 --- a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs +++ b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/import_queue.rs b/cumulus/client/consensus/aura/src/import_queue.rs index 2f422b9edb174cf00acbacc6c4cc53d29af18aee..2611eaf532f8ffadebc1c2932f429803e561924e 100644 --- a/cumulus/client/consensus/aura/src/import_queue.rs +++ b/cumulus/client/consensus/aura/src/import_queue.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/aura/src/lib.rs b/cumulus/client/consensus/aura/src/lib.rs index 792f7b230d62e25093aa7fef0d10812e0f02c32f..6ededa7a92c11cb8c313f7da01017eeef256fb06 100644 --- a/cumulus/client/consensus/aura/src/lib.rs +++ b/cumulus/client/consensus/aura/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/common/src/import_queue.rs b/cumulus/client/consensus/common/src/import_queue.rs index e54598ac8568765e2d31b6b82913032622c7d13e..311a2b7ad8cfddf50abe0b18aeb5bf5f1f193c1d 100644 --- a/cumulus/client/consensus/common/src/import_queue.rs +++ b/cumulus/client/consensus/common/src/import_queue.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/common/src/level_monitor.rs b/cumulus/client/consensus/common/src/level_monitor.rs index 8a6bbef62f35752a530089297f364698a09e818c..5f115ec2c4a3c885b60da5f5dd9f0fe3faefab16 100644 --- a/cumulus/client/consensus/common/src/level_monitor.rs +++ b/cumulus/client/consensus/common/src/level_monitor.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/common/src/lib.rs b/cumulus/client/consensus/common/src/lib.rs index 49e157481e7aa647eab0b1d7517248ba4a4812c2..edd97cf02a2557b372f3a88234267a0a4e639929 100644 --- a/cumulus/client/consensus/common/src/lib.rs +++ b/cumulus/client/consensus/common/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/common/src/parachain_consensus.rs b/cumulus/client/consensus/common/src/parachain_consensus.rs index 5bbaa2893cff8c2c76c843220fde28945c3d9b0f..b4b315bb32be6ea18d7ae9399cafe4640096f2b4 100644 --- a/cumulus/client/consensus/common/src/parachain_consensus.rs +++ b/cumulus/client/consensus/common/src/parachain_consensus.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/common/src/tests.rs b/cumulus/client/consensus/common/src/tests.rs index b6fcc4a17643bf1ec1a9ead19e5cf30f4f05258c..15586d81d9bfff8d177cf392c89a4c90606ad3bf 100644 --- a/cumulus/client/consensus/common/src/tests.rs +++ b/cumulus/client/consensus/common/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/proposer/src/lib.rs b/cumulus/client/consensus/proposer/src/lib.rs index c2e95eca3a3862536222c163d3a323c22ae2566e..7404651bcd96cc40eeecc3c465b2fafffc25c567 100644 --- a/cumulus/client/consensus/proposer/src/lib.rs +++ b/cumulus/client/consensus/proposer/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/relay-chain/src/import_queue.rs b/cumulus/client/consensus/relay-chain/src/import_queue.rs index 72704673bf8848d7b483d96d81913c143078d77c..9ee03b95904c60fb3b26f60e54023c13c88a2808 100644 --- a/cumulus/client/consensus/relay-chain/src/import_queue.rs +++ b/cumulus/client/consensus/relay-chain/src/import_queue.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/consensus/relay-chain/src/lib.rs b/cumulus/client/consensus/relay-chain/src/lib.rs index ee912520d6630dd1e439d22df5c52be1b2fd6b89..fc395a9d9573fe2efd70d8322f64997670b6d8ec 100644 --- a/cumulus/client/consensus/relay-chain/src/lib.rs +++ b/cumulus/client/consensus/relay-chain/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/network/Cargo.toml b/cumulus/client/network/Cargo.toml index 99a567a950c173e68d05611ee421a6b01c5c872b..eaaf497ac3edcc74415ab0ba6a1c3caf6faff953 100644 --- a/cumulus/client/network/Cargo.toml +++ b/cumulus/client/network/Cargo.toml @@ -23,7 +23,7 @@ sp-state-machine = { path = "../../../substrate/primitives/state-machine" } # Polkadot polkadot-node-primitives = { path = "../../../polkadot/node/primitives" } -polkadot-parachain = { path = "../../../polkadot/parachain" } +polkadot-parachain-primitives = { path = "../../../polkadot/parachain" } polkadot-primitives = { path = "../../../polkadot/primitives" } # Cumulus diff --git a/cumulus/client/network/src/lib.rs b/cumulus/client/network/src/lib.rs index b42342e5b77805447e40365d771e97a3f18409ef..ebd557b805c5d7ea4362632dac8bf0a59ddc6469 100644 --- a/cumulus/client/network/src/lib.rs +++ b/cumulus/client/network/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; use cumulus_relay_chain_interface::RelayChainInterface; use polkadot_node_primitives::{CollationSecondedSignal, Statement}; -use polkadot_parachain::primitives::HeadData; +use polkadot_parachain_primitives::primitives::HeadData; use polkadot_primitives::{ CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId, OccupiedCoreAssumption, SigningContext, UncheckedSigned, diff --git a/cumulus/client/network/src/tests.rs b/cumulus/client/network/src/tests.rs index e1bb961c75fd22064b41334595122fef47b2e475..e03f470753bb6c32c4410a7c694dea8312c74c31 100644 --- a/cumulus/client/network/src/tests.rs +++ b/cumulus/client/network/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -125,8 +125,10 @@ impl RelayChainInterface for DummyRelayChainInterface { if self.data.lock().has_pending_availability { Ok(Some(CommittedCandidateReceipt { descriptor: CandidateDescriptor { - para_head: polkadot_parachain::primitives::HeadData(default_header().encode()) - .hash(), + para_head: polkadot_parachain_primitives::primitives::HeadData( + default_header().encode(), + ) + .hash(), para_id: 0u32.into(), relay_parent: PHash::random(), collator: CollatorPair::generate().0.public(), @@ -315,7 +317,7 @@ async fn make_gossip_message_and_header( pov_hash: PHash::random(), erasure_root: PHash::random(), signature: sp_core::sr25519::Signature([0u8; 64]).into(), - para_head: polkadot_parachain::primitives::HeadData(header.encode()).hash(), + para_head: polkadot_parachain_primitives::primitives::HeadData(header.encode()).hash(), validation_code_hash: ValidationCodeHash::from(PHash::random()), }, }; diff --git a/cumulus/client/pov-recovery/src/active_candidate_recovery.rs b/cumulus/client/pov-recovery/src/active_candidate_recovery.rs index feb09d005cec4a6b84effe06dfc46ff6ae82a531..322b19c796a8c10191f3bfb261b293aba4348944 100644 --- a/cumulus/client/pov-recovery/src/active_candidate_recovery.rs +++ b/cumulus/client/pov-recovery/src/active_candidate_recovery.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/client/pov-recovery/src/lib.rs b/cumulus/client/pov-recovery/src/lib.rs index a7509c54ab09d32efe444de32160ab6fb837e8e8..b050bc66799c7aa84db67374dc801890e0e7ce25 100644 --- a/cumulus/client/pov-recovery/src/lib.rs +++ b/cumulus/client/pov-recovery/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs index 5b3ab15ed6fd9aa2d1da475c8f8bb342a80cf601..42a56b649f035bdf10aa18099fe3851a3b5d238e 100644 --- a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs +++ b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-interface/src/lib.rs b/cumulus/client/relay-chain-interface/src/lib.rs index a0258e20632830c0da88e218936f6e873c94c2ae..a6970732447c34f485a8a066d1bec27b762352a9 100644 --- a/cumulus/client/relay-chain-interface/src/lib.rs +++ b/cumulus/client/relay-chain-interface/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs index fc4d803002cb2ea106d9897ee8d99b9f7a5ab06a..57e16bc4283ce00eea494fb1e4c66d08008bc73d 100644 --- a/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs +++ b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -338,6 +338,14 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { .await?) } + async fn minimum_backing_votes( + &self, + at: Hash, + session_index: polkadot_primitives::SessionIndex, + ) -> Result { + Ok(self.rpc_client.parachain_host_minimum_backing_votes(at, session_index).await?) + } + async fn staging_async_backing_params(&self, at: Hash) -> Result { Ok(self.rpc_client.parachain_host_staging_async_backing_params(at).await?) } diff --git a/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs b/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs index 0acd04e73cd83d03be20898141bed9495752a8d7..491758c1329a3427f9e206b8f118053cb4f304bf 100644 --- a/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs +++ b/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-minimal-node/src/lib.rs b/cumulus/client/relay-chain-minimal-node/src/lib.rs index 8d0228219089b6e5de4734fa9aa65fcb28ae9c2f..366d428eda70036203f48e253c9d395c58b887ec 100644 --- a/cumulus/client/relay-chain-minimal-node/src/lib.rs +++ b/cumulus/client/relay-chain-minimal-node/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-minimal-node/src/network.rs b/cumulus/client/relay-chain-minimal-node/src/network.rs index 5097e6ce33a672e8c09d1a2e641e486ca8c198c5..f39d7a26dd8838d693d8c32d62d51fa147c26cda 100644 --- a/cumulus/client/relay-chain-minimal-node/src/network.rs +++ b/cumulus/client/relay-chain-minimal-node/src/network.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-rpc-interface/Cargo.toml b/cumulus/client/relay-chain-rpc-interface/Cargo.toml index 1056efd2dc8eb60cebb224a8b58813b138ffb1a4..9797c512505ce38ac4dcb60466403a80d0f78a29 100644 --- a/cumulus/client/relay-chain-rpc-interface/Cargo.toml +++ b/cumulus/client/relay-chain-rpc-interface/Cargo.toml @@ -33,7 +33,7 @@ tracing = "0.1.37" async-trait = "0.1.73" url = "2.4.0" serde_json = "1.0.105" -serde = "1.0.183" +serde = "1.0.188" schnellru = "0.2.1" smoldot = { version = "0.11.0", default_features = false, features = ["std"]} smoldot-light = { version = "0.9.0", default_features = false, features = ["std"] } diff --git a/cumulus/client/relay-chain-rpc-interface/src/lib.rs b/cumulus/client/relay-chain-rpc-interface/src/lib.rs index c01f38433dc7b266b43445d016aed3f45b4ee9c3..96f8fc8b5563335eb7796bc8fd105fced15bc5e1 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/lib.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs b/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs index b6773870512843549af0d38e902d2b40a0effb6d..84e66f95571096c319ab1aa05a12a11cdc4c1035 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs b/cumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs index 5a35b2b5bfa0724a0dedc76eae871154d8044bd2..322bcc93dae6d8158a0e6cfb99ded9a29bee79c5 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs b/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs index b079294b78421f11a6b770236bc00a95775c93dd..c1e92b249d776126f8de30db2b021898e50219fc 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -588,6 +588,16 @@ impl RelayChainRpcClient { .await } + /// Get the minimum number of backing votes for a candidate. + pub async fn parachain_host_minimum_backing_votes( + &self, + at: RelayHash, + _session_index: SessionIndex, + ) -> Result { + self.call_remote_runtime_function("ParachainHost_minimum_backing_votes", at, None::<()>) + .await + } + #[allow(missing_docs)] pub async fn parachain_host_staging_async_backing_params( &self, diff --git a/cumulus/client/relay-chain-rpc-interface/src/tokio_platform.rs b/cumulus/client/relay-chain-rpc-interface/src/tokio_platform.rs index 7b8c69645b61bc6985119c266e5bc8a370264158..75a5604d741b4fe92e55cfe4f55fdaba747e4bb5 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/tokio_platform.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/tokio_platform.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/client/service/src/lib.rs b/cumulus/client/service/src/lib.rs index 11b6240eb73fc890033ca66b9c514b00ccb0b5c6..211a5cc3b79bc7b8d59aed9300b0a442f5372de8 100644 --- a/cumulus/client/service/src/lib.rs +++ b/cumulus/client/service/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/file_header.txt b/cumulus/file_header.txt index 04f0c5de2716eb3f5c6037a67cca718c56b56e1e..712045bf2ca1506c47abc51d93b8e231133f0011 100644 --- a/cumulus/file_header.txt +++ b/cumulus/file_header.txt @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/aura-ext/src/consensus_hook.rs b/cumulus/pallets/aura-ext/src/consensus_hook.rs index 745ee7a3352d305b777ef794b4dd902d7cc05c2a..089ab5c3198b98129e53e155dc4fcc009bf0e6d8 100644 --- a/cumulus/pallets/aura-ext/src/consensus_hook.rs +++ b/cumulus/pallets/aura-ext/src/consensus_hook.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/aura-ext/src/lib.rs b/cumulus/pallets/aura-ext/src/lib.rs index d22202bdbaa8f8d7067288ec243ce50c3dc60da5..34a41557152d8df38e0abc2d612151b2f74dc779 100644 --- a/cumulus/pallets/aura-ext/src/lib.rs +++ b/cumulus/pallets/aura-ext/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/collator-selection/src/benchmarking.rs b/cumulus/pallets/collator-selection/src/benchmarking.rs index 5eb8a5ce65bf41d700e119db1aa091b5eed9e647..49999dc114df7bdc94dca2f8c563d7c1d8bb6083 100644 --- a/cumulus/pallets/collator-selection/src/benchmarking.rs +++ b/cumulus/pallets/collator-selection/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs index 924b24d71047da62dc96c7e979f8ea97a73e7df6..24493ce9d9cdc7f451f2e997615962ee5f0662e0 100644 --- a/cumulus/pallets/collator-selection/src/lib.rs +++ b/cumulus/pallets/collator-selection/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/collator-selection/src/migration.rs b/cumulus/pallets/collator-selection/src/migration.rs index 3b298353386d0f8265004033a297d17575eae1e9..58b4cc5b06a1ab7da17b31ad3c457fd992c59136 100644 --- a/cumulus/pallets/collator-selection/src/migration.rs +++ b/cumulus/pallets/collator-selection/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/collator-selection/src/mock.rs b/cumulus/pallets/collator-selection/src/mock.rs index d8c6d783f3f3a538bf0013ba1bafda33b63485db..44d531c971ee3bee08f572ac797a93d1759a5cfa 100644 --- a/cumulus/pallets/collator-selection/src/mock.rs +++ b/cumulus/pallets/collator-selection/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/collator-selection/src/tests.rs b/cumulus/pallets/collator-selection/src/tests.rs index cbfbde743f0ee583b0e729cb7718c736c491d76f..d4dae513df375145c35a83d7af274e581a94a60b 100644 --- a/cumulus/pallets/collator-selection/src/tests.rs +++ b/cumulus/pallets/collator-selection/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/collator-selection/src/weights.rs b/cumulus/pallets/collator-selection/src/weights.rs index a4a30d833612a11f8ad77ba08a13aefaaad3d8b8..f8f86fb7dec2c08601eebe4d8b345a0f7c930b70 100644 --- a/cumulus/pallets/collator-selection/src/weights.rs +++ b/cumulus/pallets/collator-selection/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/dmp-queue/Cargo.toml b/cumulus/pallets/dmp-queue/Cargo.toml index db654b4c1327f8d4000cf33ee77b3c5d88a02cf0..9d61a2c99fd35af24ac0bdd51a4dfb5aa4b5fd65 100644 --- a/cumulus/pallets/dmp-queue/Cargo.toml +++ b/cumulus/pallets/dmp-queue/Cargo.toml @@ -17,7 +17,7 @@ sp-runtime = { path = "../../../substrate/primitives/runtime", default-features sp-std = { path = "../../../substrate/primitives/std", default-features = false} # Polkadot -xcm = { path = "../../../polkadot/xcm", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} # Cumulus cumulus-primitives-core = { path = "../../primitives/core", default-features = false } diff --git a/cumulus/pallets/dmp-queue/src/lib.rs b/cumulus/pallets/dmp-queue/src/lib.rs index aca9025d9e33594a2897f383457fae6c04de5de9..eff4a625ef1b6ff88ae23cee2cc252af78921a67 100644 --- a/cumulus/pallets/dmp-queue/src/lib.rs +++ b/cumulus/pallets/dmp-queue/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/dmp-queue/src/migration.rs b/cumulus/pallets/dmp-queue/src/migration.rs index b2323f6a60fa6e14a333df27a2f986aaa646fed8..63457ee493697cc7e0b6cb32433cd0d55b9e2244 100644 --- a/cumulus/pallets/dmp-queue/src/migration.rs +++ b/cumulus/pallets/dmp-queue/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/parachain-system/Cargo.toml b/cumulus/pallets/parachain-system/Cargo.toml index 6dab4f75d7dc55d7019e9dc79bf9c02243b7d6af..3063083c0ee49d5f6e88db287de529a8eef0c80d 100644 --- a/cumulus/pallets/parachain-system/Cargo.toml +++ b/cumulus/pallets/parachain-system/Cargo.toml @@ -28,8 +28,8 @@ sp-trie = { path = "../../../substrate/primitives/trie", default-features = fals sp-version = { path = "../../../substrate/primitives/version", default-features = false} # Polkadot -polkadot-parachain = { path = "../../../polkadot/parachain", default-features = false, features = [ "wasm-api" ]} -xcm = { path = "../../../polkadot/xcm", default-features = false} +polkadot-parachain-primitives = { path = "../../../polkadot/parachain", default-features = false, features = [ "wasm-api" ]} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} # Cumulus cumulus-pallet-parachain-system-proc-macro = { path = "proc-macro", default-features = false } @@ -62,7 +62,7 @@ std = [ "frame-support/std", "frame-system/std", "log/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "scale-info/std", "sp-core/std", "sp-externalities/std", @@ -79,7 +79,7 @@ std = [ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] diff --git a/cumulus/pallets/parachain-system/proc-macro/src/lib.rs b/cumulus/pallets/parachain-system/proc-macro/src/lib.rs index 70c6857120c73466bd3f1e9c49eec4e2bffd8701..8ab5d81efdcf486dff67db6a1f5a62a5a8454ae8 100644 --- a/cumulus/pallets/parachain-system/proc-macro/src/lib.rs +++ b/cumulus/pallets/parachain-system/proc-macro/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -142,7 +142,7 @@ pub fn register_validate_block(input: proc_macro::TokenStream) -> proc_macro::To #check_inherents, >(params); - #crate_::validate_block::polkadot_parachain::write_result(&res) + #crate_::validate_block::polkadot_parachain_primitives::write_result(&res) } } } diff --git a/cumulus/pallets/parachain-system/src/consensus_hook.rs b/cumulus/pallets/parachain-system/src/consensus_hook.rs index 2566eea9bbcc2ad3d418ca9765ececcdabf77bf2..91353fc7bbda7ce05cfb5259e05bde64c758bbe4 100644 --- a/cumulus/pallets/parachain-system/src/consensus_hook.rs +++ b/cumulus/pallets/parachain-system/src/consensus_hook.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index ded869bf6f793aae860eee4e26d9f1e58515a5d6..a8e9a0bf9ae4460b7cda5ef1f7b49bb5c0629eef 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -36,7 +36,7 @@ use cumulus_primitives_core::{ }; use cumulus_primitives_parachain_inherent::{MessageQueueChain, ParachainInherentData}; use frame_support::{ - dispatch::{DispatchError, DispatchResult, Pays, PostDispatchInfo}, + dispatch::{DispatchResult, Pays, PostDispatchInfo}, ensure, inherent::{InherentData, InherentIdentifier, ProvideInherent}, storage, @@ -44,7 +44,7 @@ use frame_support::{ weights::Weight, }; use frame_system::{ensure_none, ensure_root, pallet_prelude::HeaderFor}; -use polkadot_parachain::primitives::RelayChainBlockNumber; +use polkadot_parachain_primitives::primitives::RelayChainBlockNumber; use scale_info::TypeInfo; use sp_runtime::{ traits::{Block as BlockT, BlockNumberProvider, Hash}, @@ -52,7 +52,7 @@ use sp_runtime::{ InvalidTransaction, TransactionLongevity, TransactionSource, TransactionValidity, ValidTransaction, }, - RuntimeDebug, + DispatchError, RuntimeDebug, }; use sp_std::{cmp, collections::btree_map::BTreeMap, prelude::*}; use xcm::latest::XcmHash; @@ -1429,7 +1429,7 @@ impl Pallet { pub fn initialize_for_set_code_benchmark(max_code_size: u32) { // insert dummy ValidationData let vfp = PersistedValidationData { - parent_head: polkadot_parachain::primitives::HeadData(Default::default()), + parent_head: polkadot_parachain_primitives::primitives::HeadData(Default::default()), relay_parent_number: 1, relay_parent_storage_root: Default::default(), max_pov_size: 1_000, diff --git a/cumulus/pallets/parachain-system/src/migration.rs b/cumulus/pallets/parachain-system/src/migration.rs index 17dce3a11a9da9d193e342df083c295d7db85294..a92f85b9cd420e9e1027d1f82c643d90fea8b97c 100644 --- a/cumulus/pallets/parachain-system/src/migration.rs +++ b/cumulus/pallets/parachain-system/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/parachain-system/src/relay_state_snapshot.rs b/cumulus/pallets/parachain-system/src/relay_state_snapshot.rs index b8556485041657e9664f061d1121ba0ac4d59547..5519d1521ea6da85573f2ecdd9cca001616b5806 100644 --- a/cumulus/pallets/parachain-system/src/relay_state_snapshot.rs +++ b/cumulus/pallets/parachain-system/src/relay_state_snapshot.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/parachain-system/src/tests.rs b/cumulus/pallets/parachain-system/src/tests.rs index 41e8dc63808d7178a7da38d3f3b76c5a8406f6f9..626196790bc99f611c099a815019e336b4dd7df0 100755 --- a/cumulus/pallets/parachain-system/src/tests.rs +++ b/cumulus/pallets/parachain-system/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -23,10 +23,9 @@ use cumulus_primitives_core::{ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use frame_support::{ assert_ok, - dispatch::UnfilteredDispatchable, inherent::{InherentData, ProvideInherent}, parameter_types, - traits::{OnFinalize, OnInitialize}, + traits::{OnFinalize, OnInitialize, UnfilteredDispatchable}, weights::Weight, }; use frame_system::{ diff --git a/cumulus/pallets/parachain-system/src/unincluded_segment.rs b/cumulus/pallets/parachain-system/src/unincluded_segment.rs index 2598228dd60c41a53b921c805b72cfff00a526c3..1e83a945c4ee37f2ad8ee1c45d11892f47c40be4 100644 --- a/cumulus/pallets/parachain-system/src/unincluded_segment.rs +++ b/cumulus/pallets/parachain-system/src/unincluded_segment.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs index 0eb83639018bf28f234907f819f2a4bdaf27b0a6..ce3b724420f1c9e50b65a81074e023c6b735227b 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -22,7 +22,9 @@ use cumulus_primitives_core::{ }; use cumulus_primitives_parachain_inherent::ParachainInherentData; -use polkadot_parachain::primitives::{HeadData, RelayChainBlockNumber, ValidationResult}; +use polkadot_parachain_primitives::primitives::{ + HeadData, RelayChainBlockNumber, ValidationResult, +}; use codec::Encode; diff --git a/cumulus/pallets/parachain-system/src/validate_block/mod.rs b/cumulus/pallets/parachain-system/src/validate_block/mod.rs index 4e387bf849623f0aea2c3ab5ae82c851a166b278..db149401638aabeb65f3242fc450e27f8edb93cd 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/mod.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -34,7 +34,7 @@ pub use bytes; pub use codec::decode_from_bytes; #[cfg(not(feature = "std"))] #[doc(hidden)] -pub use polkadot_parachain; +pub use polkadot_parachain_primitives; #[cfg(not(feature = "std"))] #[doc(hidden)] pub use sp_runtime::traits::GetRuntimeBlockType; @@ -42,15 +42,16 @@ pub use sp_runtime::traits::GetRuntimeBlockType; #[doc(hidden)] pub use sp_std; -/// Basically the same as [`ValidationParams`](polkadot_parachain::primitives::ValidationParams), -/// but a little bit optimized for our use case here. +/// Basically the same as +/// [`ValidationParams`](polkadot_parachain_primitives::primitives::ValidationParams), but a little +/// bit optimized for our use case here. /// /// `block_data` and `head_data` are represented as [`bytes::Bytes`] to make them reuse /// the memory of the input parameter of the exported `validate_blocks` function. /// /// The layout of this type must match exactly the layout of -/// [`ValidationParams`](polkadot_parachain::primitives::ValidationParams) to have the same -/// SCALE encoding. +/// [`ValidationParams`](polkadot_parachain_primitives::primitives::ValidationParams) to have the +/// same SCALE encoding. #[derive(codec::Decode)] #[cfg_attr(feature = "std", derive(codec::Encode))] #[doc(hidden)] diff --git a/cumulus/pallets/parachain-system/src/validate_block/tests.rs b/cumulus/pallets/parachain-system/src/validate_block/tests.rs index 7772f6372567a70e43a8c38fe9e93aaf89a901b4..0cf68f25cc34b7be302b5983d5f7f27fcfcf13f1 100644 --- a/cumulus/pallets/parachain-system/src/validate_block/tests.rs +++ b/cumulus/pallets/parachain-system/src/validate_block/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/session-benchmarking/src/lib.rs b/cumulus/pallets/session-benchmarking/src/lib.rs index 5217bbae71b478b74f917a071b8144a122953353..f474def6b13762136ca90b2f812e9c5a3e26a0e2 100644 --- a/cumulus/pallets/session-benchmarking/src/lib.rs +++ b/cumulus/pallets/session-benchmarking/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/solo-to-para/src/lib.rs b/cumulus/pallets/solo-to-para/src/lib.rs index 5672ec4ece4ab4763be94c786eb60bf3a2366885..da948615d4e90a5f109cb56b47f796acead6535c 100644 --- a/cumulus/pallets/solo-to-para/src/lib.rs +++ b/cumulus/pallets/solo-to-para/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/xcm/Cargo.toml b/cumulus/pallets/xcm/Cargo.toml index 42a9d52993cfbb095b6b27fd08ddb3230bf8f5df..229edaaab4c881c7399ff6036dafbb2f0d7ba1e2 100644 --- a/cumulus/pallets/xcm/Cargo.toml +++ b/cumulus/pallets/xcm/Cargo.toml @@ -14,7 +14,7 @@ sp-runtime = { path = "../../../substrate/primitives/runtime", default-features frame-support = { path = "../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../substrate/frame/system", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} cumulus-primitives-core = { path = "../../primitives/core", default-features = false } diff --git a/cumulus/pallets/xcm/src/lib.rs b/cumulus/pallets/xcm/src/lib.rs index f230ced5dc5581eb0e2573676391c99aa5e575da..69b4f43754003495b4e6cec9b8e9e29e1ce73a08 100644 --- a/cumulus/pallets/xcm/src/lib.rs +++ b/cumulus/pallets/xcm/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -24,7 +24,7 @@ use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_core::{ relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler, ParaId, }; -use frame_support::dispatch::Weight; +use frame_support::weights::Weight; pub use pallet::*; use scale_info::TypeInfo; use sp_runtime::{traits::BadOrigin, RuntimeDebug}; diff --git a/cumulus/pallets/xcmp-queue/Cargo.toml b/cumulus/pallets/xcmp-queue/Cargo.toml index 919749c0f4523da69d8086b5e2f41b3d0314b028..de4ad61de9e090c3095009cde286d37137db34ce 100644 --- a/cumulus/pallets/xcmp-queue/Cargo.toml +++ b/cumulus/pallets/xcmp-queue/Cargo.toml @@ -19,8 +19,8 @@ sp-std = { path = "../../../substrate/primitives/std", default-features = false} # Polkadot polkadot-runtime-common = { path = "../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-primitives-core = { path = "../../primitives/core", default-features = false } @@ -35,7 +35,7 @@ sp-core = { path = "../../../substrate/primitives/core" } pallet-balances = { path = "../../../substrate/frame/balances" } # Polkadot -xcm-builder = { path = "../../../polkadot/xcm/xcm-builder" } +xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder" } # Cumulus cumulus-pallet-parachain-system = { path = "../parachain-system" } diff --git a/cumulus/pallets/xcmp-queue/src/benchmarking.rs b/cumulus/pallets/xcmp-queue/src/benchmarking.rs index f4167e522fa4bcb8cc6453a31e0f6c95e69df4d0..17ec60a2f3fafe9d257074fc803c6567b4422c31 100644 --- a/cumulus/pallets/xcmp-queue/src/benchmarking.rs +++ b/cumulus/pallets/xcmp-queue/src/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/xcmp-queue/src/lib.rs b/cumulus/pallets/xcmp-queue/src/lib.rs index 960af9b5b7724acd70f2dd6d82d8d4d897b4eb3a..1cb92f59518697d184ca9a6eac407ccdef86f8f2 100644 --- a/cumulus/pallets/xcmp-queue/src/lib.rs +++ b/cumulus/pallets/xcmp-queue/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/xcmp-queue/src/migration.rs b/cumulus/pallets/xcmp-queue/src/migration.rs index bda54620cd9bd07e4a8020dce892a640d087aa3f..a54ddfb9cecd0888bb0b54ab19a28d5796e41fab 100644 --- a/cumulus/pallets/xcmp-queue/src/migration.rs +++ b/cumulus/pallets/xcmp-queue/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/cumulus/pallets/xcmp-queue/src/mock.rs b/cumulus/pallets/xcmp-queue/src/mock.rs index 5573408781481b2d428e85700c14b369c12e085f..a3f10fa5428ce2cc67ada4359cd81f8b5c180fa5 100644 --- a/cumulus/pallets/xcmp-queue/src/mock.rs +++ b/cumulus/pallets/xcmp-queue/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/xcmp-queue/src/tests.rs b/cumulus/pallets/xcmp-queue/src/tests.rs index 45c4519d3aa496b06744c5bc35f9ec2092d69c23..2929e8452bef6095aa1e2ba4f168d85482f0b3b2 100644 --- a/cumulus/pallets/xcmp-queue/src/tests.rs +++ b/cumulus/pallets/xcmp-queue/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/pallets/xcmp-queue/src/weights.rs b/cumulus/pallets/xcmp-queue/src/weights.rs index cbb29ac3ae3166c9a0e2b9c03196396408b5f647..2d20bba6f8f6b18571ea4d241d57f08998d13d87 100644 --- a/cumulus/pallets/xcmp-queue/src/weights.rs +++ b/cumulus/pallets/xcmp-queue/src/weights.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(unused_parens)] #![allow(unused_imports)] diff --git a/cumulus/parachain-template/node/Cargo.toml b/cumulus/parachain-template/node/Cargo.toml index d85fd5a6178b787bc5f84494a51d2e849950e706..b1f1946e3ed457f04a9b2623969df02d6016d842 100644 --- a/cumulus/parachain-template/node/Cargo.toml +++ b/cumulus/parachain-template/node/Cargo.toml @@ -8,12 +8,13 @@ homepage = "https://substrate.io" repository.workspace = true edition.workspace = true build = "build.rs" +publish = false [dependencies] -clap = { version = "4.3.24", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } log = "0.4.20" codec = { package = "parity-scale-codec", version = "3.0.0" } -serde = { version = "1.0.183", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } futures = "0.3.28" @@ -55,7 +56,7 @@ substrate-prometheus-endpoint = { path = "../../../substrate/utils/prometheus" } # Polkadot polkadot-cli = { path = "../../../polkadot/cli", features = ["rococo-native"] } polkadot-primitives = { path = "../../../polkadot/primitives" } -xcm = { path = "../../../polkadot/xcm", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} # Cumulus cumulus-client-cli = { path = "../../client/cli" } diff --git a/cumulus/parachain-template/pallets/template/Cargo.toml b/cumulus/parachain-template/pallets/template/Cargo.toml index e06f836c3be0ebe4c77dfd846bb33758f18ba3bf..af35ab651dc48e85da2a6d138f84de367cb033f8 100644 --- a/cumulus/parachain-template/pallets/template/Cargo.toml +++ b/cumulus/parachain-template/pallets/template/Cargo.toml @@ -21,7 +21,7 @@ frame-support = { path = "../../../../substrate/frame/support", default-features frame-system = { path = "../../../../substrate/frame/system", default-features = false} [dev-dependencies] -serde = { version = "1.0.183" } +serde = { version = "1.0.188" } # Substrate sp-core = { path = "../../../../substrate/primitives/core", default-features = false} diff --git a/cumulus/parachain-template/runtime/Cargo.toml b/cumulus/parachain-template/runtime/Cargo.toml index b321d6e316068fda852472a8518b301aa79ae99b..f26b7be23533a284aaf2d1bdbb2232daaf7509e5 100644 --- a/cumulus/parachain-template/runtime/Cargo.toml +++ b/cumulus/parachain-template/runtime/Cargo.toml @@ -54,11 +54,11 @@ sp-version = { path = "../../../substrate/primitives/version", default-features # Polkadot pallet-xcm = { path = "../../../polkadot/xcm/pallet-xcm", default-features = false} -polkadot-parachain = { path = "../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../pallets/aura-ext", default-features = false } @@ -104,7 +104,7 @@ std = [ "pallet-transaction-payment/std", "pallet-xcm/std", "parachain-info/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "scale-info/std", "sp-api/std", @@ -139,7 +139,7 @@ runtime-benchmarks = [ "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/cumulus/parachain-template/runtime/src/weights/block_weights.rs b/cumulus/parachain-template/runtime/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachain-template/runtime/src/weights/block_weights.rs +++ b/cumulus/parachain-template/runtime/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachain-template/runtime/src/weights/extrinsic_weights.rs b/cumulus/parachain-template/runtime/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachain-template/runtime/src/weights/extrinsic_weights.rs +++ b/cumulus/parachain-template/runtime/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachain-template/runtime/src/weights/mod.rs b/cumulus/parachain-template/runtime/src/weights/mod.rs index ed0b4dbcd47fbffb125bda4b337099ae69e51ce2..30fa2c4060689ff98cc427c84f81866172845e52 100644 --- a/cumulus/parachain-template/runtime/src/weights/mod.rs +++ b/cumulus/parachain-template/runtime/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachain-template/runtime/src/weights/paritydb_weights.rs b/cumulus/parachain-template/runtime/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachain-template/runtime/src/weights/paritydb_weights.rs +++ b/cumulus/parachain-template/runtime/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachain-template/runtime/src/weights/rocksdb_weights.rs b/cumulus/parachain-template/runtime/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachain-template/runtime/src/weights/rocksdb_weights.rs +++ b/cumulus/parachain-template/runtime/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachain-template/runtime/src/xcm_config.rs b/cumulus/parachain-template/runtime/src/xcm_config.rs index ff996d4dde306d18ef2e0481c51e723d41e00ab7..353f68d22e35085a4b6fb803171a7b5d3c680fc6 100644 --- a/cumulus/parachain-template/runtime/src/xcm_config.rs +++ b/cumulus/parachain-template/runtime/src/xcm_config.rs @@ -9,7 +9,7 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/cumulus/parachains/common/Cargo.toml b/cumulus/parachains/common/Cargo.toml index 1b790dd5b6f116dd846029eef1bac91ea69244fd..0c863b7295b4c216761b2d4127911849bd2b6e3c 100644 --- a/cumulus/parachains/common/Cargo.toml +++ b/cumulus/parachains/common/Cargo.toml @@ -29,9 +29,9 @@ sp-std = { path = "../../../substrate/primitives/std", default-features = false # Polkadot polkadot-primitives = { path = "../../../polkadot/primitives", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false } diff --git a/cumulus/parachains/common/src/impls.rs b/cumulus/parachains/common/src/impls.rs index 4a1f4f90d05571381ad22b90e02ace54f1dc518a..107cd5c687328bce1369c59cfa7d4fcbcdd377f3 100644 --- a/cumulus/parachains/common/src/impls.rs +++ b/cumulus/parachains/common/src/impls.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/common/src/lib.rs b/cumulus/parachains/common/src/lib.rs index 0a9686bf8a3719499f08c9e84d7351561013d0f5..797010d49a0715c2851f3f802b4317e8653a4916 100644 --- a/cumulus/parachains/common/src/lib.rs +++ b/cumulus/parachains/common/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/common/src/xcm_config.rs b/cumulus/parachains/common/src/xcm_config.rs index 99dd0ace0fc59b553493129a179958ea37d45f16..146671441453df76c48776e0b202166aca37361b 100644 --- a/cumulus/parachains/common/src/xcm_config.rs +++ b/cumulus/parachains/common/src/xcm_config.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::impls::AccountIdOf; use core::marker::PhantomData; use frame_support::{ diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml index 6c3cf42ff3556eef1584b775b861a3152fa7dea4..d45a201a4d051e341f9a0c88ecfe073c90549598 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Asset Hub Kusama runtime integration tests with xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -13,28 +14,38 @@ assert_matches = "1.5.0" sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../../../../substrate/frame/system", default-features = false} -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../../substrate/primitives/weights", default-features = false} pallet-balances = { path = "../../../../../../substrate/frame/balances", default-features = false} pallet-assets = { path = "../../../../../../substrate/frame/assets", default-features = false} pallet-asset-conversion = { path = "../../../../../../substrate/frame/asset-conversion", default-features = false} # Polkadot polkadot-core-primitives = { path = "../../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../../polkadot/parachain", default-features = false} polkadot-runtime-parachains = { path = "../../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../../polkadot/runtime/polkadot" } -xcm = { path = "../../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus parachains-common = { path = "../../../../common" } asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusama" } -cumulus-pallet-dmp-queue = { path = "../../../../../pallets/dmp-queue" } -cumulus-pallet-xcmp-queue = { path = "../../../../../pallets/xcmp-queue", default-features = false} -cumulus-pallet-parachain-system = { path = "../../../../../pallets/parachain-system" } # Local xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false} integration-tests-common = { path = "../../common", default-features = false} + +[features] +runtime-benchmarks = [ + "asset-hub-kusama-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "integration-tests-common/runtime-benchmarks", + "pallet-asset-conversion/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-runtime-parachains/runtime-benchmarks", + "polkadot-runtime/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs index 2609ba4ca8dc73b98978164030c56ec3a1734e37..9325ca54b068f6b2d9e7cdaa9b3a833cb41ff4ea 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -17,42 +17,28 @@ pub use codec::Encode; pub use frame_support::{ assert_err, assert_ok, - instances::Instance1, pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult, MultiAddress}, - traits::{fungibles::Inspect, OriginTrait}, + sp_runtime::{AccountId32, DispatchError, DispatchResult}, + traits::fungibles::Inspect, }; pub use integration_tests_common::{ constants::{ - accounts::{ALICE, BOB}, - asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, - kusama::ED as KUSAMA_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, kusama::ED as KUSAMA_ED, PROOF_SIZE_THRESHOLD, + REF_TIME_THRESHOLD, XCM_V3, }, - lazy_static::lazy_static, - xcm_transact_paid_execution, xcm_transact_unpaid_execution, AccountId, AssetHubKusama, - AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, BridgeHubKusama, - BridgeHubKusamaPallet, BridgeHubKusamaReceiver, BridgeHubKusamaSender, BridgeHubPolkadot, - BridgeHubPolkadotPallet, BridgeHubPolkadotReceiver, BridgeHubPolkadotSender, Collectives, - CollectivesPallet, CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, - KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet, PenpalKusamaAReceiver, - PenpalKusamaASender, PenpalKusamaB, PenpalKusamaBPallet, PenpalKusamaBReceiver, - PenpalKusamaBSender, PenpalPolkadotA, PenpalPolkadotAReceiver, PenpalPolkadotASender, Polkadot, - PolkadotMockNet, PolkadotPallet, PolkadotReceiver, PolkadotSender, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, Kusama, + KusamaPallet, KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet, + PenpalKusamaAReceiver, PenpalKusamaASender, PenpalKusamaB, PenpalKusamaBPallet, }; -pub use parachains_common::Balance; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; +pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::*, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Kusama as KusamaId}, - DoubleEncoded, }; pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; @@ -101,4 +87,5 @@ pub fn system_para_test_args( } #[cfg(test)] +#[cfg(not(feature = "runtime-benchmarks"))] mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/hrmp_channels.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/hrmp_channels.rs index 99dd042ccafb8745d0f8abfaf236b6aafb0212e3..8647c1aa0081044500a1f8efaf9b444b90d752bb 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/hrmp_channels.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/hrmp_channels.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -21,7 +21,6 @@ const MAX_MESSAGE_SIZE: u32 = 8192; /// Opening HRMP channels between Parachains should work #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn open_hrmp_channel_between_paras_works() { // Parchain A init values let para_a_id = PenpalKusamaA::para_id(); @@ -110,6 +109,8 @@ fn open_hrmp_channel_between_paras_works() { PenpalKusamaB::assert_xcm_pallet_sent(); }); + PenpalKusamaB::execute_with(|| {}); + Kusama::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs index 73dd76ec9c66b817818a4f58d0539553943b309c..41d8406581930a48630818f4ba9c63497863f3bf 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index 9e11830acce2499f9918ec9334f37c173a186235..26b3cdf68b1b817f30b20846db8bb7453b0751ee 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs index 819517ee840790eb4a8f36bee06c629a32903cd9..598256db83a0ee6cacc6e593c8b3e5ef0f3dfa9b 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -126,72 +126,73 @@ fn send_transact_native_from_system_para_to_relay_fails() { /// Parachain should be able to send XCM paying its fee with sufficient asset /// in the System Parachain #[test] -#[ignore] fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { - // let para_sovereign_account = AssetHubKusama::sovereign_account_id_of( - // AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()), - // ); - - // // Force create and mint assets for Parachain's sovereign account - // AssetHubKusama::force_create_and_mint_asset( - // ASSET_ID, - // ASSET_MIN_BALANCE, - // true, - // para_sovereign_account.clone(), - // ASSET_MIN_BALANCE * 1000000000, - // ); - - // // We just need a call that can pass the `SafeCallFilter` - // // Call values are not relevant - // let call = AssetHubKusama::force_create_asset_call( - // ASSET_ID, - // para_sovereign_account.clone(), - // true, - // ASSET_MIN_BALANCE, - // ); - - // let origin_kind = OriginKind::SovereignAccount; - // let fee_amount = ASSET_MIN_BALANCE * 1000000; - // let native_asset = - // (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); - - // let root_origin = ::RuntimeOrigin::root(); - // let system_para_destination = - // PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()).into(); - // let xcm = xcm_transact_paid_execution( - // call, - // origin_kind, - // native_asset, - // para_sovereign_account.clone(), - // ); - - // PenpalKusamaA::execute_with(|| { - // assert_ok!(::PolkadotXcm::send( - // root_origin, - // bx!(system_para_destination), - // bx!(xcm), - // )); - - // PenpalKusamaA::assert_xcm_pallet_sent(); - // }); - - // AssetHubKusama::execute_with(|| { - // type RuntimeEvent = ::RuntimeEvent; - - // AssetHubKusama::assert_xcmp_queue_success(Some(Weight::from_parts(2_176_414_000, 203_593))); - - // assert_expected_events!( - // AssetHubKusama, - // vec![ - // RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - // asset_id: *asset_id == ASSET_ID, - // owner: *owner == para_sovereign_account, - // balance: *balance == fee_amount, - // }, - // RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { - // asset_id: *asset_id == ASSET_ID, - // }, - // ] - // ); - // }); + let para_sovereign_account = AssetHubKusama::sovereign_account_id_of( + AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()), + ); + + // Force create and mint assets for Parachain's sovereign account + AssetHubKusama::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + para_sovereign_account.clone(), + ASSET_MIN_BALANCE * 1000000000, + ); + + // We just need a call that can pass the `SafeCallFilter` + // Call values are not relevant + let call = AssetHubKusama::force_create_asset_call( + ASSET_ID, + para_sovereign_account.clone(), + true, + ASSET_MIN_BALANCE, + ); + + let origin_kind = OriginKind::SovereignAccount; + let fee_amount = ASSET_MIN_BALANCE * 1000000; + let native_asset = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); + + let root_origin = ::RuntimeOrigin::root(); + let system_para_destination = + PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()).into(); + let xcm = xcm_transact_paid_execution( + call, + origin_kind, + native_asset, + para_sovereign_account.clone(), + ); + + PenpalKusamaA::execute_with(|| { + assert_ok!(::PolkadotXcm::send( + root_origin, + bx!(system_para_destination), + bx!(xcm), + )); + + PenpalKusamaA::assert_xcm_pallet_sent(); + }); + + PenpalKusamaA::execute_with(|| {}); + + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubKusama::assert_xcmp_queue_success(Some(Weight::from_parts(2_176_414_000, 203_593))); + + assert_expected_events!( + AssetHubKusama, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { + asset_id: *asset_id == ASSET_ID, + owner: *owner == para_sovereign_account, + balance: *balance == fee_amount, + }, + RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { + asset_id: *asset_id == ASSET_ID, + }, + ] + ); + }); } diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs index 0ab53b451224d1546dceac8d51ae9784ee747d6f..155ada2ec2f3384b00c43a954eca4cbd4570611d 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs index eb545155a540bceb6c5aeb0591d2c07ec2ee925e..aad93db9922e4db838b8c2a56849028bc3a7f697 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + use crate::*; use asset_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; use frame_support::{instances::Instance2, BoundedVec}; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs index cf9f5a2327206786e961f1a5e0d0db5fc324e89b..b671fd5b44480fa509ce1c47525d3dbc91db3e50 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -187,7 +187,6 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() { /// Limited Teleport of native asset from System Parachain to Relay Chain /// should work when there is enough balance in Relay Chain's `CheckAccount` #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { // Dependency - Relay Chain's `CheckAccount` should have enough balance limited_teleport_native_assets_from_relay_to_system_para_works(); @@ -226,7 +225,6 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { /// Limited Teleport of native asset from System Parachain to Relay Chain /// should't work when there is not enough balance in Relay Chain's `CheckAccount` #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn limited_teleport_native_assets_from_system_para_to_relay_fails() { // Init values for Relay Chain let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml index e3c49d4f200ce87f21559113a40af5d05facc69b..3d5d23e9963625fa664e0fb0f34ee0f4b31bb613 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Asset Hub Polkadot runtime integration tests with xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -12,26 +13,38 @@ codec = { package = "parity-scale-codec", version = "3.4.0", default-features = sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../../../../substrate/frame/system", default-features = false} -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../../substrate/primitives/weights", default-features = false} pallet-balances = { path = "../../../../../../substrate/frame/balances", default-features = false} pallet-assets = { path = "../../../../../../substrate/frame/assets", default-features = false} +pallet-asset-conversion = { path = "../../../../../../substrate/frame/asset-conversion", default-features = false} # Polkadot polkadot-core-primitives = { path = "../../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../../polkadot/parachain", default-features = false} polkadot-runtime-parachains = { path = "../../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../../polkadot/runtime/polkadot" } -xcm = { path = "../../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus parachains-common = { path = "../../../../common" } -cumulus-pallet-dmp-queue = { path = "../../../../../pallets/dmp-queue" } -cumulus-pallet-xcmp-queue = { path = "../../../../../pallets/xcmp-queue", default-features = false} -cumulus-pallet-parachain-system = { path = "../../../../../pallets/parachain-system" } +asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusama" } # Local xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false} integration-tests-common = { path = "../../common", default-features = false} + +[features] +runtime-benchmarks = [ + "asset-hub-kusama-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "integration-tests-common/runtime-benchmarks", + "pallet-asset-conversion/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-runtime-parachains/runtime-benchmarks", + "polkadot-runtime/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs index 9d87458f876c4ce6fa7969315d6a9bc3a7e8545e..6cbf6ab1ccb0eb516bb00cc810d51a19f99fee47 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -17,40 +17,28 @@ pub use codec::Encode; pub use frame_support::{ assert_err, assert_ok, - instances::Instance1, pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult, MultiAddress}, - traits::{fungibles::Inspect, OriginTrait}, + sp_runtime::{AccountId32, DispatchError, DispatchResult}, + traits::fungibles::Inspect, }; pub use integration_tests_common::{ constants::{ - accounts::{ALICE, BOB}, - asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, - polkadot::ED as POLKADOT_ED, + asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, polkadot::ED as POLKADOT_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, - lazy_static::lazy_static, - xcm_transact_paid_execution, xcm_transact_unpaid_execution, AssetHubPolkadot, - AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, BridgeHubPolkadot, - BridgeHubPolkadotPallet, BridgeHubPolkadotReceiver, BridgeHubPolkadotSender, Collectives, - CollectivesPallet, CollectivesReceiver, CollectivesSender, PenpalPolkadotA, - PenpalPolkadotAPallet, PenpalPolkadotAReceiver, PenpalPolkadotASender, PenpalPolkadotB, - PenpalPolkadotBPallet, PenpalPolkadotBReceiver, PenpalPolkadotBSender, Polkadot, - PolkadotMockNet, PolkadotPallet, PolkadotReceiver, PolkadotSender, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, + PenpalPolkadotA, PenpalPolkadotAPallet, PenpalPolkadotAReceiver, PenpalPolkadotB, + PenpalPolkadotBPallet, Polkadot, PolkadotPallet, PolkadotReceiver, PolkadotSender, }; pub use parachains_common::{AccountId, Balance}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; pub use xcm::{ - prelude::*, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Polkadot as PolkadotId}, - DoubleEncoded, }; pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; @@ -99,4 +87,5 @@ pub fn system_para_test_args( } #[cfg(test)] +#[cfg(not(feature = "runtime-benchmarks"))] mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/hrmp_channels.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/hrmp_channels.rs index 9335d69b4d7d4bcf87d07101677828ea72fd294c..337e4ba6113a15d6ad9dee05c6d683b028f77208 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/hrmp_channels.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/hrmp_channels.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -21,7 +21,6 @@ const MAX_MESSAGE_SIZE: u32 = 8192; /// Opening HRMP channels between Parachains should work #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn open_hrmp_channel_between_paras_works() { // Parchain A init values let para_a_id = PenpalPolkadotA::para_id(); @@ -110,6 +109,8 @@ fn open_hrmp_channel_between_paras_works() { PenpalPolkadotB::assert_xcm_pallet_sent(); }); + PenpalPolkadotB::execute_with(|| {}); + Polkadot::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs index 00e0a663e4794d5fe1577b6f72df0624116db7fe..547b59deadcb80360bfee2673df0c3274a56de8e 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index 7d773a5865ea0781d1d6b0ebab4c4242360e3b8a..e6722d585bc0906360327240b96fac37575137f3 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs index eb4c2ae6add09d9d1c980c2e3ae061640a7b17f8..978377b0fda3b0934a7d4160730d97152b19dfb4 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -129,75 +129,76 @@ fn send_transact_native_from_system_para_to_relay_fails() { /// Parachain should be able to send XCM paying its fee with sufficient asset /// in the System Parachain #[test] -#[ignore] fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { - // let para_sovereign_account = AssetHubPolkadot::sovereign_account_id_of( - // AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()), - // ); - - // // Force create and mint assets for Parachain's sovereign account - // AssetHubPolkadot::force_create_and_mint_asset( - // ASSET_ID, - // ASSET_MIN_BALANCE, - // true, - // para_sovereign_account.clone(), - // ASSET_MIN_BALANCE * 1000000000, - // ); - - // // We just need a call that can pass the `SafeCallFilter` - // // Call values are not relevant - // let call = AssetHubPolkadot::force_create_asset_call( - // ASSET_ID, - // para_sovereign_account.clone(), - // true, - // ASSET_MIN_BALANCE, - // ); - - // let origin_kind = OriginKind::SovereignAccount; - // let fee_amount = ASSET_MIN_BALANCE * 1000000; - // let native_asset = - // (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); - - // let root_origin = ::RuntimeOrigin::root(); - // let system_para_destination = - // PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()).into(); - // let xcm = xcm_transact_paid_execution( - // call, - // origin_kind, - // native_asset, - // para_sovereign_account.clone(), - // ); - - // PenpalPolkadotA::execute_with(|| { - // assert_ok!(::PolkadotXcm::send( - // root_origin, - // bx!(system_para_destination), - // bx!(xcm), - // )); - - // PenpalPolkadotA::assert_xcm_pallet_sent(); - // }); - - // AssetHubPolkadot::execute_with(|| { - // type RuntimeEvent = ::RuntimeEvent; - - // AssetHubPolkadot::assert_xcmp_queue_success(Some(Weight::from_parts( - // 2_176_414_000, - // 203_593, - // ))); - - // assert_expected_events!( - // AssetHubPolkadot, - // vec![ - // RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - // asset_id: *asset_id == ASSET_ID, - // owner: *owner == para_sovereign_account, - // balance: *balance == fee_amount, - // }, - // RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { - // asset_id: *asset_id == ASSET_ID, - // }, - // ] - // ); - // }); + let para_sovereign_account = AssetHubPolkadot::sovereign_account_id_of( + AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()), + ); + + // Force create and mint assets for Parachain's sovereign account + AssetHubPolkadot::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + para_sovereign_account.clone(), + ASSET_MIN_BALANCE * 1000000000, + ); + + // We just need a call that can pass the `SafeCallFilter` + // Call values are not relevant + let call = AssetHubPolkadot::force_create_asset_call( + ASSET_ID, + para_sovereign_account.clone(), + true, + ASSET_MIN_BALANCE, + ); + + let origin_kind = OriginKind::SovereignAccount; + let fee_amount = ASSET_MIN_BALANCE * 1000000; + let native_asset = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); + + let root_origin = ::RuntimeOrigin::root(); + let system_para_destination = + PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()).into(); + let xcm = xcm_transact_paid_execution( + call, + origin_kind, + native_asset, + para_sovereign_account.clone(), + ); + + PenpalPolkadotA::execute_with(|| { + assert_ok!(::PolkadotXcm::send( + root_origin, + bx!(system_para_destination), + bx!(xcm), + )); + + PenpalPolkadotA::assert_xcm_pallet_sent(); + }); + + PenpalPolkadotA::execute_with(|| {}); + + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubPolkadot::assert_xcmp_queue_success(Some(Weight::from_parts( + 2_176_414_000, + 203_593, + ))); + + assert_expected_events!( + AssetHubPolkadot, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { + asset_id: *asset_id == ASSET_ID, + owner: *owner == para_sovereign_account, + balance: *balance == fee_amount, + }, + RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { + asset_id: *asset_id == ASSET_ID, + }, + ] + ); + }); } diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs index 84abf630e507ee14e883b333963954ad4526b113..287bfa35ae9c69c07d81bfa23fb84a2084239d00 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs index 843ef6d3ccedb46bac0d788fb5860830bc0cb777..166f73137e750fa0b62492c427f962c472d25ef8 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml index 548c9a5f407caccd4de79eb9fcfc9208d313b925..34d34009ebd079f5a77aefd6c2812e5cdfa0f4db 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Asset Hub Westend runtime integration tests with xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -13,28 +14,38 @@ assert_matches = "1.5.0" sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../../../../substrate/frame/system", default-features = false} -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../../substrate/primitives/weights", default-features = false} pallet-balances = { path = "../../../../../../substrate/frame/balances", default-features = false} pallet-assets = { path = "../../../../../../substrate/frame/assets", default-features = false} pallet-asset-conversion = { path = "../../../../../../substrate/frame/asset-conversion", default-features = false} # Polkadot polkadot-core-primitives = { path = "../../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../../polkadot/parachain", default-features = false} polkadot-runtime-parachains = { path = "../../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../../polkadot/runtime/polkadot" } -xcm = { path = "../../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus parachains-common = { path = "../../../../common" } asset-hub-westend-runtime = { path = "../../../../runtimes/assets/asset-hub-westend" } -cumulus-pallet-dmp-queue = { path = "../../../../../pallets/dmp-queue" } -cumulus-pallet-xcmp-queue = { path = "../../../../../pallets/xcmp-queue", default-features = false} -cumulus-pallet-parachain-system = { path = "../../../../../pallets/parachain-system" } # Local xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false} integration-tests-common = { path = "../../common", default-features = false} + +[features] +runtime-benchmarks = [ + "asset-hub-westend-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "integration-tests-common/runtime-benchmarks", + "pallet-asset-conversion/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-runtime-parachains/runtime-benchmarks", + "polkadot-runtime/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs index b7f064e7d6ea791076b896636b2fca286ecb6ad9..2c89c0f9dd46982c2099f7f36e5a16f1724c6f82 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -17,39 +17,30 @@ pub use codec::Encode; pub use frame_support::{ assert_err, assert_ok, - instances::{Instance1, Instance2}, + instances::Instance2, pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult, ModuleError, MultiAddress}, - traits::{fungibles::Inspect, OriginTrait}, + sp_runtime::{AccountId32, DispatchError, DispatchResult, ModuleError}, + traits::fungibles::Inspect, BoundedVec, }; pub use integration_tests_common::{ constants::{ - accounts::{ALICE, BOB}, - asset_hub_westend::ED as ASSET_HUB_WESTEND_ED, - westend::ED as WESTEND_ED, + asset_hub_westend::ED as ASSET_HUB_WESTEND_ED, westend::ED as WESTEND_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, - lazy_static::lazy_static, - xcm_transact_paid_execution, xcm_transact_unpaid_execution, AssetHubWestend, - AssetHubWestendPallet, AssetHubWestendReceiver, AssetHubWestendSender, Collectives, - CollectivesPallet, CollectivesReceiver, CollectivesSender, PenpalWestendA, - PenpalWestendAPallet, PenpalWestendAReceiver, PenpalWestendASender, Westend, WestendMockNet, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubWestend, AssetHubWestendPallet, AssetHubWestendReceiver, AssetHubWestendSender, + PenpalWestendA, PenpalWestendAPallet, PenpalWestendAReceiver, PenpalWestendASender, Westend, WestendPallet, WestendReceiver, WestendSender, }; pub use parachains_common::{AccountId, Balance}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; pub use xcm::{ - prelude::*, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Westend as WestendId}, - DoubleEncoded, }; pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; @@ -98,4 +89,5 @@ pub fn system_para_test_args( } #[cfg(test)] +#[cfg(not(feature = "runtime-benchmarks"))] mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs index e45b78da1c254ef4c42b8b746d5732ea7539cfee..e2a60e0b300443c49dec7e27551ac8641dc8ab29 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs index 8d3c5358a37f6d95460ecc99c51980806cc35c7f..67fc53a826aa9185857ae6497a5c32670fb2a413 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/send.rs index 87dfab93a5b5790d6bfcae39c7e300f10b893196..f2040351e5dbf624750deb31204ff2fc3a2f3b26 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/send.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/send.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -68,75 +68,76 @@ fn send_transact_sudo_from_relay_to_system_para_works() { /// Parachain should be able to send XCM paying its fee with sufficient asset /// in the System Parachain #[test] -#[ignore] fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { - // let para_sovereign_account = AssetHubWestend::sovereign_account_id_of( - // AssetHubWestend::sibling_location_of(PenpalWestendA::para_id()), - // ); - - // // Force create and mint assets for Parachain's sovereign account - // AssetHubWestend::force_create_and_mint_asset( - // ASSET_ID, - // ASSET_MIN_BALANCE, - // true, - // para_sovereign_account.clone(), - // ASSET_MIN_BALANCE * 1000000000, - // ); - - // // We just need a call that can pass the `SafeCallFilter` - // // Call values are not relevant - // let call = AssetHubWestend::force_create_asset_call( - // ASSET_ID, - // para_sovereign_account.clone(), - // true, - // ASSET_MIN_BALANCE, - // ); - - // let origin_kind = OriginKind::SovereignAccount; - // let fee_amount = ASSET_MIN_BALANCE * 1000000; - // let native_asset = - // (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); - - // let root_origin = ::RuntimeOrigin::root(); - // let system_para_destination = - // PenpalWestendA::sibling_location_of(AssetHubWestend::para_id()).into(); - // let xcm = xcm_transact_paid_execution( - // call, - // origin_kind, - // native_asset, - // para_sovereign_account.clone(), - // ); - - // PenpalWestendA::execute_with(|| { - // assert_ok!(::PolkadotXcm::send( - // root_origin, - // bx!(system_para_destination), - // bx!(xcm), - // )); - - // PenpalWestendA::assert_xcm_pallet_sent(); - // }); - - // AssetHubWestend::execute_with(|| { - // type RuntimeEvent = ::RuntimeEvent; - - // AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts( - // 2_176_414_000, - // 203_593, - // ))); - - // assert_expected_events!( - // AssetHubWestend, - // vec![ - // RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - // asset_id: *asset_id == ASSET_ID, - // owner: *owner == para_sovereign_account, - // balance: *balance == fee_amount, - // }, - // RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { - // asset_id: *asset_id == ASSET_ID, - // }, - // ] - // ); - // }); + let para_sovereign_account = AssetHubWestend::sovereign_account_id_of( + AssetHubWestend::sibling_location_of(PenpalWestendA::para_id()), + ); + + // Force create and mint assets for Parachain's sovereign account + AssetHubWestend::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + para_sovereign_account.clone(), + ASSET_MIN_BALANCE * 1000000000, + ); + + // We just need a call that can pass the `SafeCallFilter` + // Call values are not relevant + let call = AssetHubWestend::force_create_asset_call( + ASSET_ID, + para_sovereign_account.clone(), + true, + ASSET_MIN_BALANCE, + ); + + let origin_kind = OriginKind::SovereignAccount; + let fee_amount = ASSET_MIN_BALANCE * 1000000; + let native_asset = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); + + let root_origin = ::RuntimeOrigin::root(); + let system_para_destination = + PenpalWestendA::sibling_location_of(AssetHubWestend::para_id()).into(); + let xcm = xcm_transact_paid_execution( + call, + origin_kind, + native_asset, + para_sovereign_account.clone(), + ); + + PenpalWestendA::execute_with(|| { + assert_ok!(::PolkadotXcm::send( + root_origin, + bx!(system_para_destination), + bx!(xcm), + )); + + PenpalWestendA::assert_xcm_pallet_sent(); + }); + + PenpalWestendA::execute_with(|| {}); + + AssetHubWestend::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts( + 2_176_414_000, + 203_593, + ))); + + assert_expected_events!( + AssetHubWestend, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { + asset_id: *asset_id == ASSET_ID, + owner: *owner == para_sovereign_account, + balance: *balance == fee_amount, + }, + RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => { + asset_id: *asset_id == ASSET_ID, + }, + ] + ); + }); } diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/set_xcm_versions.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/set_xcm_versions.rs index 76e38083659edf13efeba34c288c55909647dbb7..57632527174566cbdc7996c8197389b8fd4a5232 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/set_xcm_versions.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/set_xcm_versions.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs index 03ac75146089976b8a4402e3918caaa9789f8c39..1c4dd9d76837c7291c7e409bfe2776975b0762de 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + use crate::*; #[test] diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs index 17f204f38077d65f8cfb8066d51b24f432f49192..233dc32b13b5ce70abc522c9bc03d6e9360dae1c 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/teleport.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -187,7 +187,6 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() { /// Limited Teleport of native asset from System Parachain to Relay Chain /// should work when there is enough balance in Relay Chain's `CheckAccount` #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { // Dependency - Relay Chain's `CheckAccount` should have enough balance limited_teleport_native_assets_from_relay_to_system_para_works(); @@ -226,7 +225,6 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { /// Limited Teleport of native asset from System Parachain to Relay Chain /// should't work when there is not enough balance in Relay Chain's `CheckAccount` #[test] -#[cfg(feature = "FIXME-IGNORED")] // fn limited_teleport_native_assets_from_system_para_to_relay_fails() { // Init values for Relay Chain let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000; diff --git a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/Cargo.toml index c4aba4f9110cfcba95b626f79d1ea60af72a7542..12a2ed51591fc54a636781b00653a79f7a471498 100644 --- a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/Cargo.toml @@ -4,32 +4,26 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Bridge Hub Rococo runtime integration tests with xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } # Substrate -sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../../substrate/frame/support", default-features = false} -frame-system = { path = "../../../../../../substrate/frame/system", default-features = false} -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../../substrate/primitives/weights", default-features = false} -pallet-balances = { path = "../../../../../../substrate/frame/balances", default-features = false} -pallet-assets = { path = "../../../../../../substrate/frame/assets", default-features = false} # Polkadot polkadot-core-primitives = { path = "../../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../../polkadot/parachain", default-features = false} polkadot-runtime-parachains = { path = "../../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../../polkadot/runtime/polkadot" } -xcm = { path = "../../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus parachains-common = { path = "../../../../common" } cumulus-pallet-xcmp-queue = { path = "../../../../../pallets/xcmp-queue", default-features = false} -cumulus-pallet-parachain-system = { path = "../../../../../pallets/parachain-system" } +cumulus-pallet-dmp-queue = { path = "../../../../../pallets/dmp-queue", default-features = false} pallet-bridge-messages = { path = "../../../../../bridges/modules/messages", default-features = false} bp-messages = { path = "../../../../../bridges/primitives/messages", default-features = false} diff --git a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs index 2a4927d857c366a513307585620c8586e1d9f8e0..0a923ec04de76006224e66a70a72fe00b2d4ef99 100644 --- a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -15,48 +15,27 @@ // along with Cumulus. If not, see . pub use bp_messages::LaneId; -pub use codec::Encode; -pub use frame_support::{ - assert_err, assert_ok, - instances::Instance1, - pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult, MultiAddress}, - traits::{fungibles::Inspect, OriginTrait}, -}; +pub use frame_support::assert_ok; pub use integration_tests_common::{ constants::{ - accounts::{ALICE, BOB}, - asset_hub_kusama::ED as ASSET_HUB_ROCOCO_ED, - kusama::ED as ROCOCO_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + asset_hub_kusama::ED as ASSET_HUB_ROCOCO_ED, kusama::ED as ROCOCO_ED, PROOF_SIZE_THRESHOLD, + REF_TIME_THRESHOLD, XCM_V3, }, - lazy_static::lazy_static, - xcm_transact_paid_execution, xcm_transact_unpaid_execution, AssetHubRococo, - AssetHubRococoPallet, AssetHubRococoReceiver, AssetHubRococoSender, AssetHubWococo, - AssetHubWococoPallet, AssetHubWococoReceiver, AssetHubWococoSender, BridgeHubRococo, - BridgeHubRococoPallet, BridgeHubRococoReceiver, BridgeHubRococoSender, BridgeHubWococo, - BridgeHubWococoPallet, BridgeHubWococoReceiver, BridgeHubWococoSender, Collectives, - CollectivesPallet, CollectivesReceiver, CollectivesSender, PenpalRococoA, PenpalRococoAPallet, - PenpalRococoAReceiver, PenpalRococoASender, Rococo, RococoMockNet, RococoPallet, - RococoReceiver, RococoSender, Wococo, WococoMockNet, WococoPallet, WococoReceiver, - WococoSender, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubRococo, AssetHubRococoReceiver, AssetHubWococo, BridgeHubRococo, BridgeHubWococo, + PenpalRococoA, Rococo, RococoPallet, }; pub use parachains_common::{AccountId, Balance}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; pub use xcm::{ - prelude::*, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{ Error, NetworkId::{Rococo as RococoId, Wococo as WococoId}, }, - DoubleEncoded, }; pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; @@ -85,4 +64,5 @@ pub fn relay_test_args(amount: Balance) -> TestArgs { } #[cfg(test)] +#[cfg(not(feature = "runtime-benchmarks"))] mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/example.rs b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/example.rs index 1293f65929a886b02d7d2080c12ea009dc15a13d..127292829fd5d1cd3b9f773868bf98f13e21fbd0 100644 --- a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/example.rs +++ b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/example.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/mod.rs index 532e31aa1a67464f501932db1c6684afbb31bb48..6e11743aecbf36cca86eda552528d8da00ee6b4b 100644 --- a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml index 1d0069dfd00ee6d42b5d519873617b4007ae180e..ee0e254befc5153aecfe909b25f89bae6481f615 100644 --- a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors.workspace = true edition.workspace = true description = "Polkadot Collectives parachain runtime integration tests based on xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } @@ -11,21 +12,17 @@ codec = { package = "parity-scale-codec", version = "3.4.0", default-features = # Substrate sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../../substrate/frame/support", default-features = false} -frame-system = { path = "../../../../../../substrate/frame/system", default-features = false} sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../../substrate/primitives/weights", default-features = false} -pallet-balances = { path = "../../../../../../substrate/frame/balances", default-features = false} pallet-assets = { path = "../../../../../../substrate/frame/assets", default-features = false} pallet-core-fellowship = { path = "../../../../../../substrate/frame/core-fellowship", default-features = false} pallet-salary = { path = "../../../../../../substrate/frame/salary", default-features = false} # Polkadot polkadot-core-primitives = { path = "../../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../../polkadot/parachain", default-features = false} polkadot-runtime-parachains = { path = "../../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../../polkadot/runtime/polkadot" } -xcm = { path = "../../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus @@ -33,7 +30,6 @@ parachains-common = { path = "../../../../common" } cumulus-pallet-xcmp-queue = { path = "../../../../../pallets/xcmp-queue", default-features = false} cumulus-pallet-parachain-system = { path = "../../../../../pallets/parachain-system" } collectives-polkadot-runtime = { path = "../../../../runtimes/collectives/collectives-polkadot" } -asset-hub-polkadot-runtime = { path = "../../../../runtimes/assets/asset-hub-polkadot" } # Local xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false} diff --git a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs index b71ee65a22217c0ffc524f14fc5e90d9ce37e5b9..ad2b5a501117516b1064b36cb567b2e3983e41f2 100644 --- a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -15,42 +15,24 @@ // along with Cumulus. If not, see . pub use codec::Encode; -pub use frame_support::{ - assert_err, assert_ok, - instances::Instance1, - pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult, MultiAddress}, - traits::{fungibles::Inspect, OriginTrait}, -}; +pub use frame_support::{assert_ok, sp_runtime::AccountId32}; pub use integration_tests_common::{ constants::{ - accounts::{ALICE, BOB}, - asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, - polkadot::ED as POLKADOT_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + accounts::ALICE, asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, + polkadot::ED as POLKADOT_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, - lazy_static::lazy_static, - xcm_transact_paid_execution, xcm_transact_unpaid_execution, AssetHubPolkadot, - AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, BridgeHubPolkadot, - BridgeHubPolkadotPallet, BridgeHubPolkadotReceiver, BridgeHubPolkadotSender, Collectives, - CollectivesPallet, CollectivesReceiver, CollectivesSender, PenpalPolkadotA, - PenpalPolkadotAPallet, PenpalPolkadotAReceiver, PenpalPolkadotASender, PenpalPolkadotB, - PenpalPolkadotBPallet, PenpalPolkadotBReceiver, PenpalPolkadotBSender, Polkadot, - PolkadotMockNet, PolkadotPallet, PolkadotReceiver, PolkadotSender, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, Collectives, + PenpalPolkadotA, Polkadot, }; pub use parachains_common::{AccountId, Balance}; -pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; pub use xcm::{ - prelude::*, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Polkadot as PolkadotId}, - DoubleEncoded, }; pub use xcm_emulator::{ - assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, - AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, ParaId, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, TestExternalities, }; pub const ASSET_ID: u32 = 1; @@ -98,4 +80,5 @@ pub fn system_para_test_args( } #[cfg(test)] +#[cfg(not(feature = "runtime-benchmarks"))] mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs index a6d16a273b79122765766dbbe803a79cd35e0fa4..26fa55acb0d66142729d087b10592b5b05a1740b 100644 --- a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs +++ b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -16,54 +16,64 @@ //! Integration tests concerning the Fellowship. +use crate::*; +use collectives_polkadot_runtime::fellowship::FellowshipSalaryPaymaster; +use frame_support::traits::{ + fungibles::{Create, Mutate}, + tokens::Pay, +}; +use sp_core::crypto::Ss58Codec; +use xcm_emulator::TestExt; + #[test] -#[ignore] fn pay_salary() { - // let asset_id: u32 = 1984; - // let pay_from: AccountId = - // ::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS") - // .unwrap(); - // let pay_to = Polkadot::account_id_of(ALICE); - // let pay_amount = 9000; + let asset_id: u32 = 1984; + let pay_from: AccountId = + ::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS") + .unwrap(); + let pay_to = Polkadot::account_id_of(ALICE); + let pay_amount = 9000; + + AssetHubPolkadot::execute_with(|| { + type AssetHubAssets = ::Assets; - // AssetHubPolkadot::execute_with(|| { - // type AssetHubAssets = ::Assets; + assert_ok!(>::create( + asset_id, + pay_to.clone(), + true, + pay_amount / 2 + )); + assert_ok!(>::mint_into(asset_id, &pay_from, pay_amount * 2)); + }); - // assert_ok!(>::create( - // asset_id, - // pay_to.clone(), - // true, - // pay_amount / 2 - // )); - // assert_ok!(>::mint_into(asset_id, &pay_from, pay_amount * 2)); - // }); + Collectives::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; - // Collectives::execute_with(|| { - // type RuntimeEvent = ::RuntimeEvent; + assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount)); + assert_expected_events!( + Collectives, + vec![ + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {}, + ] + ); + }); - // assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount)); - // assert_expected_events!( - // Collectives, - // vec![ - // RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {}, - // ] - // ); - // }); + Collectives::execute_with(|| {}); - // AssetHubPolkadot::execute_with(|| { - // type RuntimeEvent = ::RuntimeEvent; + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; - // assert_expected_events!( - // AssetHubPolkadot, - // vec![ - // RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => - // { asset_id: id == &asset_id, - // from: from == &pay_from, - // to: to == &pay_to, - // amount: amount == &pay_amount, - // }, - // RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {}, - // ] - // ); - // }); + assert_expected_events!( + AssetHubPolkadot, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => + { asset_id: id == &asset_id, + from: from == &pay_from, + to: to == &pay_to, + amount: amount == &pay_amount, + }, + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {}, + ] + ); + }); } diff --git a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs index 1ede78b59799056cf4b74386e3aa56ee57b0f53e..a9445ac8ec7eb191f067b6e95bf41730957a0b95 100644 --- a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs +++ b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/integration-tests/emulated/common/Cargo.toml b/cumulus/parachains/integration-tests/emulated/common/Cargo.toml index 47c5f96fd800b7e18ee49c7c37290301579159ff..a8002158dbc139e53c9ce44b8e1b9a5054ef25b0 100644 --- a/cumulus/parachains/integration-tests/emulated/common/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/common/Cargo.toml @@ -4,10 +4,10 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Common resources for integration testing with xcm-emulator" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } -lazy_static = "1.4.0" paste = "1.0.14" # Substrate @@ -15,12 +15,8 @@ grandpa = { package = "sc-consensus-grandpa", path = "../../../../../substrate/c sp-authority-discovery = { path = "../../../../../substrate/primitives/authority-discovery", default-features = false} sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false} frame-support = { path = "../../../../../substrate/frame/support", default-features = false} -frame-system = { path = "../../../../../substrate/frame/system", default-features = false} sp-core = { path = "../../../../../substrate/primitives/core", default-features = false} -sp-weights = { path = "../../../../../substrate/primitives/weights", default-features = false} sp-consensus-babe = { path = "../../../../../substrate/primitives/consensus/babe", default-features = false} -sp-tracing = { path = "../../../../../substrate/primitives/tracing" } -pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false} pallet-assets = { path = "../../../../../substrate/frame/assets", default-features = false} pallet-staking = { path = "../../../../../substrate/frame/staking", default-features = false} pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false} @@ -29,25 +25,23 @@ beefy-primitives = { package = "sp-consensus-beefy", path = "../../../../../subs # Polkadot polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-service = { path = "../../../../../polkadot/node/service", default-features = false, features = ["full-node"] } polkadot-primitives = { path = "../../../../../polkadot/primitives", default-features = false} polkadot-runtime-parachains = { path = "../../../../../polkadot/runtime/parachains" } polkadot-runtime = { path = "../../../../../polkadot/runtime/polkadot" } polkadot-runtime-constants = { path = "../../../../../polkadot/runtime/polkadot/constants" } -kusama-runtime = { path = "../../../../../polkadot/runtime/kusama" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../polkadot/runtime/kusama" } kusama-runtime-constants = { path = "../../../../../polkadot/runtime/kusama/constants" } rococo-runtime = { path = "../../../../../polkadot/runtime/rococo" } rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/constants" } westend-runtime = { path = "../../../../../polkadot/runtime/westend" } westend-runtime-constants = { path = "../../../../../polkadot/runtime/westend/constants" } -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} # Cumulus parachains-common = { path = "../../../common" } -parachain-info = { path = "../../../pallets/parachain-info" } cumulus-primitives-core = { path = "../../../../primitives/core" } penpal-runtime = { path = "../../../runtimes/testing/penpal" } asset-hub-polkadot-runtime = { path = "../../../runtimes/assets/asset-hub-polkadot" } @@ -62,7 +56,6 @@ cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue" } cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false} cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system" } bp-messages = { path = "../../../../bridges/primitives/messages" } -bp-runtime = { path = "../../../../bridges/primitives/runtime" } pallet-bridge-messages = { path = "../../../../bridges/modules/messages" } bridge-runtime-common = { path = "../../../../bridges/bin/runtime-common" } @@ -79,17 +72,15 @@ runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", "kusama-runtime/runtime-benchmarks", "pallet-assets/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", "pallet-bridge-messages/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "penpal-runtime/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "polkadot-runtime/runtime-benchmarks", @@ -97,5 +88,4 @@ runtime-benchmarks = [ "rococo-runtime/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "westend-runtime/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", ] diff --git a/cumulus/parachains/integration-tests/emulated/common/src/constants.rs b/cumulus/parachains/integration-tests/emulated/common/src/constants.rs index 3eb65fa26c162833a2a5eecafc1d68e47baa6444..fedc46fabfff1f6f55f274c4bbf848505afb367b 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/constants.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/constants.rs @@ -1,14 +1,23 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +// Substrate use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; use grandpa::AuthorityId as GrandpaId; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; -use polkadot_parachain::primitives::{HeadData, ValidationCode}; -use polkadot_primitives::{AssignmentId, ValidatorId}; -use polkadot_runtime_parachains::{ - configuration::HostConfiguration, - paras::{ParaGenesisArgs, ParaKind}, -}; -use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_core::{sr25519, storage::Storage, Pair, Public}; @@ -16,6 +25,16 @@ use sp_runtime::{ traits::{IdentifyAccount, Verify}, BuildStorage, MultiSignature, Perbill, }; + +// Cumulus +use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; +use polkadot_parachain_primitives::primitives::{HeadData, ValidationCode}; +use polkadot_primitives::{AssignmentId, ValidatorId}; +use polkadot_runtime_parachains::{ + configuration::HostConfiguration, + paras::{ParaGenesisArgs, ParaKind}, +}; +use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy; use xcm; pub const XCM_V2: u32 = 3; diff --git a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs index 92c68f4dd6133ac5b577cbfdeee57814851d9662..f13da0016205cceaa2599f4e23b2e6b8963c84b1 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs @@ -1,15 +1,64 @@ -use super::{BridgeHubRococo, BridgeHubWococo}; -// pub use paste; +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +pub use codec::{Decode, Encode}; +pub use paste; + +pub use crate::{ + constants::{PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD}, + xcm_helpers::xcm_transact_unpaid_execution, + BridgeHubRococo, BridgeHubWococo, +}; + +// Substrate +pub use frame_support::{assert_ok, traits::fungibles::Inspect}; +pub use pallet_assets; +pub use pallet_message_queue; +use sp_core::Get; + +// Cumulus use bp_messages::{ target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch}, LaneId, MessageKey, OutboundLaneData, }; use bridge_runtime_common::messages_xcm_extension::XcmBlobMessageDispatchResult; -use codec::Decode; -pub use cumulus_primitives_core::{DmpMessageHandler, XcmpMessageHandler}; +pub use cumulus_pallet_dmp_queue; +pub use cumulus_pallet_parachain_system; +pub use cumulus_pallet_xcmp_queue; +pub use cumulus_primitives_core::{ + relay_chain::HrmpChannelId, DmpMessageHandler, ParaId, XcmpMessageHandler, +}; use pallet_bridge_messages::{Config, Instance1, Instance2, OutboundLanes, Pallet}; -use sp_core::Get; -use xcm_emulator::{BridgeMessage, BridgeMessageDispatchError, BridgeMessageHandler, Chain}; +pub use parachains_common::{AccountId, Balance}; +pub use xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, BridgeMessage, + BridgeMessageDispatchError, BridgeMessageHandler, Chain, Parachain, RelayChain, TestExt, +}; + +// Polkadot +pub use pallet_xcm; +pub use polkadot_runtime_parachains::{ + dmp, hrmp, + inclusion::{AggregateMessageOrigin, UmpQueueId}, +}; +pub use xcm::{ + prelude::{OriginKind, Outcome, VersionedXcm, Weight}, + v3::Error, + DoubleEncoded, +}; pub struct BridgeHubMessageHandler { _marker: std::marker::PhantomData<(S, T, I)>, @@ -129,14 +178,14 @@ where #[macro_export] macro_rules! impl_accounts_helpers_for_relay_chain { ( $chain:ident ) => { - $crate::paste::paste! { + $crate::impls::paste::paste! { impl $chain { /// Fund a set of accounts with a balance - pub fn fund_accounts(accounts: Vec<(AccountId, Balance)>) { - Self::execute_with(|| { + pub fn fund_accounts(accounts: Vec<($crate::impls::AccountId, $crate::impls::Balance)>) { + ::execute_with(|| { for account in accounts { - assert_ok!(]>::Balances::force_set_balance( - ::RuntimeOrigin::root(), + $crate::impls::assert_ok!(]>::Balances::force_set_balance( + ::RuntimeOrigin::root(), account.0.into(), account.1, )); @@ -144,8 +193,8 @@ macro_rules! impl_accounts_helpers_for_relay_chain { }); } /// Fund a sovereign account based on its Parachain Id - pub fn fund_para_sovereign(amount: Balance, para_id: ParaId) -> sp_runtime::AccountId32 { - let sovereign_account = Self::sovereign_account_id_of_child_para(para_id); + pub fn fund_para_sovereign(amount: $crate::impls::Balance, para_id: $crate::impls::ParaId) -> sp_runtime::AccountId32 { + let sovereign_account = ::sovereign_account_id_of_child_para(para_id); Self::fund_accounts(vec![(sovereign_account.clone(), amount)]); sovereign_account } @@ -157,20 +206,20 @@ macro_rules! impl_accounts_helpers_for_relay_chain { #[macro_export] macro_rules! impl_assert_events_helpers_for_relay_chain { ( $chain:ident ) => { - $crate::paste::paste! { - type [<$chain RuntimeEvent>] = <$chain as Chain>::RuntimeEvent; + $crate::impls::paste::paste! { + type [<$chain RuntimeEvent>] = <$chain as $crate::impls::Chain>::RuntimeEvent; impl $chain { /// Asserts a dispatchable is completely executed and XCM sent - pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option) { - assert_expected_events!( + pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option<$crate::impls::Weight>) { + $crate::impls::assert_expected_events!( Self, vec![ [<$chain RuntimeEvent>]::XcmPallet( - pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) } + $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Complete(weight) } ) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -181,18 +230,18 @@ macro_rules! impl_assert_events_helpers_for_relay_chain { /// Asserts a dispatchable is incompletely executed and XCM sent pub fn assert_xcm_pallet_attempted_incomplete( - expected_weight: Option, - expected_error: Option, + expected_weight: Option<$crate::impls::Weight>, + expected_error: Option<$crate::impls::Error>, ) { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ // Dispatchable is properly executed and XCM message sent [<$chain RuntimeEvent>]::XcmPallet( - pallet_xcm::Event::Attempted { outcome: Outcome::Incomplete(weight, error) } + $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Incomplete(weight, error) } ) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -204,10 +253,10 @@ macro_rules! impl_assert_events_helpers_for_relay_chain { /// Asserts a XCM message is sent pub fn assert_xcm_pallet_sent() { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ - [<$chain RuntimeEvent>]::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, + [<$chain RuntimeEvent>]::XcmPallet($crate::impls::pallet_xcm::Event::Sent { .. }) => {}, ] ); } @@ -215,22 +264,22 @@ macro_rules! impl_assert_events_helpers_for_relay_chain { /// Asserts a XCM from System Parachain is succesfully received and proccessed pub fn assert_ump_queue_processed( expected_success: bool, - expected_id: Option, - expected_weight: Option, + expected_id: Option<$crate::impls::ParaId>, + expected_weight: Option<$crate::impls::Weight>, ) { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ // XCM is succesfully received and proccessed - [<$chain RuntimeEvent>]::MessageQueue(pallet_message_queue::Event::Processed { - origin: AggregateMessageOrigin::Ump(UmpQueueId::Para(id)), + [<$chain RuntimeEvent>]::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { + origin: $crate::impls::AggregateMessageOrigin::Ump($crate::impls::UmpQueueId::Para(id)), weight_used, success, .. }) => { id: *id == expected_id.unwrap_or(*id), - weight_used: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight_used: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight_used), *weight_used ), @@ -247,16 +296,18 @@ macro_rules! impl_assert_events_helpers_for_relay_chain { #[macro_export] macro_rules! impl_hrmp_channels_helpers_for_relay_chain { ( $chain:ident ) => { - $crate::paste::paste! { + $crate::impls::paste::paste! { impl $chain { /// Init open channel request with another Parachain pub fn init_open_channel_call( - recipient_para_id: ParaId, + recipient_para_id: $crate::impls::ParaId, max_capacity: u32, max_message_size: u32, - ) -> DoubleEncoded<()> { - ::RuntimeCall::Hrmp(polkadot_runtime_parachains::hrmp::Call::< - ::Runtime, + ) -> $crate::impls::DoubleEncoded<()> { + use $crate::impls::Encode; + + ::RuntimeCall::Hrmp($crate::impls::hrmp::Call::< + ::Runtime, >::hrmp_init_open_channel { recipient: recipient_para_id, proposed_max_capacity: max_capacity, @@ -266,9 +317,11 @@ macro_rules! impl_hrmp_channels_helpers_for_relay_chain { .into() } /// Recipient Parachain accept the open request from another Parachain - pub fn accept_open_channel_call(sender_para_id: ParaId) -> DoubleEncoded<()> { - ::RuntimeCall::Hrmp(polkadot_runtime_parachains::hrmp::Call::< - ::Runtime, + pub fn accept_open_channel_call(sender_para_id: $crate::impls::ParaId) -> $crate::impls::DoubleEncoded<()> { + use $crate::impls::Encode; + + ::RuntimeCall::Hrmp($crate::impls::hrmp::Call::< + ::Runtime, >::hrmp_accept_open_channel { sender: sender_para_id, }) @@ -277,19 +330,21 @@ macro_rules! impl_hrmp_channels_helpers_for_relay_chain { } /// A root origin force to open a channel between two Parachains - pub fn force_process_hrmp_open(sender: ParaId, recipient: ParaId) { - Self::execute_with(|| { + pub fn force_process_hrmp_open(sender: $crate::impls::ParaId, recipient: $crate::impls::ParaId) { + use $crate::impls::Chain; + + ::execute_with(|| { let relay_root_origin = ::RuntimeOrigin::root(); // Force process HRMP open channel requests without waiting for the next session - assert_ok!(]>::Hrmp::force_process_hrmp_open( + $crate::impls::assert_ok!(]>::Hrmp::force_process_hrmp_open( relay_root_origin, 0 )); - let channel_id = HrmpChannelId { sender, recipient }; + let channel_id = $crate::impls::HrmpChannelId { sender, recipient }; - let hrmp_channel_exist = polkadot_runtime_parachains::hrmp::HrmpChannels::< + let hrmp_channel_exist = $crate::impls::hrmp::HrmpChannels::< ::Runtime, >::contains_key(&channel_id); @@ -305,14 +360,14 @@ macro_rules! impl_hrmp_channels_helpers_for_relay_chain { #[macro_export] macro_rules! impl_accounts_helpers_for_parachain { ( $chain:ident ) => { - $crate::paste::paste! { + $crate::impls::paste::paste! { impl $chain { /// Fund a set of accounts with a balance - pub fn fund_accounts(accounts: Vec<(AccountId, Balance)>) { - Self::execute_with(|| { + pub fn fund_accounts(accounts: Vec<($crate::impls::AccountId, $crate::impls::Balance)>) { + ::execute_with(|| { for account in accounts { - assert_ok!(]>::Balances::force_set_balance( - ::RuntimeOrigin::root(), + $crate::impls::assert_ok!(]>::Balances::force_set_balance( + ::RuntimeOrigin::root(), account.0.into(), account.1, )); @@ -327,20 +382,20 @@ macro_rules! impl_accounts_helpers_for_parachain { #[macro_export] macro_rules! impl_assert_events_helpers_for_parachain { ( $chain:ident ) => { - $crate::paste::paste! { - type [<$chain RuntimeEvent>] = <$chain as Chain>::RuntimeEvent; + $crate::impls::paste::paste! { + type [<$chain RuntimeEvent>] = <$chain as $crate::impls::Chain>::RuntimeEvent; impl $chain { /// Asserts a dispatchable is completely executed and XCM sent - pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option) { - assert_expected_events!( + pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option<$crate::impls::Weight>) { + $crate::impls::assert_expected_events!( Self, vec![ [<$chain RuntimeEvent>]::PolkadotXcm( - pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) } + $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Complete(weight) } ) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -351,18 +406,18 @@ macro_rules! impl_assert_events_helpers_for_parachain { /// Asserts a dispatchable is incompletely executed and XCM sent pub fn assert_xcm_pallet_attempted_incomplete( - expected_weight: Option, - expected_error: Option, + expected_weight: Option<$crate::impls::Weight>, + expected_error: Option<$crate::impls::Error>, ) { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ // Dispatchable is properly executed and XCM message sent [<$chain RuntimeEvent>]::PolkadotXcm( - pallet_xcm::Event::Attempted { outcome: Outcome::Incomplete(weight, error) } + $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Incomplete(weight, error) } ) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -373,13 +428,13 @@ macro_rules! impl_assert_events_helpers_for_parachain { } /// Asserts a dispatchable throws and error when trying to be sent - pub fn assert_xcm_pallet_attempted_error(expected_error: Option) { - assert_expected_events!( + pub fn assert_xcm_pallet_attempted_error(expected_error: Option<$crate::impls::Error>) { + $crate::impls::assert_expected_events!( Self, vec![ // Execution fails in the origin with `Barrier` [<$chain RuntimeEvent>]::PolkadotXcm( - pallet_xcm::Event::Attempted { outcome: Outcome::Error(error) } + $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Error(error) } ) => { error: *error == expected_error.unwrap_or(*error), }, @@ -389,36 +444,36 @@ macro_rules! impl_assert_events_helpers_for_parachain { /// Asserts a XCM message is sent pub fn assert_xcm_pallet_sent() { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ - [<$chain RuntimeEvent>]::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {}, + [<$chain RuntimeEvent>]::PolkadotXcm($crate::impls::pallet_xcm::Event::Sent { .. }) => {}, ] ); } /// Asserts a XCM message is sent to Relay Chain pub fn assert_parachain_system_ump_sent() { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ [<$chain RuntimeEvent>]::ParachainSystem( - cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } + $crate::impls::cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } ) => {}, ] ); } /// Asserts a XCM from Relay Chain is completely executed - pub fn assert_dmp_queue_complete(expected_weight: Option) { - assert_expected_events!( + pub fn assert_dmp_queue_complete(expected_weight: Option<$crate::impls::Weight>) { + $crate::impls::assert_expected_events!( Self, vec![ - [<$chain RuntimeEvent>]::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward { - outcome: Outcome::Complete(weight), .. + [<$chain RuntimeEvent>]::DmpQueue($crate::impls::cumulus_pallet_dmp_queue::Event::ExecutedDownward { + outcome: $crate::impls::Outcome::Complete(weight), .. }) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -429,17 +484,17 @@ macro_rules! impl_assert_events_helpers_for_parachain { /// Asserts a XCM from Relay Chain is incompletely executed pub fn assert_dmp_queue_incomplete( - expected_weight: Option, - expected_error: Option, + expected_weight: Option<$crate::impls::Weight>, + expected_error: Option<$crate::impls::Error>, ) { - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ - [<$chain RuntimeEvent>]::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward { - outcome: Outcome::Incomplete(weight, error), .. + [<$chain RuntimeEvent>]::DmpQueue($crate::impls::cumulus_pallet_dmp_queue::Event::ExecutedDownward { + outcome: $crate::impls::Outcome::Incomplete(weight, error), .. }) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -450,15 +505,15 @@ macro_rules! impl_assert_events_helpers_for_parachain { } /// Asserts a XCM from another Parachain is completely executed - pub fn assert_xcmp_queue_success(expected_weight: Option) { - assert_expected_events!( + pub fn assert_xcmp_queue_success(expected_weight: Option<$crate::impls::Weight>) { + $crate::impls::assert_expected_events!( Self, vec![ [<$chain RuntimeEvent>]::XcmpQueue( - cumulus_pallet_xcmp_queue::Event::Success { weight, .. } + $crate::impls::cumulus_pallet_xcmp_queue::Event::Success { weight, .. } ) => { - weight: weight_within_threshold( - (REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), + weight: $crate::impls::weight_within_threshold( + ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), expected_weight.unwrap_or(*weight), *weight ), @@ -474,18 +529,20 @@ macro_rules! impl_assert_events_helpers_for_parachain { #[macro_export] macro_rules! impl_assets_helpers_for_parachain { ( $chain:ident, $relay_chain:ident ) => { - $crate::paste::paste! { + $crate::impls::paste::paste! { impl $chain { /// Returns the encoded call for `force_create` from the assets pallet pub fn force_create_asset_call( asset_id: u32, - owner: AccountId, + owner: $crate::impls::AccountId, is_sufficient: bool, - min_balance: Balance, - ) -> DoubleEncoded<()> { - ::RuntimeCall::Assets(pallet_assets::Call::< + min_balance: $crate::impls::Balance, + ) -> $crate::impls::DoubleEncoded<()> { + use $crate::impls::{Chain, Encode}; + + ::RuntimeCall::Assets($crate::impls::pallet_assets::Call::< ::Runtime, - Instance1, + $crate::impls::pallet_assets::Instance1, >::force_create { id: asset_id.into(), owner: owner.into(), @@ -498,37 +555,37 @@ macro_rules! impl_assets_helpers_for_parachain { /// Returns a `VersionedXcm` for `force_create` from the assets pallet pub fn force_create_asset_xcm( - origin_kind: OriginKind, + origin_kind: $crate::impls::OriginKind, asset_id: u32, - owner: AccountId, + owner: $crate::impls::AccountId, is_sufficient: bool, - min_balance: Balance, - ) -> VersionedXcm<()> { + min_balance: $crate::impls::Balance, + ) -> $crate::impls::VersionedXcm<()> { let call = Self::force_create_asset_call(asset_id, owner, is_sufficient, min_balance); - xcm_transact_unpaid_execution(call, origin_kind) + $crate::impls::xcm_transact_unpaid_execution(call, origin_kind) } /// Mint assets making use of the assets pallet pub fn mint_asset( - signed_origin: ::RuntimeOrigin, + signed_origin: ::RuntimeOrigin, id: u32, - beneficiary: AccountId, + beneficiary: $crate::impls::AccountId, amount_to_mint: u128, ) { - Self::execute_with(|| { - assert_ok!(]>::Assets::mint( + ::execute_with(|| { + $crate::impls::assert_ok!(]>::Assets::mint( signed_origin, id.into(), beneficiary.clone().into(), amount_to_mint )); - type RuntimeEvent = <$chain as Chain>::RuntimeEvent; + type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ - RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { + RuntimeEvent::Assets($crate::impls::pallet_assets::Event::Issued { asset_id, owner, amount }) => { asset_id: *asset_id == id, owner: *owner == beneficiary.clone().into(), amount: *amount == amount_to_mint, @@ -543,14 +600,15 @@ macro_rules! impl_assets_helpers_for_parachain { id: u32, min_balance: u128, is_sufficient: bool, - asset_owner: AccountId, + asset_owner: $crate::impls::AccountId, amount_to_mint: u128, ) { + use $crate::impls::{bx, Chain, RelayChain, Parachain, Inspect, TestExt}; // Init values for Relay Chain let root_origin = <$relay_chain as Chain>::RuntimeOrigin::root(); let destination = <$relay_chain>::child_location_of(<$chain>::para_id()); let xcm = Self::force_create_asset_xcm( - OriginKind::Superuser, + $crate::impls::OriginKind::Superuser, id, asset_owner.clone(), is_sufficient, @@ -558,7 +616,7 @@ macro_rules! impl_assets_helpers_for_parachain { ); <$relay_chain>::execute_with(|| { - assert_ok!(<$relay_chain as [<$relay_chain Pallet>]>::XcmPallet::send( + $crate::impls::assert_ok!(<$relay_chain as [<$relay_chain Pallet>]>::XcmPallet::send( root_origin, bx!(destination.into()), bx!(xcm), @@ -568,15 +626,15 @@ macro_rules! impl_assets_helpers_for_parachain { }); Self::execute_with(|| { - Self::assert_dmp_queue_complete(Some(Weight::from_parts(1_019_445_000, 200_000))); + Self::assert_dmp_queue_complete(Some($crate::impls::Weight::from_parts(1_019_445_000, 200_000))); - type RuntimeEvent = <$chain as Chain>::RuntimeEvent; + type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - assert_expected_events!( + $crate::impls::assert_expected_events!( Self, vec![ // Asset has been created - RuntimeEvent::Assets(pallet_assets::Event::ForceCreated { asset_id, owner }) => { + RuntimeEvent::Assets($crate::impls::pallet_assets::Event::ForceCreated { asset_id, owner }) => { asset_id: *asset_id == id, owner: *owner == asset_owner.clone(), }, diff --git a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs index f6d589700360cfafef7d59255fafe876e3de5a87..49751136f7ba0016c022359eaf789516c0ac0243 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs @@ -1,42 +1,37 @@ -pub use lazy_static; +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod constants; pub mod impls; +pub mod xcm_helpers; -pub use codec::Encode; -pub use constants::{ +use constants::{ accounts::{ALICE, BOB}, asset_hub_kusama, asset_hub_polkadot, asset_hub_westend, bridge_hub_kusama, bridge_hub_polkadot, bridge_hub_rococo, collectives, kusama, penpal, polkadot, rococo, westend, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, -}; -use frame_support::{ - assert_ok, - instances::Instance1, - parameter_types, - traits::{fungibles::Inspect, Hooks}, -}; -pub use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler}; -pub use parachains_common::{AccountId, Balance}; -pub use paste; -use polkadot_parachain::primitives::HrmpChannelId; -pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; -pub use sp_core::{sr25519, storage::Storage, Get}; -use sp_tracing; -use xcm_emulator::{ - assert_expected_events, bx, decl_test_bridges, decl_test_networks, decl_test_parachains, - decl_test_relay_chains, decl_test_sender_receiver_accounts_parameter_types, - helpers::weight_within_threshold, BridgeMessageHandler, Chain, DefaultMessageProcessor, ParaId, - Parachain, RelayChain, TestExt, }; +use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler}; -pub use xcm::{ - prelude::{ - AccountId32, All, BuyExecution, DepositAsset, MultiAsset, MultiAssets, MultiLocation, - OriginKind, Outcome, RefundSurplus, Transact, UnpaidExecution, VersionedXcm, Weight, - WeightLimit, WithdrawAsset, Xcm, X1, - }, - v3::Error, - DoubleEncoded, +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use xcm_emulator::{ + decl_test_bridges, decl_test_networks, decl_test_parachains, decl_test_relay_chains, + decl_test_sender_receiver_accounts_parameter_types, DefaultMessageProcessor, }; decl_test_relay_chains! { @@ -70,7 +65,7 @@ decl_test_relay_chains! { Hrmp: kusama_runtime::Hrmp, } }, - #[api_version(5)] + #[api_version(6)] pub struct Westend { genesis = westend::genesis(), on_init = (), @@ -565,44 +560,3 @@ decl_test_sender_receiver_accounts_parameter_types! { PenpalWestendA { sender: ALICE, receiver: BOB }, PenpalRococoA { sender: ALICE, receiver: BOB } } - -/// Helper method to build a XCM with a `Transact` instruction and paying for its execution -pub fn xcm_transact_paid_execution( - call: DoubleEncoded<()>, - origin_kind: OriginKind, - native_asset: MultiAsset, - beneficiary: AccountId, -) -> VersionedXcm<()> { - let weight_limit = WeightLimit::Unlimited; - let require_weight_at_most = Weight::from_parts(1000000000, 200000); - let native_assets: MultiAssets = native_asset.clone().into(); - - VersionedXcm::from(Xcm(vec![ - WithdrawAsset(native_assets), - BuyExecution { fees: native_asset, weight_limit }, - Transact { require_weight_at_most, origin_kind, call }, - RefundSurplus, - DepositAsset { - assets: All.into(), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: beneficiary.into() }), - }, - }, - ])) -} - -/// Helper method to build a XCM with a `Transact` instruction without paying for its execution -pub fn xcm_transact_unpaid_execution( - call: DoubleEncoded<()>, - origin_kind: OriginKind, -) -> VersionedXcm<()> { - let weight_limit = WeightLimit::Unlimited; - let require_weight_at_most = Weight::from_parts(1000000000, 200000); - let check_origin = None; - - VersionedXcm::from(Xcm(vec![ - UnpaidExecution { weight_limit, check_origin }, - Transact { require_weight_at_most, origin_kind, call }, - ])) -} diff --git a/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs new file mode 100644 index 0000000000000000000000000000000000000000..4096cdbba0b9154beb9f90272a459087b2443498 --- /dev/null +++ b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs @@ -0,0 +1,66 @@ +// Copyright Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +use parachains_common::AccountId; +use xcm::{ + prelude::{ + AccountId32, All, BuyExecution, DepositAsset, MultiAsset, MultiAssets, MultiLocation, + OriginKind, RefundSurplus, Transact, UnpaidExecution, VersionedXcm, Weight, WeightLimit, + WithdrawAsset, Xcm, X1, + }, + DoubleEncoded, +}; + +/// Helper method to build a XCM with a `Transact` instruction and paying for its execution +pub fn xcm_transact_paid_execution( + call: DoubleEncoded<()>, + origin_kind: OriginKind, + native_asset: MultiAsset, + beneficiary: AccountId, +) -> VersionedXcm<()> { + let weight_limit = WeightLimit::Unlimited; + let require_weight_at_most = Weight::from_parts(1000000000, 200000); + let native_assets: MultiAssets = native_asset.clone().into(); + + VersionedXcm::from(Xcm(vec![ + WithdrawAsset(native_assets), + BuyExecution { fees: native_asset, weight_limit }, + Transact { require_weight_at_most, origin_kind, call }, + RefundSurplus, + DepositAsset { + assets: All.into(), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountId32 { network: None, id: beneficiary.into() }), + }, + }, + ])) +} + +/// Helper method to build a XCM with a `Transact` instruction without paying for its execution +pub fn xcm_transact_unpaid_execution( + call: DoubleEncoded<()>, + origin_kind: OriginKind, +) -> VersionedXcm<()> { + let weight_limit = WeightLimit::Unlimited; + let require_weight_at_most = Weight::from_parts(1000000000, 200000); + let check_origin = None; + + VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit, check_origin }, + Transact { require_weight_at_most, origin_kind, call }, + ])) +} diff --git a/cumulus/parachains/pallets/parachain-info/src/lib.rs b/cumulus/parachains/pallets/parachain-info/src/lib.rs index 6a9707365c372bc0a259c7708a9a729afb6ef1a5..c17a6d5e1460a2ef319109c0d867b6c73a6493e0 100644 --- a/cumulus/parachains/pallets/parachain-info/src/lib.rs +++ b/cumulus/parachains/pallets/parachain-info/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/pallets/ping/Cargo.toml b/cumulus/parachains/pallets/ping/Cargo.toml index e214081ab04886ab7ba759ded9d0fb9c00b71db9..f0afa63d692d458c4f5ea008bf0dee223c7e2c6c 100644 --- a/cumulus/parachains/pallets/ping/Cargo.toml +++ b/cumulus/parachains/pallets/ping/Cargo.toml @@ -13,7 +13,7 @@ sp-runtime = { path = "../../../../substrate/primitives/runtime", default-featur frame-support = { path = "../../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../../substrate/frame/system", default-features = false} -xcm = { path = "../../../../polkadot/xcm", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false} cumulus-primitives-core = { path = "../../../primitives/core", default-features = false } cumulus-pallet-xcm = { path = "../../../pallets/xcm", default-features = false } diff --git a/cumulus/parachains/pallets/ping/src/lib.rs b/cumulus/parachains/pallets/ping/src/lib.rs index 7425b5bd52f43d5b45fd0b1d29fa608f883c633c..feda3d0b6f9f0f52ee0294e1af6cff7c6764dc66 100644 --- a/cumulus/parachains/pallets/ping/src/lib.rs +++ b/cumulus/parachains/pallets/ping/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml index e085ee24c6049f3914972b3c5d7ecf354591bb53..53555499842fde9684b3a5b33087ca8de80643ee 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/Cargo.toml @@ -59,11 +59,11 @@ kusama-runtime-constants = { path = "../../../../../polkadot/runtime/kusama/cons pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -118,7 +118,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -200,7 +200,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "scale-info/std", "sp-api/std", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs index 0ca93a8446f75a8fddc6ad87df1a0fb24c4a1c1f..8daf8fda4b4a2e645ee24af8525cf15ef2b95e89 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs index 2130c6502f8ef53e9042ebcdc21d90b07312da33..afccc5c068b5e7b6629d1a8e03d29497d93d28ca 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs index df8188debddfa97be6c40b0eb632f8913488d5d4..9c7a56687b314e51ff3d77134b5d389e9568b293 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs index 20e421541b0d6f401b09b4677f7de3818369d559..96477ddf4bd3fab597a6d2a89ae30e30f33840cd 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs index 955d4690634e8cb7949afe63cefc5ae66e600d14..281c013b3372f57a24b57812de91e684ffabd0c9 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod block_weights; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_asset_conversion.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_asset_conversion.rs index bb09a85133290d4f30e2c1561aef8aad417f7121..702f3743a7203f7103474dea554cb7aec2448ce6 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_asset_conversion.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_asset_conversion.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_foreign.rs index 3a801b758cf78865e568f38e4624817456294035..7c237b20389db7af3bab0e5e231dac0097210328 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_foreign.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_local.rs index d88f5991e3290ca38d73f3c18018cdc874e1cef7..10bd4b1f8b097d40bb23e9a24a1f81ee0c6fea09 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_local.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_pool.rs index eeac89bb453383ae94c38af0cd15196908cc8d72..444699e33ef7d714aac0f0cb11a4ead143c76c87 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_assets_pool.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs index b387e626209cd20a4196c17da3553624cebc38bf..be1ac3011f79e72f852010f8fbdbaf19c4776b8b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs index a528b0f66852fd4104c8a3f35d977fcaf14400e3..7fe56ac31f7aa11c8eb497dbacdabef522ccb294 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs index f949a0786bfc6c04d62ec1de0ed2e6be12142f36..ee7b70736414d86fc270d08777fe606ba76c0b34 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nft_fractionalization.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nft_fractionalization.rs index ab3bcbea8268846c26dce403d5f75ac7f78b9a71..c55a18adc5233d75dd05f8b35678023a548051ed 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nft_fractionalization.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nft_fractionalization.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs index 453d2d477bf043f3ceeb48bd0ca3ba0050b121c4..2de706bbdc70087cb8fe8128a30644e6e1f2ce74 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_nfts.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs index 6c548ac1f27c1b16fafb4536db51bcf7c390df78..9bc4ba448e5af7d50988a319f62718ac486b689c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_proxy.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs index c5064adf8b03070277c69f23614e4b09f4df7d47..56982f565ac478cc59ae9db6864e78e27a795191 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs index 8edae065f1b9173a3767a037c167f05420b95a70..94914eefba04db2a068767adeb7657e328613460 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs index 4da387aa872efa667226089535caacb4d55ab585..43bc74931cb0e7c7ae8c90e8dafbac12df83669c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_uniques.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs index 22d20c26e25ee261d05756e50791dc26d5944754..680e65a2dcf90271faf4f25e1f02656ded9d6881 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs index ee76b111e83c497c9f051e6a848b9b83eced0388..c2ed67d2f5d45196894955e3e2fbe41e175454c0 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs index 8608d04af069073e6e507565dc2e8e5096731dcb..9aff4902d15baa7c8040c8d37ef747fc0c08b754 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 17e4ea7c8b69bcb31eeea4c344010b25bac0d66e..6e663039b0c2bcd2767dbd46b6e53c113b50be3d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 4988047014beb00b8c0d3feeb389e52b000ef9b8..625549ecfccfa348e11debd99325f7ac41646445 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs index 25d47b55977cbdfca7a1f6d1e4c5908f17e9cfb5..0c197598f889535ce94fe08398ded797a324ef8a 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml index b008b21b12dde4d4c4ee9d5cdbc7f0635db6dc82..dfc3d5416cc3c7c2ebc51dee2aa68a495a6a5079 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/Cargo.toml @@ -53,12 +53,12 @@ sp-weights = { path = "../../../../../substrate/primitives/weights", default-fea pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} polkadot-runtime-constants = { path = "../../../../../polkadot/runtime/polkadot/constants", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -105,7 +105,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -180,7 +180,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "polkadot-runtime-constants/std", "scale-info/std", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs index d3ddab9a854fa07b59d933b4f8ca09f6d65c04c4..d430e38f1af15b423b2173778a1cb6376fa17835 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs index 4a81c7fb6e3358812cfe0eb6be2459730a89a419..7275209802f15d9110db2e0faace126362a8a52a 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index e3c64776ae1c05edc997a7f01e70475c0227411c..65844ce194a0e66415179919a444eacbf6cccbe0 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs index a2007347211d3ed80780aab58b7ec3f6060cba2a..713c33d34f77f5cc3a5e659a2b31dbbfd5721931 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs index 2cf514a5598139c5384cdc5fa4092cf9d33f43c7..3eb3b925e651836446a7ea771cb20f9b9444594d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/mod.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod block_weights; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_foreign.rs index 817d567c8637c77a4c0a0f28d770dd68f918bc75..51413bb471b953b6724def2d8d009532425c02da 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_foreign.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_local.rs index 829b3543ee317022c929eded9365b4665ba18f17..c8420e72ba213fda9f11754552cf05fb84a530d4 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_assets_local.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs index 0da4d38eda247abceef5e0b827a565f4e881cbbf..a7f02ba24fd13ff409e599b5344d8c6a512aa9c9 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs index 6d8828e836cca7fe0b2d7e8a44cdb65e80bb994f..53efb218440a87dbd5557708a42c92ef39add826 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs index d51eb85f6dcf5f71aa3e1d88a28234ac5fb1cc03..705aca9e1a4e78222f231a11ca44dd27ac20c70e 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs index 1a04d8b0991d0039621efe0927e61dfbbe0f976c..6d6f7cbbafb44c31b55def7c36a731aee984bf40 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_nfts.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs index df0124b471d59ba581562eb0e7ba054b6549dcb3..99db2865692fc6e0316285f4985a974d85dba766 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_proxy.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs index 50c77fd3bc89921a9e7032a05b9d0ffa61c819ff..8a6943d53048047641132a70d6cade4983e503b6 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs index 93f7e31120ca68504342a0d3d36eed05235ece77..8c6a2b5505e56afe4b3f32c06d2a3ccb59bc36f0 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs index 3917b594c3f1f113a422c590e91a3f58e965e0af..a88928be65348beb3fc0fe29c893e1de0bacacfe 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_uniques.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs index bda0c6e1aa94891b24f726a84f3cc58cef3251f7..c6fc093cc4b44e1396d49b4a74e34eb99f07bd3c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs index 8d14734888b6798f9f205a3845dd5c9977e9edbb..bd7615895e2e96fa95d45389e3296d988fc7057e 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs index 79f8e83a4f20475f5b1d8c7390c1ac494f4a65a7..55fed809e2b750d96d279c0558264918a8b60eb9 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 7fea608319f0bf61fd071d1e685f0c05c5945efe..4f64ea3fa1bb37a4a91274de003dbf49349d6e4f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index aa7451594f5bc66c8db20f529489279c01547c00..061992691a605b42702a292eeb11e0520160272c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs index 3e40afb83f9c7c28b09353851bc9d9a7c0b9446d..d59507e4bd07d4f5a8953c1ad62814a2ebbc2a37 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml index 51df65914881d05d93bb13af880b562530ae626b..8c25842cbf3817c31c8e87b32025c1a5fa28c5de 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml @@ -56,12 +56,12 @@ primitive-types = { version = "0.12.1", default-features = false, features = ["c pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} westend-runtime-constants = { path = "../../../../../polkadot/runtime/westend/constants", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -110,7 +110,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -189,7 +189,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "scale-info/std", "sp-api/std", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/constants.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/constants.rs index fe789569a8ad796c85f67adb3f0fc62b04fbebcf..b2629ef10fcc4c139b9cbf69aacadb2a84820ab7 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/constants.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 48f2bfa45d80637632f02e151c143333bd9fd749..b5f33e4e01458c5310207d59d2065b3886e4d677 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs index 55ddfea38d1512e8853f73c6f5c544811bdebd04..cda66f6ea7eee25ece39733cf266dbf16c5c0338 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs index 9ec9befa97c94d9aff38844b0ee0961295db6ea2..c70ea9d58b2649c5f6fbf53cf620757c4aa19f1b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs index 955d4690634e8cb7949afe63cefc5ae66e600d14..281c013b3372f57a24b57812de91e684ffabd0c9 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod block_weights; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs index 1744fcbe3977868687b07ce4dabc85263fe010ad..2f39df65403043dad536ccb180c396108c73f487 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs index 5deffe235cc263cd2dbab3cf412e2d5b65541d11..5be1319b10dfb221230a66429c578248fc30a9d0 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs index 15f4fdecbd2f21b84d60a7399848d8b27ebc94b3..aa09be829c85c6e19d252ad03dd584e34024abc4 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs index 6101141e3ae1e73ed8034f7ab02599d57f2bd9d6..bfe73e1cfafa5dda9690f4b57f07e08c6ea3b740 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs index db6dd8fef51fd649657a6de9450e2c0823c565b1..f6bf09d63bae20a899301bda372a48ad389c935c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs index 80da7446bcd6f490ccfb5cfd827a1d4d339bc740..2473c58e45818145674d62c31f6c6a07b6f6794f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs index 230539e94df79b21b36163ed5b107c4624f5e6ff..107d78c98f978f6500f721193fc81ec009204b98 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs index 38387a1df0631a123a63cfc655bc4f37cfd1bf1d..e155e1bada3abc8f959404b112d7d393c40c0a61 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nft_fractionalization.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs index 5c0a53e9333ae469b8d4a9806c9a8cd9fdc9adcf..687dfa07f75148de35519507e1721f61dcf7cee8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_nfts.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs index 076d79ff6275e0c351d4cf9d7d19c10aa8957915..657bd2764cf2d88bdb22d322fc7a67f881c9f3be 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs index 8b8e5500d10f87879c95d78b0e5b1dee84bd6c81..926021917441904d3553f996e3fe9074ba1fe97a 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs index 40c5f3536097d04ceb13c1b7232129903bd5e5e6..13f18861d37e8d715e0fb19d71bd60af8dcb8321 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs index 813d472709d26d069ce73067fca666a8c8f82bf3..53bead08f5d4cd9ed4388555a58eca1ae183a2ab 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_uniques.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs index ca0ead95b15b73181c19850ada621d66b998cd74..7db443ebbf19967d00676518a53909130ae77a86 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs index 0256b49be3fe1c25eb011f23d53d9f9b7c0c9c84..1cc4c2d0e24cf205e5ad33bf40e93dd22f864d80 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs index 763cb6c10f13560b9504b5c6843cea6d9c64194d..bb850ac72c07d3ebfe576041bc56a6da5051ab9d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index ee435559f46ffbeaefbb8517ad2a51124be11fe2..d6763d2fc66f4fb68b9a0b2ed1ade7a7858d6e3d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index a1d06914aa64672227bed6b2fba6007652478dcd..e776529eb7f8e0cfdc70dcc76200e1ec21de7aeb 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index e0af76d6d00214fb9dba07d8fd3c7a00976422f8..6981c290c98ce800792292c06cfdb037888b14fb 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::AssetFeeAsExistentialDepositMultiplier}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/cumulus/parachains/runtimes/assets/common/Cargo.toml b/cumulus/parachains/runtimes/assets/common/Cargo.toml index cdb7b87dacbffbcd64c2e9fdf2e70a114a071cdf..a8b5f3f8c6b9db84e8c18b654cc0379a641ced1c 100644 --- a/cumulus/parachains/runtimes/assets/common/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/common/Cargo.toml @@ -21,9 +21,9 @@ pallet-asset-tx-payment = { path = "../../../../../substrate/frame/transaction-p # Polkadot pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus parachains-common = { path = "../../../common", default-features = false } diff --git a/cumulus/parachains/runtimes/assets/common/src/foreign_creators.rs b/cumulus/parachains/runtimes/assets/common/src/foreign_creators.rs index 00f336f9c68239f8d51b83fa15dd5553fd5fce9a..1ed7bd0538c287bba5255c41145a1c3fa3a10064 100644 --- a/cumulus/parachains/runtimes/assets/common/src/foreign_creators.rs +++ b/cumulus/parachains/runtimes/assets/common/src/foreign_creators.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/common/src/fungible_conversion.rs b/cumulus/parachains/runtimes/assets/common/src/fungible_conversion.rs index 5aa5a69caa941de30a40a2930fd08a0f84fe472f..80f8a971d21781004e264600c67a62f9a18c2ce4 100644 --- a/cumulus/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/cumulus/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/common/src/lib.rs b/cumulus/parachains/runtimes/assets/common/src/lib.rs index 25ab296ff1c6c068d01e420e907e1115f59238dc..560a89b131c03520da8a574620f8641f87e66ccf 100644 --- a/cumulus/parachains/runtimes/assets/common/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/common/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs b/cumulus/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs index 72fd9e7a9165de2227d9d26b59eb557727740040..5c66d1cabe571a5098f85fba47a81a4058cacbd6 100644 --- a/cumulus/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs +++ b/cumulus/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,19 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::{ - pallet_prelude::DispatchError, - traits::{ - fungibles::{Balanced, Create, HandleImbalanceDrop, Inspect, Mutate, Unbalanced}, - tokens::{ - DepositConsequence, Fortitude, Precision, Preservation, Provenance, WithdrawConsequence, - }, - AccountTouch, Contains, ContainsPair, Get, PalletInfoAccess, +use frame_support::traits::{ + fungibles::{Balanced, Create, HandleImbalanceDrop, Inspect, Mutate, Unbalanced}, + tokens::{ + DepositConsequence, Fortitude, Precision, Preservation, Provenance, WithdrawConsequence, }, + AccountTouch, Contains, ContainsPair, Get, PalletInfoAccess, }; use pallet_asset_conversion::{MultiAssetIdConversionResult, MultiAssetIdConverter}; use parachains_common::AccountId; -use sp_runtime::{traits::MaybeEquivalence, DispatchResult}; +use sp_runtime::{traits::MaybeEquivalence, DispatchError, DispatchResult}; use sp_std::{boxed::Box, marker::PhantomData}; use xcm::latest::MultiLocation; diff --git a/cumulus/parachains/runtimes/assets/common/src/matching.rs b/cumulus/parachains/runtimes/assets/common/src/matching.rs index 964f25cda35194633ca7a2c84b9989c7e219dc8e..08d391170014cfb0958887c09372f6e368910a56 100644 --- a/cumulus/parachains/runtimes/assets/common/src/matching.rs +++ b/cumulus/parachains/runtimes/assets/common/src/matching.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs b/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs index 7eee95bb3b648d4a1bf64973d2243eb132fc2826..0a166a048193998fe15b1f35f3e667a76d71540b 100644 --- a/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs +++ b/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/assets/test-utils/Cargo.toml b/cumulus/parachains/runtimes/assets/test-utils/Cargo.toml index 46b82b3ebb230a18dab3b81f17070a82e8d0c1dc..7fee710f000c0d2bd44f6ddfba81e0b5c7eb1d3f 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/test-utils/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Test utils for Asset Hub runtimes." +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } @@ -34,10 +35,10 @@ parachain-info = { path = "../../../pallets/parachain-info", default-features = parachains-runtimes-test-utils = { path = "../../test-utils", default-features = false } # Polkadot -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} [dev-dependencies] hex-literal = "0.4.1" @@ -65,7 +66,7 @@ std = [ "parachain-info/std", "parachains-common/std", "parachains-runtimes-test-utils/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "sp-consensus-aura/std", "sp-core/std", "sp-io/std", diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/lib.rs b/cumulus/parachains/runtimes/assets/test-utils/src/lib.rs index 9a24867592e2adbf6b6a79d4baada39a04786a0c..7177726e07046e1d55a015016e88924db418077a 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs index f11d590f4afa2effbff97a4b59fc7854eb32d568..7a8d571403c6b5c5f856dd30c08eaa092423cda5 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index f29ee82b7cb58dc4db995df591395711f9f03fba..91eb7adc61feeafb4d060e59039a40df999eaa3d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.183", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate @@ -52,11 +52,11 @@ kusama-runtime-constants = { path = "../../../../../polkadot/runtime/kusama/cons pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -110,7 +110,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "scale-info/std", "serde", @@ -148,7 +148,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs index f0908fcd4395095378ef7721d88fc59e65591e3b..760bf7fb6d1f9d31d00a5510834e40174c96ddd9 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index af00e06c78113e42f29bdab1c358e91ef8741848..044ff845fe66d438c7c177aa90303b1847c5aae2 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs index 83b242f045992b54f12e199366282463b516ea2a..991cba573bf2a64bf917f5c50a246354c7f82355 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs index 83b8ec960fb12a71399b7d8461fedb9e49c07823..5a0a60cc9952dc8f7eb98458a848b24b9c166f3a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index d5722374defcfc6c9efc6579031a369208807187..e226021e77ab58d51bda2eaa23ff732d53e7f4cb 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs index 1387ee30c7d37485a1c1c42636150b9bb624fe41..51ca2e660b3b578a5d23e38eb215e2b4a5c5debc 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs index 7854bf88e404aeac79e2361c884f9d45ab40d1fb..fa0ac199ca2c06d07a757e191d9a00e9e1f9cb7e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs index 14b11f9380a6720afecea7479f02d648d1c6a79a..96b2d859ed864d8a368bc258038890825c8b4d36 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs index 69371604e796013cdad7edfbfd2290c23590307a..cc1b4aeb0ddb6718b57ebfd65c985fc4071867b1 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs index 31830fbc722e69d942ace4d5cfb6dadff215480d..32f6e4a6b43598cf3b3b6a6df7a571bd38f44697 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs index f871f81b756f3f14cf3984b32073f59581b088d9..15b06676cd364efcd9d80361f7f7437cab032efe 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index e2effcd36df687b9bdaac1f5a74a25f504086462..71bc583077100ecb9edfbca039a9c7b539ff6d66 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs index 295e222f27ac54af2ab24cc3880efae03971910c..0e740922f339de717f04f0881c165786c36ba47a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 4ebc6eacb9fb081dc995336d372d5f9b9b1393dd..6c8c7ab66bbdb8e149a04e56b59f9a4fe7a75722 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index d38d177a605c7d485130dd78bd37bb3594c110ac..b1e8107b30bbddb9e30f0bf3c648627993fa4448 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 1fcec7b6b9c5da19057279d3393be342939e18f3..696462be9c45c31a8d4a6d9491ed1c9475fda00d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/tests/tests.rs index c9215b6157c37c6ffff820aa8d6b956c3ee5bf96..5418e36bd120fbef6bbe520e520686613bf65974 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 87afb20eb9066d1708dbf10f0aff5cd2df5c557f..52a866b7097149da2be98bf32403bbb4877f0292 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.183", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate @@ -52,11 +52,11 @@ polkadot-runtime-constants = { path = "../../../../../polkadot/runtime/polkadot/ pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -109,7 +109,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "polkadot-runtime-constants/std", "scale-info/std", @@ -148,7 +148,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/constants.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/constants.rs index a42c3e4f85d2a061639a95ac6866df0e07700a28..3bab7bd1eb338e94e62517cc84d8488ae4bc50c9 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/constants.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 0a6bddb225717341d7c6c2abcf745160b59c825e..f735858a93400bdb33ea59bcb8ccadd8bff2f658 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/block_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/block_weights.rs index 2bd7975bf98c36996520716c9dc11822d8287234..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index 740c3e9dd0a189ccefdc54a20763bfcb2e036816..98834cc44e880e432c13c4b1b3d8a5dfe3cbf624 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/extrinsic_weights.rs index 898d72ec5b19519a77ec0b75bb65d757213b35d4..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/frame_system.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/frame_system.rs index 62883b2d9073faf1a68cd69bc07b7af64145caf5..4aeb4660d8786b81100e26f1309dc2be8898e874 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/mod.rs index 457d00f36bd9ab44b2a72828eee6d2fc81a3e495..e226021e77ab58d51bda2eaa23ff732d53e7f4cb 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs index d58126b3fd61aa6bfb2e8498b51d5d496f73d251..5abe64bb411750f714e65038a2c750932240f2f7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs index 0b153be27193d75b5a135278b4cca96520ccce5e..e0f4156fe4d4c4d3f31229bdaa6308456a5cabb7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs index 9984823b1c16ae6a232c30fa4edfac5d91d9b198..4625c4f474ea2f807652e549898a0f38be510554 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs index 3b74d0afd189d112ddb3f6a767118e4184487307..29bc576ebc80d13e02f52837a5eae57436f278ff 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs index fdb3c2ac9596999d30f0c8398c882a1ce7b66ea2..8252834cc11e3cebb131332a92ffc80d25921dd4 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs index a7b31d3d38530ef685410dd83d5d41835b2de131..5205e9fff8593dda91a9f4b1433c1c5ff4fb3e55 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs index c9e13f2bdb2fdb488ec3862044fa3a5406111f49..ffc5fa2fc23ed2c4cb5a0624866dc800ab5ae1e3 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/paritydb_weights.rs index 1c6d2ebe568cc81e91167ec723102eebde49259c..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/rocksdb_weights.rs index aa0cb2b4bc377bae5bce9b18cbb78820c91f344d..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs index 4d7b626cb72536b739da3c1ef209890d3ea9ed74..4f8c2dec7a8c890f1b4cd9ccd2cf24e92cea3817 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index b02cfcbf75f3c2075fd26b9af80e04f46427bc47..7c525dca051d277497e9c64395bd69d6fa5eabc2 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 87bd0a6173bc8ff0cd7ba0165bb92a3a5b0d35ce..7968649d143c1ca54d05285d0958379a2124fe7a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 0b5831f028b0a4e3ab2111963fa7dfae80b2fa0f..0965600c246810d7566bc9de08b60a787d175352 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/tests/tests.rs index f9fbf35e9f145ea8f9ce90237a6ff54c596c41ed..03b23cdd7ac221d8af10459e73c64d0a5f477215 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/tests/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 95bf4c16967a1c5d242177500cb19bcae2b01410..d65fb9b72cd1cdcb263eb006ff82326cb71a28c2 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.183", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate @@ -52,11 +52,11 @@ rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/cons pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -144,7 +144,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "rococo-runtime-constants/std", "scale-info/std", @@ -188,7 +188,7 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs index d45238b0f4239412acb2a3b1b0960a50c22d8421..bc8f97ad97c1c15232a19b062a8f5f2bb674a809 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs index b676e2c5994bb41eb7cf4233b47d5f0424095f50..5178b75c30390a21e8319b0d80ed58b000430311 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs index 860b4ad2ba96ace315287db92a0fe5fe1221c168..80620feaedc6986e07b05e43aa4a33ba1ce81baa 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index a00dd30a870ad0cc8e167e1219b2551d8403c94f..a872e2327303c14f1361a949c1fb4036828c2ced 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -1040,7 +1040,11 @@ impl_runtime_apis! { type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; - use bridge_runtime_common::messages_benchmarking::{prepare_message_delivery_proof_from_parachain, prepare_message_proof_from_parachain}; + use bridge_runtime_common::messages_benchmarking::{ + prepare_message_delivery_proof_from_parachain, + prepare_message_proof_from_parachain, + generate_xcm_builder_bridge_message_sample, + }; use pallet_bridge_messages::benchmarking::{ Config as BridgeMessagesConfig, Pallet as BridgeMessagesBench, @@ -1072,7 +1076,7 @@ impl_runtime_apis! { Runtime, BridgeGrandpaWococoInstance, bridge_hub_rococo_config::WithBridgeHubWococoMessageBridge, - >(params, X2(GlobalConsensus(Rococo), Parachain(42))) + >(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Rococo), Parachain(42)))) } fn prepare_message_delivery_proof( @@ -1115,7 +1119,7 @@ impl_runtime_apis! { Runtime, BridgeGrandpaRococoInstance, bridge_hub_wococo_config::WithBridgeHubRococoMessageBridge, - >(params, X2(GlobalConsensus(Wococo), Parachain(42))) + >(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Wococo), Parachain(42)))) } fn prepare_message_delivery_proof( diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs index 23bdc6fa4d723e95c9bd67060219f3d4972ddbf8..0106d6398f45938ae89603622db23abf300ec3ca 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs index 7146e59f1d04605b0f4b680be61c8403df289b29..3dec4cc7f182c9aede28084122747dca63b24431 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index 81ecd10512f9327d473fad146d2e8df13fff0814..54c7c03fb6085dca07eebd9ddfb052d9a5dbb969 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs index 9f16d8b8141b133fee299be2b7082d53ca7c136b..26a188a98610a7ecc822eb5e7e448ad7f1867eb8 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs index 2465d52cbe6425371fd972c5a5f012c613b1f582..5fbe2da8eaa31ae2689a389709fa468ee2d975a7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_rococo_grandpa.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_rococo_grandpa.rs index 746db2a421cfbbc7463318d753699bf743b8328c..f646ddc3a387b1cf8a0b712e98a94c0dbea42492 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_rococo_grandpa.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_rococo_grandpa.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_wococo_grandpa.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_wococo_grandpa.rs index 377569f1aebda393e8dfce68354b1b5e6afb87a9..5c7c824624748cf1df16cd3c8e198ae52c0fa5fc 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_wococo_grandpa.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa_bridge_wococo_grandpa.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs index f5ab0edddde372be7ca87e5473a97c5c76410bdc..ec40615dc133949d8c880e00c687cb106d55cdc3 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance.rs index 3fe496036f16c24d0f16b64e58440805ba389701..7c25ae337ad6e731d97ed887bbf7e22e95354e0e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance.rs index 112eb22714869e620e07561aa7e3e5ec4cd47545..c3dbc19518bcd420338dbc810c3c8ed4889517f0 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs index d77c43e729f5049ea2a8a11a3a3043396380f898..c9f1d7e05d34e00fcb1f7b28939e93a01dece2de 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_rococo_instance.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_rococo_instance.rs index 3ba8fabf7797361078c755130f1a636ed3996e95..147e8447ee87ed33740393299ffee3d8d92d772e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_rococo_instance.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_rococo_instance.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_wococo_instance.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_wococo_instance.rs index da5ec6c14187a27a8dcc9359c7c23f046b6f5757..432f9f9969db11ccd9f38f51473bccc700bb9133 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_wococo_instance.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_wococo_instance.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs index 426b098d54e3676d84ec7777d2fe049e69fc58d2..a934a1be58271fa610733c597d1fce9bc97f588d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs index 956b7b7b43cdcf161c8f93182857124752a815f0..9cbfa6ce80e3e4b45338786c3705500bf27a220f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs index f3a2e7f0268b50b678c2cd8a18c35c2361d2085c..91840ae0c6d77cfb4507d5f7d7b8f2aca7c84b35 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs index afa64ae7537c2755a1e44b688f344d1a83dc7ec9..c9d04f9c6df65892243220531ac9d42dc885702d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs index 61742f36995077bd0730b5b2c3c6e47210fb88e7..0a5bf9b9f9c1f8c483c2e2f86ae471b28e7f609a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs index 4941bd661544940ac4bb4989a7b7ec8c753cbbb6..44cd0cf91e7998cb504587c481d13b110c9db072 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs index f6d61f9e6c29d9984c3dabc687eab4d1136f1dbd..72bdb282585dec0533662bad5620f2434bcc15b1 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs index a5c6bf858f649d847273331304f98880c39c83df..40a2036fb49a9b3ec7c121c5c1dd2a8451118497 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 25ec8777cd3cb73f05e9f7dfb37e1314f1013cd0..8f9fbc912454b5c89759fad5faf440c3275cbcf1 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 3cb066bc53df6e453227af12a4ecf58dab831394..da3404909f31ca9418a9f2d21117178833bb1a11 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 170382fe5834c4a5d8a7b4352337ecc666a3c9a9..e3d8645d49e7e6e6b0d6a7dd82a244c5cca90ee1 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -31,7 +31,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use sp_core::Get; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index 1d8439d23e0d7c273cc6d5cc1ded6763ea619c7e..77e7e0382d313ac1715c866b493e2f3804fa022e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml index 147166f21685586e7ebf89547576c500fe38243b..73678e8f91a363a3c6f5ccbcfb86d77b50543428 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors.workspace = true edition.workspace = true description = "Utils for BridgeHub testing" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } @@ -36,9 +37,9 @@ parachains-runtimes-test-utils = { path = "../../test-utils", default-features = # Polkadot pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Bridges bp-bridge-hub-rococo = { path = "../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false } diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs index 289d3f5b4d31affa08bb444849842d1c81701895..26eb09b73fa6c9755ee613ae6bf4ff776c541ec6 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index bd0f070f9dcd375081890c83a86ca2d237821912..aa7fa16a9791c626eaa4473f6de5914e6f5867ca 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml b/cumulus/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml index 59046ff1209e8ede300be14ad0d17389ed26b0eb..1f17a0ef0e69ee4837ccf48b2d53aad54808c2d3 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/Cargo.toml @@ -55,12 +55,12 @@ sp-version = { path = "../../../../../substrate/primitives/version", default-fea # Polkadot pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} polkadot-runtime-constants = { path = "../../../../../polkadot/runtime/polkadot/constants", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -106,7 +106,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -186,7 +186,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "polkadot-runtime-constants/std", "scale-info/std", diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs index ac516447c7407dae82ce2b221747e3374b765db2..46b562ea4de795650512366fb411a9129fc18b35 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 6f5b8aff8d4a059a36b25f90bf0bafd2cd608a7f..9350d03a2c9fbdd0806a80d94f2ccfa080e34848 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 489b868eff347ecd866002c587b18e95eb3862ab..9b86753312951536734f7a3e8c2987d08b27e9cc 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs index 04663aeecf3b7894a44b1d173b0d53e07f246937..5ed2c19f79e6464fc09a349d8dce3c09afad2d55 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index fc53efdd7e8caf7622a06b766773f9683e66c376..f4ba4e05ec166d9d9b7e5e5ed9b679042067ba13 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index c28b4e2dc1e6b20d0bb18dd9ec18de2e23eeb33a..c970d82cfe50d358ebe765c1c4472bb7aaab6f7f 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,13 +15,14 @@ use crate::OriginCaller; use frame_support::{ - dispatch::{DispatchError, DispatchResultWithPostInfo}, + dispatch::DispatchResultWithPostInfo, traits::{Currency, Get, Imbalance, OnUnbalanced, OriginTrait, PrivilegeCmp}, weights::Weight, }; use log; use pallet_alliance::{ProposalIndex, ProposalProvider}; use parachains_common::impls::NegativeImbalance; +use sp_runtime::DispatchError; use sp_std::{cmp::Ordering, marker::PhantomData, prelude::*}; use xcm::latest::{Fungibility, Junction, Parent}; diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index a9af3b0f29fc7fe750002b132bf6d13378305a29..5033a2d8beb1369f96dfc017cf524ce08e3c3467 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs index 28e1cd902b503075e701742db6159bc87fd65e0d..ccd9478bf10eab85eef8b80c0354b59e33e08d3d 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs index 75cc6580a39d52f9ae0c78746c634dc98d70b85c..31cd502d1927b0cfeac64774567c937d7ee33050 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs index b0e49549914286ad7615cf056681ae6bca832816..9ddf53792ea4f56fd7460f697d8ec4835dfdaa06 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/mod.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod block_weights; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs index c822a0c85cd8fb38c4a3e9f232dc743a11fa470a..9e3acac46a4c9e7bc39d55cc5d928150aab3aaad 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_alliance.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs index 80b90aadc0db56d1bee6b607f03719be78e753a2..dd0c02ab87306ac8d311c223a0c4b297b67552c4 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_balances.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs index 8376006e30c9da1c2393646dfc3e998720a03aa6..ea237d602a9b5a1190b89aaf4fdf955bdbc9df58 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collator_selection.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs index 013cfee7ba9dbc41b618d70b5cf8630f38f4d6e2..2d344ad0db7ba9e7b98303624e4f3f4a11c4087a 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_collective.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs index 50a8bcea50004ed2266d85bdc6c7cdb2b961c2ae..d053513b53accc68cc3332ee1e123b6c3a08bd83 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs index b2e36af383b8aa61a04f090fd60bedba242ee12e..a8dd58320cc204382c0160f9629e386ddd7851fb 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs index ef2406230b20d2564fb12c684157d6ec55a273a3..cf2f0ae39da61e05a9816a445742022e6c4ba939 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_preimage.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs index 9732251e5aae026eb0ab40baccf25e7dd94e583d..faf100d23bb0d5c68b1da4d4421b05315ddfd3de 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_proxy.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs index 0ce5de87c8f28304d85ac7e03fc3f75f7ba8dc21..561edda953b9a75df47a3388245eede3ec78ba51 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs index 1e8b3ecae2e2c6e66de57ff0d865c9245e17e9f1..12d92a803cad9be870465264539c438b9a7487e7 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_referenda.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs index 351834c5e3adab42a7448cfe8d4a600ddf532a3a..3a6825cf6415887dc284555aaad14d52628de58c 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_salary.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs index b647f7eba87357d61e298c83951e079492a6eec3..d30ac82bf059bc8a2c75b1e8bce75024da38bea3 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_scheduler.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs index 909f9a64f5aabfa3ae5abdc9c65690a51fce5e2c..2af8ce29a196ef21d8f203ccb5d62a1bfeb9a6b6 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_session.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs index bb8f0e0b37690fcc8e88509d889bf7d8b944554e..bc149ec63a176f09e226988d3344f29f9cf3e530 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs index f16ffc4c0c3b0b49476b19f6b44db9da7468854d..5d6b0cb8285c91a98c99e97c7eb948086d1fb2b8 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index 030d754ec4ce5ff7a0eb59acf761f271d73f14d6..738742b6108b79bb11520fdca1d191735cee1a0c 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index e9b5c1b165a80c82157b0994ac1cc647b7de6343..b4db73e3ab4401da08b38ec36632cc07edce25a0 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +25,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use parachains_common::{impls::ToStakingPot, xcm_config::ConcreteNativeAssetFrom}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml b/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml index 266437a4821e76a71d2cecbce1f7664d316d24e4..2e298e05ec76b8ec79a39caeeb6f74acbb52c997 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml @@ -55,11 +55,11 @@ pallet-contracts-primitives = { path = "../../../../../substrate/frame/contracts kusama-runtime-constants = { path = "../../../../../polkadot/runtime/kusama/constants", default-features = false} pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -113,7 +113,7 @@ std = [ "parachain-info/std", "parachains-common/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "scale-info/std", "sp-api/std", @@ -151,7 +151,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/constants.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/constants.rs index db7922ea905b8588d5bdd3289e9bd4f8fc813097..9b0fe5182a25243f4e9cd9d6d3ff21676f88025b 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/constants.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/constants.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs index 1c2b24d88a874de13ac7613ca8f571749b978aec..6598fd3fae0a8800fc1e2919de8cff2807da7f44 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::{ constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 9f381d4417a076bacb68fe0543989f5a988d73f2..b5815ab057e6492158f1dc8726ee08f4ebdb3e3d 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // // This program is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/mod.rs index ed0b4dbcd47fbffb125bda4b337099ae69e51ce2..30fa2c4060689ff98cc427c84f81866172845e52 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index 3857c07fd03f8af7cb99d81fcca60d6c627e4822..7433b8e94d6c1e9e343c7b90f0412826d667cc6d 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +24,7 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/Cargo.toml b/cumulus/parachains/runtimes/glutton/glutton-kusama/Cargo.toml index 4973021d30061ece3d25d1055788346463c1e865..0caf00340d3a3ea63549983c92d37e622a88770e 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/Cargo.toml +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/Cargo.toml @@ -31,9 +31,9 @@ sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction- sp-version = { path = "../../../../../substrate/primitives/version", default-features = false} # Polkadot -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] } diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/build.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/build.rs index 9b53d2457dffdc09ea4789b644e6d2b2a3cfc0f5..1580e6f07bec466c644ccab1f4591d384632135e 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/build.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/build.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use substrate_wasm_builder::WasmBuilder; fn main() { diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs index cd9d31a4d989f40cc78b35ae4dfc786d60f9118c..dde8f747d4633bb3a8bbcd9dca471431dea99414 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/frame_system.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/frame_system.rs index 1aff76714bb35d9e5879b56fcef54c8b59d54849..36c4abc400634fd9ec857675031b11b3c33d3fd2 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/frame_system.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/frame_system.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/mod.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/mod.rs index 234ce34bf420bcf7484fc537760a699ad2f304db..990558538acfcc97590325d2573a06f6026d35fb 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/mod.rs @@ -1 +1,17 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + pub mod pallet_glutton; diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/pallet_glutton.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/pallet_glutton.rs index f43a487826568839f4ec0c6171371e21770941b3..f278d246b33b1b4f0854b943fef8a1da22122e93 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/pallet_glutton.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/weights/pallet_glutton.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs index a09880f8cdc963711a3004d25b1274fee9ac1ddf..fb7b78b79d2a808021c5d0a8494e760c66417057 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs index edca2b093948c2c41917201e23e2bde79029323f..5f6733faf70679933fd177ee6ff2fdcbffe3500f 100644 --- a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/starters/shell/Cargo.toml b/cumulus/parachains/runtimes/starters/shell/Cargo.toml index d7afc8be864cb142a502f489f0662bb4d933d572..6f9046057102fdd42b2a588a14b66a99199afcaf 100644 --- a/cumulus/parachains/runtimes/starters/shell/Cargo.toml +++ b/cumulus/parachains/runtimes/starters/shell/Cargo.toml @@ -25,9 +25,9 @@ sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction- sp-version = { path = "../../../../../substrate/primitives/version", default-features = false} # Polkadot -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] } diff --git a/cumulus/parachains/runtimes/starters/shell/build.rs b/cumulus/parachains/runtimes/starters/shell/build.rs index 256e9fb765b7c6a152bbb229e9318e16d81b9ea7..9c9cde9a25a1a8ab1780b7df7e068264459a31af 100644 --- a/cumulus/parachains/runtimes/starters/shell/build.rs +++ b/cumulus/parachains/runtimes/starters/shell/build.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/starters/shell/src/lib.rs b/cumulus/parachains/runtimes/starters/shell/src/lib.rs index 205462fac39baffc707bfad5693b262045056592..ef914a246efc9f310176b3c46bf277a16b372082 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs b/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs index b1fcfc5c8f664ecb708526359ce779511846347e..ff773ca781612df1e757e343bff49facdad02f41 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/test-utils/Cargo.toml b/cumulus/parachains/runtimes/test-utils/Cargo.toml index 94b73d5e39dc988fd57ba828597ad9efdb78dce4..681e5e64d41280ef4ded74ff2bf347031e74bb04 100644 --- a/cumulus/parachains/runtimes/test-utils/Cargo.toml +++ b/cumulus/parachains/runtimes/test-utils/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true description = "Utils for Runtimes testing" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } @@ -34,10 +35,10 @@ cumulus-test-relay-sproof-builder = { path = "../../../test/relay-sproof-builder parachain-info = { path = "../../pallets/parachain-info", default-features = false } # Polkadot -xcm = { path = "../../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../polkadot/xcm/xcm-executor", default-features = false} pallet-xcm = { path = "../../../../polkadot/xcm/pallet-xcm", default-features = false} -polkadot-parachain = { path = "../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../polkadot/parachain", default-features = false} [dev-dependencies] hex-literal = "0.4.1" @@ -64,7 +65,7 @@ std = [ "pallet-xcm/std", "parachain-info/std", "parachains-common/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "sp-consensus-aura/std", "sp-core/std", "sp-io/std", diff --git a/cumulus/parachains/runtimes/test-utils/src/lib.rs b/cumulus/parachains/runtimes/test-utils/src/lib.rs index 93183a73c22e4753bb3c3eb404fb771a178bf107..8289a80baa11a8542210b7b691765bed05a9a0ae 100644 --- a/cumulus/parachains/runtimes/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/test-utils/src/lib.rs @@ -22,14 +22,14 @@ use cumulus_primitives_core::{ use cumulus_primitives_parachain_inherent::ParachainInherentData; use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use frame_support::{ - dispatch::{DispatchResult, RawOrigin, UnfilteredDispatchable}, + dispatch::{DispatchResult, RawOrigin}, inherent::{InherentData, ProvideInherent}, - traits::{OnFinalize, OnInitialize, OriginTrait}, + traits::{OnFinalize, OnInitialize, OriginTrait, UnfilteredDispatchable}, weights::Weight, }; use frame_system::pallet_prelude::{BlockNumberFor, HeaderFor}; use parachains_common::{AccountId, SLOT_DURATION}; -use polkadot_parachain::primitives::{ +use polkadot_parachain_primitives::primitives::{ HeadData, HrmpChannelId, RelayChainBlockNumber, XcmpMessageFormat, }; use sp_consensus_aura::{SlotDuration, AURA_ENGINE_ID}; diff --git a/cumulus/parachains/runtimes/testing/penpal/Cargo.toml b/cumulus/parachains/runtimes/testing/penpal/Cargo.toml index acaaadf04dd20968fac89ad4cfbe90fe048a53ed..99caf2f27d0391f7e942b531071bbb5c00ac6b39 100644 --- a/cumulus/parachains/runtimes/testing/penpal/Cargo.toml +++ b/cumulus/parachains/runtimes/testing/penpal/Cargo.toml @@ -7,6 +7,7 @@ license = "Unlicense" homepage = "https://substrate.io" repository.workspace = true edition.workspace = true +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -55,11 +56,11 @@ sp-version = { path = "../../../../../substrate/primitives/version", default-fea # Polkadot polkadot-primitives = { path = "../../../../../polkadot/primitives", default-features = false} pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -108,7 +109,7 @@ std = [ "pallet-xcm/std", "parachain-info/std", "parachains-common/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-primitives/std", "polkadot-runtime-common/std", "scale-info/std", @@ -146,7 +147,7 @@ runtime-benchmarks = [ "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/testing/penpal/build.rs b/cumulus/parachains/runtimes/testing/penpal/build.rs index 256e9fb765b7c6a152bbb229e9318e16d81b9ea7..9c9cde9a25a1a8ab1780b7df7e068264459a31af 100644 --- a/cumulus/parachains/runtimes/testing/penpal/build.rs +++ b/cumulus/parachains/runtimes/testing/penpal/build.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index 4bc7dfacc053c422b1a56c8c520d9f783575db78..9a758cdd97827359ac546c204f66787c36c208b2 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/parachains/runtimes/testing/penpal/src/weights/block_weights.rs b/cumulus/parachains/runtimes/testing/penpal/src/weights/block_weights.rs index b2092d875c8328210667da4cbb95de0642e60ae3..e7fdb2aae2a01ec06076de83d94817e540e205dd 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/weights/block_weights.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/weights/block_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs index 332c3b324bb9c1b386257bf7953d37aba8f5af13..1a4adb968bb7195428ea00d59cd92dcd3b6eea5f 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/testing/penpal/src/weights/mod.rs b/cumulus/parachains/runtimes/testing/penpal/src/weights/mod.rs index ed0b4dbcd47fbffb125bda4b337099ae69e51ce2..30fa2c4060689ff98cc427c84f81866172845e52 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs index 4338d928d807a41cc60ec91d86e91c81bb253631..25679703831a13b8d1bb7fb7dd4d92fa84b1f255 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs index 1d115d963facb39fe29d6258918fda3bc8d94900..3dd817aa6f137085b0e5fdf2b11b7f50e5c8b002 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/weights/rocksdb_weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs b/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs index 1825bea425d2abf4c1fb9abc9d0259d0dc9b9f18..97d2e63370ead0cb5ee82aa5773c3b37b56f67c2 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -39,7 +39,7 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_asset_tx_payment::HandleCredit; use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use sp_runtime::traits::Zero; use xcm::latest::prelude::*; diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml b/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml index 6e9f9f3039c0b475378568d041672231706532aa..863b9edd72581dd358e89f94ccdfd3b3675240eb 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors.workspace = true edition.workspace = true description = "Simple runtime used by the rococo parachain(s)" +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } @@ -36,10 +37,10 @@ sp-version = { path = "../../../../../substrate/primitives/version", default-fea # Polkadot pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false} -polkadot-parachain = { path = "../../../../../polkadot/parachain", default-features = false} -xcm = { path = "../../../../../polkadot/xcm", default-features = false} -xcm-builder = { path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} -xcm-executor = { path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false} +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false} # Cumulus cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } @@ -83,7 +84,7 @@ std = [ "pallet-xcm/std", "parachain-info/std", "parachains-common/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -112,7 +113,7 @@ runtime-benchmarks = [ "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index d01c66e772d79f65879e51d6d87bb0bfd449d1c4..362ad0383a2319d4ccbd26b826912d5974691dab 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -76,7 +76,7 @@ use xcm_executor::traits::JustTry; // XCM imports use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; -use polkadot_parachain::primitives::Sibling; +use polkadot_parachain_primitives::primitives::Sibling; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, diff --git a/cumulus/polkadot-parachain/Cargo.toml b/cumulus/polkadot-parachain/Cargo.toml index 8ae7a1f25f3288279859497f4293f935fd1bc6eb..dc59b8207528f8b4fe2171fb17eb67853101b690 100644 --- a/cumulus/polkadot-parachain/Cargo.toml +++ b/cumulus/polkadot-parachain/Cargo.toml @@ -12,12 +12,12 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.73" -clap = { version = "4.3.24", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" hex-literal = "0.4.1" log = "0.4.20" -serde = { version = "1.0.183", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.105" # Local @@ -77,7 +77,7 @@ substrate-state-trie-migration-rpc = { path = "../../substrate/utils/frame/rpc/s polkadot-cli = { path = "../../polkadot/cli", features = ["rococo-native"] } polkadot-primitives = { path = "../../polkadot/primitives" } polkadot-service = { path = "../../polkadot/node/service" } -xcm = { path = "../../polkadot/xcm" } +xcm = { package = "staging-xcm", path = "../../polkadot/xcm" } # Cumulus cumulus-client-cli = { path = "../client/cli" } diff --git a/cumulus/polkadot-parachain/build.rs b/cumulus/polkadot-parachain/build.rs index ae164d6cb0f4264a96e264c61de8b4cf00b909bc..dd0d112bca7018bac1ca250d9efc3a3972b6ca41 100644 --- a/cumulus/polkadot-parachain/build.rs +++ b/cumulus/polkadot-parachain/build.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/chain-specs/asset-hub-kusama.json b/cumulus/polkadot-parachain/chain-specs/asset-hub-kusama.json new file mode 120000 index 0000000000000000000000000000000000000000..89a3015b50aad9f65910327732c3cee6f5ed837a --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/asset-hub-kusama.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-kusama.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/asset-hub-polkadot.json b/cumulus/polkadot-parachain/chain-specs/asset-hub-polkadot.json new file mode 120000 index 0000000000000000000000000000000000000000..43a1cb41131af77676d78a2ec71b95c59fd46eda --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/asset-hub-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-polkadot.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/asset-hub-westend.json b/cumulus/polkadot-parachain/chain-specs/asset-hub-westend.json new file mode 120000 index 0000000000000000000000000000000000000000..03742c401622a34c444b57433e31cfdfd4ee75a8 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/asset-hub-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-westend.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/bridge-hub-kusama.json b/cumulus/polkadot-parachain/chain-specs/bridge-hub-kusama.json new file mode 120000 index 0000000000000000000000000000000000000000..fc91654c6ff4098675485eb6a114fd5f636b04b9 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/bridge-hub-kusama.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-kusama.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/bridge-hub-polkadot.json b/cumulus/polkadot-parachain/chain-specs/bridge-hub-polkadot.json new file mode 120000 index 0000000000000000000000000000000000000000..df22d3e8800157c5dfbedca008cac4c971b83ef6 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/bridge-hub-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-polkadot.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/bridge-hub-rococo.json b/cumulus/polkadot-parachain/chain-specs/bridge-hub-rococo.json new file mode 120000 index 0000000000000000000000000000000000000000..8970d92bcf5135e7578fe50b5c2af2e257131669 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/bridge-hub-rococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-rococo.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/bridge-hub-westend.json b/cumulus/polkadot-parachain/chain-specs/bridge-hub-westend.json new file mode 120000 index 0000000000000000000000000000000000000000..9f9e4dad5c18510904dc3cff01d27978575b9e6c --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/bridge-hub-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-westend.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/bridge-hub-wococo.json b/cumulus/polkadot-parachain/chain-specs/bridge-hub-wococo.json new file mode 120000 index 0000000000000000000000000000000000000000..e13ab77265d59d31fcf822420413d3b5240bf574 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/bridge-hub-wococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-wococo.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/collectives-polkadot.json b/cumulus/polkadot-parachain/chain-specs/collectives-polkadot.json new file mode 120000 index 0000000000000000000000000000000000000000..afece75567be9a10e4beed8799e5acd854d923bb --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/collectives-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/collectives-polkadot.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/collectives-westend.json b/cumulus/polkadot-parachain/chain-specs/collectives-westend.json new file mode 120000 index 0000000000000000000000000000000000000000..84e23b06fb4c5f44990b22922403c9f6ac5d6fb6 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/collectives-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/collectives-westend.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/contracts-rococo.json b/cumulus/polkadot-parachain/chain-specs/contracts-rococo.json new file mode 120000 index 0000000000000000000000000000000000000000..b9f8e8f31e84587c8bb148b96eefff3d7f87d682 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/contracts-rococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/contracts-rococo.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/tick.json b/cumulus/polkadot-parachain/chain-specs/tick.json new file mode 120000 index 0000000000000000000000000000000000000000..47c93a98405349f8aad7bd45e60edd4f2bc33da5 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/tick.json @@ -0,0 +1 @@ +../../parachains/chain-specs/tick.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/track.json b/cumulus/polkadot-parachain/chain-specs/track.json new file mode 120000 index 0000000000000000000000000000000000000000..9474c223a9469113a58b0a3e601df43397897638 --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/track.json @@ -0,0 +1 @@ +../../parachains/chain-specs/track.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/chain-specs/trick.json b/cumulus/polkadot-parachain/chain-specs/trick.json new file mode 120000 index 0000000000000000000000000000000000000000..de1fb9edf3070fd167ccc3ea866e3cc1cc652a5d --- /dev/null +++ b/cumulus/polkadot-parachain/chain-specs/trick.json @@ -0,0 +1 @@ +../../parachains/chain-specs/trick.json \ No newline at end of file diff --git a/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs index 0523c3b7e65fb0037ceda16ae6066ba8d82c70a8..c1fb60374aef87b3771bbbb1168d138a84d1b513 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 911368073d59e3c8626226cf065cff690111ae24..4cb81f57081a53ac815ec2884c8fac608c9214ee 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -97,7 +97,7 @@ impl BridgeHubRuntimeType { match self { BridgeHubRuntimeType::Polkadot => Ok(Box::new(polkadot::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-polkadot.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-polkadot.json")[..], )?)), BridgeHubRuntimeType::PolkadotLocal => Ok(Box::new(polkadot::local_config( polkadot::BRIDGE_HUB_POLKADOT_LOCAL, @@ -113,7 +113,7 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Kusama => Ok(Box::new(kusama::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-kusama.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-kusama.json")[..], )?)), BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::local_config( kusama::BRIDGE_HUB_KUSAMA_LOCAL, @@ -129,11 +129,11 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Westend => Ok(Box::new(westend::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-westend.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-westend.json")[..], )?)), BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-rococo.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-rococo.json")[..], )?)), BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_LOCAL, @@ -153,7 +153,7 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-wococo.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-wococo.json")[..], )?)), BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::local_config( wococo::BRIDGE_HUB_WOCOCO_LOCAL, diff --git a/cumulus/polkadot-parachain/src/chain_spec/collectives.rs b/cumulus/polkadot-parachain/src/chain_spec/collectives.rs index 82c925c5d493b0d5234a59a582e03db9f0d14560..6126fbb114f069ec4c65d1352d6073afcc0369d0 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/collectives.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/collectives.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/contracts.rs b/cumulus/polkadot-parachain/src/chain_spec/contracts.rs index b8af83a0d70edc8cb508d1f99360edba3f589dcf..bf318e448f0e65018629945fa6524588d8f96184 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/contracts.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/contracts.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/glutton.rs b/cumulus/polkadot-parachain/src/chain_spec/glutton.rs index 5ea51c3a918196d39cae5397181d4e31e6c8265c..acd5b5bfbe132fe1df8c75636522763d47c21335 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/glutton.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/glutton.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/mod.rs b/cumulus/polkadot-parachain/src/chain_spec/mod.rs index d7014a9f43cd9d906f79f17054b4695c8c0a32a7..9cd0a37ad633ba069cdf8beae71d3324af4485c5 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/mod.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs index 264898991eb84e1c8aff0327140c4a1c6a48c129..479d1701e379ea4b2ce9d3520205365c1b07201f 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs b/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs index 1ed1a3e35fba4a001cb3e9da2a21324931789bab..fb66efbf9ae1c68eedcc42b8ef6436b979885272 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/seedling.rs b/cumulus/polkadot-parachain/src/chain_spec/seedling.rs index 4a43b4cf476483b618f4c41055185c68a78581cc..3ebfb80d4685f67b9a43835fdc54609b5ca564dc 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/seedling.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/seedling.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/chain_spec/shell.rs b/cumulus/polkadot-parachain/src/chain_spec/shell.rs index eca605b10df032bfd2b3f25ac9ef60b57ee317dc..7eb65591b12f38cb4f5de15967aa4d398a1eb183 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/shell.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/shell.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/cli.rs b/cumulus/polkadot-parachain/src/cli.rs index 11b2e105ecbb98443c1c0613b18c7e517501b55e..63e4baf27aeb24bbf0d0647c5b2fda5ff34f0fa8 100644 --- a/cumulus/polkadot-parachain/src/cli.rs +++ b/cumulus/polkadot-parachain/src/cli.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/command.rs b/cumulus/polkadot-parachain/src/command.rs index 008e5435f0b11d91f3ec12daf1fa1368e2111d7f..596b7baf6710ea1af53d988d6f5b3d0f93921c7d 100644 --- a/cumulus/polkadot-parachain/src/command.rs +++ b/cumulus/polkadot-parachain/src/command.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -121,15 +121,15 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(chain_spec::rococo_parachain::staging_rococo_parachain_local_config()), "tick" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/tick.json")[..], + &include_bytes!("../chain-specs/tick.json")[..], )?), "trick" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/trick.json")[..], + &include_bytes!("../chain-specs/trick.json")[..], )?), "track" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/track.json")[..], + &include_bytes!("../chain-specs/track.json")[..], )?), // -- Starters @@ -147,7 +147,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-polkadot" | "statemint" => Box::new(chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-polkadot.json")[..], + &include_bytes!("../chain-specs/asset-hub-polkadot.json")[..], )?), // -- Asset Hub Kusama @@ -161,7 +161,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-kusama" | "statemine" => Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-kusama.json")[..], + &include_bytes!("../chain-specs/asset-hub-kusama.json")[..], )?), // -- Asset Hub Westend @@ -175,7 +175,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-westend" | "westmint" => Box::new(chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-westend.json")[..], + &include_bytes!("../chain-specs/asset-hub-westend.json")[..], )?), // -- Polkadot Collectives @@ -185,11 +185,11 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(chain_spec::collectives::collectives_polkadot_local_config()), "collectives-polkadot" => Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/collectives-polkadot.json")[..], + &include_bytes!("../chain-specs/collectives-polkadot.json")[..], )?), "collectives-westend" => Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/collectives-westend.json")[..], + &include_bytes!("../chain-specs/collectives-westend.json")[..], )?), // -- Contracts on Rococo @@ -200,7 +200,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { "contracts-rococo-genesis" => Box::new(chain_spec::contracts::contracts_rococo_config()), "contracts-rococo" => Box::new(chain_spec::contracts::ContractsRococoChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/contracts-rococo.json")[..], + &include_bytes!("../chain-specs/contracts-rococo.json")[..], )?), // -- BridgeHub diff --git a/cumulus/polkadot-parachain/src/main.rs b/cumulus/polkadot-parachain/src/main.rs index d114d2f5f2c8a3208b0bf572fbdce59630377178..e40af8128f7166697a7e4f7571dd541a11d626a8 100644 --- a/cumulus/polkadot-parachain/src/main.rs +++ b/cumulus/polkadot-parachain/src/main.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/rpc.rs b/cumulus/polkadot-parachain/src/rpc.rs index df6283388f9deafb6c00fbb8a2ee0854955c84d2..d106c52a364290dad54d3d278ce76dad8ef55c26 100644 --- a/cumulus/polkadot-parachain/src/rpc.rs +++ b/cumulus/polkadot-parachain/src/rpc.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/src/service.rs b/cumulus/polkadot-parachain/src/service.rs index 3899814cb0e8c0c0de564d1ce2a8fb959555b67c..f7b053b4b6a9def2fb7c4dd76f757213ca630f1d 100644 --- a/cumulus/polkadot-parachain/src/service.rs +++ b/cumulus/polkadot-parachain/src/service.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/polkadot-parachain/tests/benchmark_storage_works.rs b/cumulus/polkadot-parachain/tests/benchmark_storage_works.rs index df3078b4dab82f8853b349cd2ae338ae5c801a06..c2850b64e458adca9bb0918667cf912eb16796df 100644 --- a/cumulus/polkadot-parachain/tests/benchmark_storage_works.rs +++ b/cumulus/polkadot-parachain/tests/benchmark_storage_works.rs @@ -1,3 +1,19 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + #![cfg(feature = "runtime-benchmarks")] use assert_cmd::cargo::cargo_bin; diff --git a/cumulus/polkadot-parachain/tests/common.rs b/cumulus/polkadot-parachain/tests/common.rs index d8ecfe9bcbe5adbb8cfc5b2d18263ccbef489845..20926ddd91db53de52d32fb952ded38f8f868b97 100644 --- a/cumulus/polkadot-parachain/tests/common.rs +++ b/cumulus/polkadot-parachain/tests/common.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// along with Cumulus. If not, see . #![cfg(unix)] diff --git a/cumulus/polkadot-parachain/tests/polkadot_argument_parsing.rs b/cumulus/polkadot-parachain/tests/polkadot_argument_parsing.rs index 0538a47aa93ac02c951143ce2806cec3cac6878e..9337da85d74b16f594aa7baacf3e76a35b1bb976 100644 --- a/cumulus/polkadot-parachain/tests/polkadot_argument_parsing.rs +++ b/cumulus/polkadot-parachain/tests/polkadot_argument_parsing.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// along with Cumulus. If not, see . use tempfile::tempdir; diff --git a/cumulus/polkadot-parachain/tests/polkadot_mdns_issue.rs b/cumulus/polkadot-parachain/tests/polkadot_mdns_issue.rs index c88c81230b04c03987c60a1c8450f70dd69fee32..e3ccb7fe0fbdc2a7de5e04553985657b8b87733d 100644 --- a/cumulus/polkadot-parachain/tests/polkadot_mdns_issue.rs +++ b/cumulus/polkadot-parachain/tests/polkadot_mdns_issue.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// along with Cumulus. If not, see . use tempfile::tempdir; diff --git a/cumulus/polkadot-parachain/tests/purge_chain_works.rs b/cumulus/polkadot-parachain/tests/purge_chain_works.rs index 8a41ee780c5607234019d8eac608896f7c7cb13d..6415a914c7a3c8e1f381a08c29eef9cb3c1ebe55 100644 --- a/cumulus/polkadot-parachain/tests/purge_chain_works.rs +++ b/cumulus/polkadot-parachain/tests/purge_chain_works.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// along with Cumulus. If not, see . use assert_cmd::cargo::cargo_bin; use nix::sys::signal::SIGINT; diff --git a/cumulus/polkadot-parachain/tests/running_the_node_and_interrupt.rs b/cumulus/polkadot-parachain/tests/running_the_node_and_interrupt.rs index 254602a21844b9aa7d5cce3d4c861febb9fe379e..0f4ae6992382c7a8a58da25ac110b97b6db72f62 100644 --- a/cumulus/polkadot-parachain/tests/running_the_node_and_interrupt.rs +++ b/cumulus/polkadot-parachain/tests/running_the_node_and_interrupt.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// along with Cumulus. If not, see . use tempfile::tempdir; diff --git a/cumulus/primitives/aura/src/lib.rs b/cumulus/primitives/aura/src/lib.rs index a0d7a0206a632191f366f966f08bd2715ea44201..826b65fddd2c695f0c0a1c63d77e9eab68fe0f30 100644 --- a/cumulus/primitives/aura/src/lib.rs +++ b/cumulus/primitives/aura/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/primitives/core/Cargo.toml b/cumulus/primitives/core/Cargo.toml index fdbef574773727bb88e11b965553c5de75ab0fb0..fc7573be138357bab6757b59119e0891c37953fb 100644 --- a/cumulus/primitives/core/Cargo.toml +++ b/cumulus/primitives/core/Cargo.toml @@ -16,16 +16,16 @@ sp-trie = { path = "../../../substrate/primitives/trie", default-features = fals # Polkadot polkadot-core-primitives = { path = "../../../polkadot/core-primitives", default-features = false} -polkadot-parachain = { path = "../../../polkadot/parachain", default-features = false} +polkadot-parachain-primitives = { path = "../../../polkadot/parachain", default-features = false} polkadot-primitives = { path = "../../../polkadot/primitives", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} [features] default = [ "std" ] std = [ "codec/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-primitives/std", "scale-info/std", "sp-api/std", diff --git a/cumulus/primitives/core/src/lib.rs b/cumulus/primitives/core/src/lib.rs index 19cc69ea3013175d6de28ad7dc7093d35ad241b7..faaef09b26e174c151144e8a52bb76d8a495c285 100644 --- a/cumulus/primitives/core/src/lib.rs +++ b/cumulus/primitives/core/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify @@ -19,13 +19,13 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode}; -use polkadot_parachain::primitives::HeadData; +use polkadot_parachain_primitives::primitives::HeadData; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::prelude::*; pub use polkadot_core_primitives::InboundDownwardMessage; -pub use polkadot_parachain::primitives::{ +pub use polkadot_parachain_primitives::primitives::{ DmpMessageHandler, Id as ParaId, IsSystem, UpwardMessage, ValidationParams, XcmpMessageFormat, XcmpMessageHandler, }; diff --git a/cumulus/primitives/parachain-inherent/src/client_side.rs b/cumulus/primitives/parachain-inherent/src/client_side.rs index 1d936239104d06fa0c62756ea01125ce287ed360..52987d2da44ceee275b88a441f5a64951cf245f2 100644 --- a/cumulus/primitives/parachain-inherent/src/client_side.rs +++ b/cumulus/primitives/parachain-inherent/src/client_side.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/primitives/parachain-inherent/src/lib.rs b/cumulus/primitives/parachain-inherent/src/lib.rs index 34b9064090c2d0ba4b227421eefb8e8058d5104b..08407023bb4604933ff4de97a6669e45b85d6bc5 100644 --- a/cumulus/primitives/parachain-inherent/src/lib.rs +++ b/cumulus/primitives/parachain-inherent/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/primitives/parachain-inherent/src/mock.rs b/cumulus/primitives/parachain-inherent/src/mock.rs index 18e23ba23af09c29b709ac3079429c80edd07497..5168b46a14d03def1ccfe72c9244e71bfb202d84 100644 --- a/cumulus/primitives/parachain-inherent/src/mock.rs +++ b/cumulus/primitives/parachain-inherent/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/primitives/timestamp/src/lib.rs b/cumulus/primitives/timestamp/src/lib.rs index c8030fb09c4d5acfb319bb5ceecf9745578cafc9..535c4a2a7268b9df053021d824fd0fbb0599845b 100644 --- a/cumulus/primitives/timestamp/src/lib.rs +++ b/cumulus/primitives/timestamp/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/primitives/utility/Cargo.toml b/cumulus/primitives/utility/Cargo.toml index 27f3996b885e06b0d497f480a49c3b2354827baf..47c5442574fb6aea3a52b0ac9a11c9c6aff20fa4 100644 --- a/cumulus/primitives/utility/Cargo.toml +++ b/cumulus/primitives/utility/Cargo.toml @@ -16,9 +16,9 @@ sp-std = { path = "../../../substrate/primitives/std", default-features = false} # Polkadot polkadot-runtime-common = { path = "../../../polkadot/runtime/common", default-features = false} -xcm = { path = "../../../polkadot/xcm", default-features = false} -xcm-executor = { path = "../../../polkadot/xcm/xcm-executor", default-features = false} -xcm-builder = { path = "../../../polkadot/xcm/xcm-builder", default-features = false} +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false} +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor", default-features = false} +xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder", default-features = false} # Cumulus diff --git a/cumulus/primitives/utility/src/lib.rs b/cumulus/primitives/utility/src/lib.rs index 87be029163d668afdb17f713d9e7517faa63b2d6..7d07bc329ed4cc0fdfcb08ec5281e1c7f3f378d2 100644 --- a/cumulus/primitives/utility/src/lib.rs +++ b/cumulus/primitives/utility/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify @@ -315,11 +315,11 @@ mod tests { use cumulus_primitives_core::UpwardMessage; use frame_support::{ assert_ok, - dispatch::DispatchError, traits::tokens::{ DepositConsequence, Fortitude, Preservation, Provenance, WithdrawConsequence, }, }; + use sp_runtime::DispatchError; use xcm_executor::{traits::Error, Assets}; /// Validates [`validate`] for required Some(destination) and Some(message) diff --git a/cumulus/scripts/ci/changelog/.gitignore b/cumulus/scripts/ci/changelog/.gitignore deleted file mode 100644 index 4fbcc523b04cf0aba6c866a38250a83c16deb8d8..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -changelog.md -*.json -release*.md -.env diff --git a/cumulus/scripts/ci/changelog/Gemfile b/cumulus/scripts/ci/changelog/Gemfile deleted file mode 100644 index 46b058e3c5004c85f4ef79b867d2a6638a7e8cd4..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/Gemfile +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -gem 'octokit', '~> 4' - -gem 'git_diff_parser', '~> 3' - -gem 'toml', '~> 0.3.0' - -gem 'rake', group: :dev - -gem 'optparse', '~> 0.1.1' - -gem 'logger', '~> 1.4' - -gem 'changelogerator', '0.10.1' - -gem 'test-unit', group: :dev - -gem 'rubocop', group: :dev, require: false diff --git a/cumulus/scripts/ci/changelog/Gemfile.lock b/cumulus/scripts/ci/changelog/Gemfile.lock deleted file mode 100644 index 893bec54919513e84cdda9313ea4f02edb4b51bf..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/Gemfile.lock +++ /dev/null @@ -1,84 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - ast (2.4.2) - changelogerator (0.10.1) - git_diff_parser (~> 3) - octokit (~> 4) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - git_diff_parser (3.2.0) - logger (1.4.4) - multipart-post (2.1.1) - octokit (4.21.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - optparse (0.1.1) - parallel (1.21.0) - parser (3.0.2.0) - ast (~> 2.4.1) - parslet (2.0.0) - power_assert (2.0.1) - public_suffix (4.0.6) - rainbow (3.0.0) - rake (13.0.6) - regexp_parser (2.1.1) - rexml (3.2.5) - rubocop (1.23.0) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.13.0) - parser (>= 3.0.1.1) - ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - test-unit (3.5.1) - power_assert - toml (0.3.0) - parslet (>= 1.8.0, < 3.0.0) - unicode-display_width (2.1.0) - -PLATFORMS - x86_64-darwin-20 - x86_64-darwin-22 - -DEPENDENCIES - changelogerator (= 0.10.1) - git_diff_parser (~> 3) - logger (~> 1.4) - octokit (~> 4) - optparse (~> 0.1.1) - rake - rubocop - test-unit - toml (~> 0.3.0) - -BUNDLED WITH - 2.2.22 diff --git a/cumulus/scripts/ci/changelog/README.md b/cumulus/scripts/ci/changelog/README.md deleted file mode 100644 index 478e0b56d9ca317895b2430afdb8e19fbff87ebe..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Changelog - -Currently, the changelog is built locally. It will be moved to CI once labels stabilize. - -For now, a bit of preparation is required before you can run the script: -- fetch the srtool digests -- store them under the `digests` folder as `-srtool-digest.json` -- ensure the `.env` file is up to date with correct information - -The content of the release notes is generated from the template files under the `scripts/ci/changelog/templates` folder. For readability and maintenance, the template is split into several small snippets. - -Run: -``` -./bin/changelog [=HEAD] -``` - -For instance: -``` -./bin/changelog parachains-v7.0.0-rc8 -``` - -A file called `release-notes.md` will be generated and can be used for the release. - -## ENV - -You may use the following ENV for testing: - -``` -RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" -RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" -PRE_RELEASE=true -HIDE_SRTOOL_ROCOCO=true -HIDE_SRTOOL_SHELL=true -REF1=statemine-v5.0.0 -REF2=HEAD -DEBUG=1 -NO_CACHE=1 -``` - -By default, the template will include all the information, including the runtime data. -For clients releases, we don't need those and they can be skipped by setting the following env: -``` -RELEASE_TYPE=client -``` - -## Considered labels - -The following list will likely evolve over time and it will be hard to keep it in sync. -In any case, if you want to find all the labels that are used, search for `meta` in the templates. -Currently, the considered labels are: - -- Priority: C labels -- Audit: D labels -- E4 => new host function -- B0 => silent, not showing up -- B1-releasenotes (misc unless other labels) -- B5-client (client changes) -- B7-runtimenoteworthy (runtime changes) -- T6-XCM - -Note that labels with the same letter are mutually exclusive. -A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will -decide which label will be considered. - -## Dev and debuggin - -### Hot Reload - -The following command allows **Hot Reload**: -``` -fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./bin/changelog statemine-v5.0.0 -``` -### Caching - -By default, if the changelog data from Github is already present, the calls to the Github API will be skipped -and the local version of the data will be used. This is much faster. -If you know that some labels have changed in Github, you probably want to refresh the data. -You can then either delete manually the `cumulus.json` file or `export NO_CACHE=1` to force refreshing the data. diff --git a/cumulus/scripts/ci/changelog/bin/changelog b/cumulus/scripts/ci/changelog/bin/changelog deleted file mode 100755 index 6cd012a29edb791334a80b4cc830d6757c4416b6..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/bin/changelog +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env ruby - -# frozen_string_literal: true - -# call for instance as: -# ./bin/changelog statemine-v5.0.0 -# -# You may set the ENV NO_CACHE to force fetching from Github -# You should also ensure you set the ENV: GITHUB_TOKEN - -require_relative '../lib/changelog' -require 'logger' - -logger = Logger.new($stdout) -logger.level = Logger::DEBUG -logger.debug('Starting') - -changelogerator_version = `changelogerator --version` -logger.debug(changelogerator_version) - -owner = 'paritytech' -repo = 'cumulus' -ref1 = ARGV[0] -ref2 = ARGV[1] || 'HEAD' -output = ARGV[2] || 'release-notes.md' - -ENV['REF1'] = ref1 -ENV['REF2'] = ref2 - -gh_cumulus = SubRef.new(format('%s/%s', { owner: owner, repo: repo })) - -polkadot_ref1 = gh_cumulus.get_dependency_reference(ref1, 'polkadot-primitives') -polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-primitives') - -substrate_ref1 = gh_cumulus.get_dependency_reference(ref1, 'sp-io') -substrate_ref2 = gh_cumulus.get_dependency_reference(ref2, 'sp-io') - -logger.debug("Cumulus from: #{ref1}") -logger.debug("Cumulus to: #{ref2}") - -logger.debug("Polkadot from: #{polkadot_ref1}") -logger.debug("Polkadot to: #{polkadot_ref2}") - -logger.debug("Substrate from: #{substrate_ref1}") -logger.debug("Substrate to: #{substrate_ref2}") - -cumulus_data = 'cumulus.json' -substrate_data = 'substrate.json' -polkadot_data = 'polkadot.json' - -logger.debug("Using CUMULUS: #{cumulus_data}") -logger.debug("Using SUBSTRATE: #{substrate_data}") -logger.debug("Using POLKADOT: #{polkadot_data}") - -logger.warn('NO_CACHE set') if ENV['NO_CACHE'] - -# This is acting as cache so we don't spend time querying while testing -if ENV['NO_CACHE'] || !File.file?(cumulus_data) - logger.debug(format('Fetching data for Cumulus into %s', cumulus_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', - { owner: owner, repo: repo, from: ref1, to: ref2, output: cumulus_data }) - system(cmd) -else - logger.debug("Re-using:#{cumulus_data}") -end - -if ENV['NO_CACHE'] || !File.file?(polkadot_data) - logger.debug(format('Fetching data for Polkadot into %s', polkadot_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', - { owner: owner, repo: 'polkadot', from: polkadot_ref1, to: polkadot_ref2, output: polkadot_data }) - system(cmd) -else - logger.debug("Re-using:#{polkadot_data}") -end - -if ENV['NO_CACHE'] || !File.file?(substrate_data) - logger.debug(format('Fetching data for Substrate into %s', substrate_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', - { owner: owner, repo: 'substrate', from: substrate_ref1, to: substrate_ref2, output: substrate_data }) - system(cmd) -else - logger.debug("Re-using:#{substrate_data}") -end - -POLKADOT_COLLECTIVES_DIGEST = ENV['COLLECTIVES_POLKADOT_DIGEST'] || 'digests/collectives-polkadot-srtool-digest.json' -SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json' -ASSET_HUB_WESTEND_DIGEST = ENV['ASSET_HUB_WESTEND_DIGEST'] || 'digests/asset-hub-westend-srtool-digest.json' -ASSET_HUB_KUSAMA_DIGEST = ENV['ASSET_HUB_KUSAMA_DIGEST'] || 'digests/asset-hub-kusama-srtool-digest.json' -ASSET_HUB_POLKADOT_DIGEST = ENV['ASSET_HUB_POLKADOT_DIGEST'] || 'digests/asset-hub-westend-srtool-digest.json' -BRIDGE_HUB_ROCOCO_DIGEST = ENV['BRIDGE_HUB_ROCOCO_DIGEST'] || 'digests/bridge-hub-rococo-srtool-digest.json' -BRIDGE_HUB_KUSAMA_DIGEST = ENV['BRIDGE_HUB_KUSAMA_DIGEST'] || 'digests/bridge-hub-kusama-srtool-digest.json' -BRIDGE_HUB_POLKADOT_DIGEST = ENV['BRIDGE_HUB_POLKADOT_DIGEST'] || 'digests/bridge-hub-polkadot-srtool-digest.json' -ROCOCO_PARA_DIGEST = ENV['ROCOCO_PARA_DIGEST'] || 'digests/rococo-parachain-srtool-digest.json' -CANVAS_KUSAMA_DIGEST = ENV['CANVAS_KUSAMA_DIGEST'] || 'digests/contracts-rococo-srtool-digest.json' - -logger.debug("Release type: #{ENV['RELEASE_TYPE']}") - -if ENV['RELEASE_TYPE'] && ENV['RELEASE_TYPE'] == 'client' - logger.debug('Building changelog without runtimes') - cmd = format('jq \ - --slurpfile cumulus %s \ - --slurpfile substrate %s \ - --slurpfile polkadot %s \ - -n \'{ - cumulus: $cumulus[0], - substrate: $substrate[0], - polkadot: $polkadot[0], - }\' > context.json', cumulus_data, substrate_data, polkadot_data, - ) -else - logger.debug('Building changelog with runtimes') - - # Here we compose all the pieces together into one - # single big json file. - cmd = format('jq \ - --slurpfile cumulus %s \ - --slurpfile substrate %s \ - --slurpfile polkadot %s \ - --slurpfile srtool_shell %s \ - --slurpfile srtool_westmint %s \ - --slurpfile srtool_statemine %s \ - --slurpfile srtool_statemint %s \ - --slurpfile srtool_rococo_parachain %s \ - --slurpfile srtool_contracts_rococo %s \ - --slurpfile srtool_polkadot_collectives %s \ - --slurpfile srtool_bridge_hub_rococo %s \ - --slurpfile srtool_bridge_hub_kusama %s \ - --slurpfile srtool_bridge_hub_polkadot %s \ - -n \'{ - cumulus: $cumulus[0], - substrate: $substrate[0], - polkadot: $polkadot[0], - srtool: [ - { order: 10, name: "asset-hub-polkadot", note: " (Former Statemint)", data: $srtool_statemint[0] }, - { order: 11, name: "bridge-hub-polkadot", data: $srtool_bridge_hub_polkadot[0] }, - { order: 20, name: "asset-hub-kusama", note: " (Former Statemine)", data: $srtool_statemine[0] }, - { order: 21, name: "bridge-hub-kusama", data: $srtool_bridge_hub_kusama[0] }, - { order: 30, name: "asset-hub-westend", note: " (Former Westmint)", data: $srtool_westmint[0] }, - { order: 40, name: "rococo", data: $srtool_rococo_parachain[0] }, - { order: 41, name: "bridge-hub-rococo", data: $srtool_bridge_hub_rococo[0] }, - { order: 50, name: "polkadot-collectives", data: $srtool_polkadot_collectives[0] }, - { order: 60, name: "contracts", data: $srtool_contracts_rococo[0] }, - { order: 90, name: "shell", data: $srtool_shell[0] } - ] }\' > context.json', - cumulus_data, - substrate_data, - polkadot_data, - SHELL_DIGEST, - ASSET_HUB_WESTEND_DIGEST, - ASSET_HUB_KUSAMA_DIGEST, - ASSET_HUB_POLKADOT_DIGEST, - ROCOCO_PARA_DIGEST, - CANVAS_KUSAMA_DIGEST, - POLKADOT_COLLECTIVES_DIGEST, - BRIDGE_HUB_ROCOCO_DIGEST, - BRIDGE_HUB_KUSAMA_DIGEST, - BRIDGE_HUB_POLKADOT_DIGEST - ) -end -system(cmd) - -cmd = format('tera --env --env-key env --include-path templates \ - --template templates/template.md.tera context.json > %s', output) -system(cmd) diff --git a/cumulus/scripts/ci/changelog/digests/.gitignore b/cumulus/scripts/ci/changelog/digests/.gitignore deleted file mode 100644 index a6c57f5fb2ffba0a6af4278619c2983394d237cc..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/digests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.json diff --git a/cumulus/scripts/ci/changelog/digests/.gitkeep b/cumulus/scripts/ci/changelog/digests/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/cumulus/scripts/ci/changelog/lib/changelog.rb b/cumulus/scripts/ci/changelog/lib/changelog.rb deleted file mode 100644 index 2d9ee29a8c89e3397b7ad8eeeee17e2e61ec4dd8..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/lib/changelog.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# A Class to find Substrate references -class SubRef - require 'octokit' - require 'toml' - - attr_reader :client, :repository - - def initialize(github_repo) - @client = Octokit::Client.new( - access_token: ENV['GITHUB_TOKEN'] - ) - @repository = @client.repository(github_repo) - end - - # This function checks the Cargo.lock of a given - # Rust project, for a given package, and fetches - # the dependency git ref. - def get_dependency_reference(ref, package) - cargo = TOML::Parser.new( - Base64.decode64( - @client.contents( - @repository.full_name, - path: 'Cargo.lock', - query: { ref: ref.to_s } - ).content - ) - ).parsed - cargo['package'].find { |p| p['name'] == package }['source'].split('#').last - end -end diff --git a/cumulus/scripts/ci/changelog/templates/change.md.tera b/cumulus/scripts/ci/changelog/templates/change.md.tera deleted file mode 100644 index 609a038789ac79a37be2413da24b2f22ef72d95d..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/change.md.tera +++ /dev/null @@ -1,44 +0,0 @@ -{# This macro shows ONE change #} -{%- macro change(c, cml="[C]", dot="[P]", sub="[S]") -%} - -{%- if c.meta.C and c.meta.C.agg.max >= 5 -%} -{%- set prio = " ‼️ HIGH" -%} -{%- elif c.meta.C and c.meta.C.agg.max >= 3 -%} -{%- set prio = " ❗️ Medium" -%} -{%- elif c.meta.C and c.meta.C.agg.max < 3 -%} -{%- set prio = " Low" -%} -{%- else -%} -{%- set prio = "" -%} -{%- endif -%} - -{%- set audit = "" -%} -{# -{%- if c.meta.D and c.meta.D.D1 -%} -{%- set audit = "✅ audited " -%} -{%- elif c.meta.D and c.meta.D.D2 -%} -{%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.D3 -%} -{%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.D5 -%} -{%- set audit = "⏳ pending non-critical audit " -%} -{%- else -%} -{%- set audit = "" -%} -{%- endif -%} -#} -{%- if c.html_url is containing("polkadot") -%} -{%- set repo = dot -%} -{%- elif c.html_url is containing("cumulus") -%} -{%- set repo = cml -%} -{%- elif c.html_url is containing("substrate") -%} -{%- set repo = sub -%} -{%- else -%} -{%- set repo = " " -%} -{%- endif -%} -{# #} -{%- if c.meta.T and c.meta.T.T6 -%} -{%- set xcm = " [✉️ XCM]" -%} -{%- else -%} -{%- set xcm = "" -%} -{%- endif -%} -{{- repo }} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} -{%- endmacro change %} diff --git a/cumulus/scripts/ci/changelog/templates/changes.md.tera b/cumulus/scripts/ci/changelog/templates/changes.md.tera deleted file mode 100644 index f1704546b0a7e62b0cb155900d22fb992245784c..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/changes.md.tera +++ /dev/null @@ -1,21 +0,0 @@ -{# This include generates the section showing the changes #} -## Changes - -### Legend - -- {{ CML }} Cumulus -- {{ DOT }} Polkadot -- {{ SUB }} Substrate - -{% if env.RELEASE_TYPE and env.RELEASE_TYPE == "client" %} -{% include "changes_client.md.tera" %} -{% else %} -{% include "migrations-runtime.md.tera" -%} - -{% include "changes_runtime.md.tera" %} - -{% endif %} - -{% include "changes_api.md.tera" %} - -{% include "changes_misc.md.tera" %} diff --git a/cumulus/scripts/ci/changelog/templates/changes_api.md.tera b/cumulus/scripts/ci/changelog/templates/changes_api.md.tera deleted file mode 100644 index 2379c178c0314f6af4f529c94a9823c1fc8c8eab..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/changes_api.md.tera +++ /dev/null @@ -1,19 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -### API - -{#- The changes are sorted by merge date -#} -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B -%} -{%- if pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - -{%- if pr.meta.B.B1 and pr.meta.T.T2 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} -{%- endif -%} -{%- endif -%} - -{%- endif -%} -{%- endfor %} diff --git a/cumulus/scripts/ci/changelog/templates/changes_client.md.tera b/cumulus/scripts/ci/changelog/templates/changes_client.md.tera deleted file mode 100644 index 05a521d6870b62d6a75ef2cd6b48d11d471fd8f0..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/changes_client.md.tera +++ /dev/null @@ -1,17 +0,0 @@ -{% import "change.md.tera" as m_c -%} -### Client - -{#- The changes are sorted by merge date #} -{%- for pr in changes | sort(attribute="merged_at") %} - -{%- if pr.meta.B %} - {%- if pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- else -%} - - {%- if pr.meta.B.B1 and pr.meta.T and pr.meta.T.T0 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} diff --git a/cumulus/scripts/ci/changelog/templates/changes_misc.md.tera b/cumulus/scripts/ci/changelog/templates/changes_misc.md.tera deleted file mode 100644 index b36595bc5d6adbef33271d229e879264ea0d5a2c..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/changes_misc.md.tera +++ /dev/null @@ -1,39 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{%- set_global misc_count = 0 -%} -{#- First pass to count #} -{%- for pr in changes -%} - {%- if pr.meta.B %} - {%- if pr.meta.B.B0 -%} - {#- We skip silent ones -#} - {%- else -%} - {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} -{%- set_global misc_count = misc_count + 1 -%} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} - -### Misc - -{% if misc_count > 10 %} -There are other misc. changes. You can expand the list below to view them all. -
Other misc. changes -{% endif -%} - -{#- The changes are sorted by merge date #} -{%- for pr in changes | sort(attribute="merged_at") %} - {%- if pr.meta.B and not pr.title is containing("ompanion") %} - {%- if pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- else -%} - {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} - -{% if misc_count > 10 %} -
-{% endif -%} diff --git a/cumulus/scripts/ci/changelog/templates/changes_runtime.md.tera b/cumulus/scripts/ci/changelog/templates/changes_runtime.md.tera deleted file mode 100644 index 39c27263765532e5f636df60b64abf197b954ad8..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/changes_runtime.md.tera +++ /dev/null @@ -1,19 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -### Runtime - -{#- The changes are sorted by merge date -#} -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B -%} -{%- if pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - -{%- if pr.meta.B.B1 and pr.meta.T.T1 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} -{%- endif -%} -{%- endif -%} - -{%- endif -%} -{%- endfor %} diff --git a/cumulus/scripts/ci/changelog/templates/compiler.md.tera b/cumulus/scripts/ci/changelog/templates/compiler.md.tera deleted file mode 100644 index 0420a88c396536a6555938f7abb02992038b9873..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/compiler.md.tera +++ /dev/null @@ -1,6 +0,0 @@ -## Rust compiler versions - -This release was tested against the following versions of `rustc`. Other versions may work. - -- Rust Stable: `{{ env.RUSTC_STABLE }}` -- Rust Nightly: `{{ env.RUSTC_NIGHTLY }}` diff --git a/cumulus/scripts/ci/changelog/templates/debug.md.tera b/cumulus/scripts/ci/changelog/templates/debug.md.tera deleted file mode 100644 index 4f0b14c00f120f0fe367c42631bbce0667d0f060..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/debug.md.tera +++ /dev/null @@ -1,9 +0,0 @@ -{%- set to_ignore = changes | filter(attribute="meta.B.B0") %} - diff --git a/cumulus/scripts/ci/changelog/templates/docker_image.md.tera b/cumulus/scripts/ci/changelog/templates/docker_image.md.tera deleted file mode 100644 index cb0c619f3a708e8c120f664bbea5990ae7a8b80c..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/docker_image.md.tera +++ /dev/null @@ -1,11 +0,0 @@ - -## Docker images - -The docker image for this release can be found in [Docker hub](https://hub.docker.com/r/parity/polkadot-parachain/tags?page=1&ordering=last_updated). -(It will be available a few minutes after the release has been published). - -You may also pull it with: - -``` -docker pull parity/polkadot-parachain:latest -``` diff --git a/cumulus/scripts/ci/changelog/templates/global_priority.md.tera b/cumulus/scripts/ci/changelog/templates/global_priority.md.tera deleted file mode 100644 index 3d8a507ed1fe196878ccad168ec46d479f74389c..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/global_priority.md.tera +++ /dev/null @@ -1,35 +0,0 @@ -{%- import "high_priority.md.tera" as m_p -%} -## Global Priority - -{%- set cumulus_prio = 0 -%} -{%- set polkadot_prio = 0 -%} -{%- set substrate_prio = 0 -%} - -{# We fetch the various priorities #} -{%- if cumulus.meta.C -%} - {%- set cumulus_prio = cumulus.meta.C.max -%} -{%- endif -%} -{%- if polkadot.meta.C -%} - {%- set polkadot_prio = polkadot.meta.C.max -%} -{%- endif -%} -{%- if substrate.meta.C -%} - {%- set substrate_prio = substrate.meta.C.max -%} -{%- endif -%} - -{# We compute the global priority #} -{%- set global_prio = cumulus_prio -%} -{%- if polkadot_prio > global_prio -%} - {% set global_prio = polkadot_prio -%} -{%- endif -%} -{%- if substrate_prio > global_prio -%} - {%- set global_prio = substrate_prio -%} -{%- endif %} - - - -{# We show the result #} -{{ m_p::high_priority(p=global_prio, changes=changes) }} diff --git a/cumulus/scripts/ci/changelog/templates/high_priority.md.tera b/cumulus/scripts/ci/changelog/templates/high_priority.md.tera deleted file mode 100644 index 21e331892b8f12e9474a18a3114030d948cd24fb..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/high_priority.md.tera +++ /dev/null @@ -1,56 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{# This macro convert a priority level into readable output #} -{%- macro high_priority(p, changes) -%} - -{# real globals don't work so we count the number of host functions here as well #} -{# unfortunately, the next snippet is duplicated in the host_functions.md.tera template #} -{# as well #} -{%- set_global host_fn_count = 0 -%} - -{# We loop first to count the number of host functions but we do not display anything yet #} -{%- for pr in changes -%} -{%- if pr.meta.B and pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - {%- if pr.meta.E and pr.meta.E.E4 -%} - {%- set_global host_fn_count = host_fn_count + 1 -%} - {%- endif -%} -{%- endif -%} -{%- endfor -%} - -{%- if p >= 5 or host_fn_count > 0 -%} - {%- set prio = "‼️ HIGH" -%} - {%- set text = "This is a **high priority** release and you must upgrade as as soon as possible." -%} -{%- elif p >= 3 -%} - {%- set prio = "❗️ Medium" -%} - {%- set text = "This is a medium priority release and you should upgrade in a timely manner." -%} -{%- else -%} - {%- set prio = "Low" -%} - {%- set text = "This is a low priority release and you may upgrade at your convenience." -%} -{%- endif -%} - - -{% if prio -%} -{{prio}}: {{text}} -{%- else -%} - -{%- endif %} - -{# We only show details if Medium or High #} -{%- if p >= 5 -%} -The changes motivating this priority level are: -{% for pr in changes | sort(attribute="merged_at") -%} - {%- if pr.meta.C -%} - {%- if pr.meta.C.agg.max >= p %} -- {{ m_c::change(c=pr) }} -{%- if pr.meta.B and pr.meta.B.B1 and pr.meta.T and pr.meta.T.T1 %} -(RUNTIME) -{% endif %} - - {%- endif -%} - {%- endif -%} -{%- endfor %} -{%- endif %} - -{%- endmacro priority -%} diff --git a/cumulus/scripts/ci/changelog/templates/host_functions.md.tera b/cumulus/scripts/ci/changelog/templates/host_functions.md.tera deleted file mode 100644 index 2a9b26e8090c0574b1c2655587707c1b09ee9fbe..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/host_functions.md.tera +++ /dev/null @@ -1,38 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{%- set_global host_fn_count = 0 -%} - -{# We loop first to count the number of host functions but we do not display anything yet #} -{%- for pr in changes -%} -{%- if pr.meta.B and pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - {%- if pr.meta.E and pr.meta.E.E4 -%} - {%- set_global host_fn_count = host_fn_count + 1 -%} - {% endif -%} -{%- endif -%} -{%- endfor -%} - - - -{% if host_fn_count == 0 -%} - -{%- else -%} -## Host functions - -⚠️ The runtimes in this release contain {{ host_fn_count }} new **host function{{ host_fn_count | pluralize }}**. - -⚠️ It is critical that you update your client before the chain switches to the new runtimes. - -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - {%- if pr.meta.E and pr.meta.E.E4 -%} - - {{ m_c::change(c=pr) }} - {% endif -%} - {% endif -%} -{%- endfor -%} - -{%- endif %} diff --git a/cumulus/scripts/ci/changelog/templates/migrations-db.md.tera b/cumulus/scripts/ci/changelog/templates/migrations-db.md.tera deleted file mode 100644 index e840d991d9a81303d2921275db657ecbc7079e4e..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/migrations-db.md.tera +++ /dev/null @@ -1,26 +0,0 @@ -{%- import "change.md.tera" as m_c %} -{%- set_global db_migration_count = 0 -%} - -## Database Migrations - -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 %} -{#- We skip silent ones -#} -{%- else -%} -{%- if pr.meta.E and pr.meta.E.E2 -%} -{%- set_global db_migration_count = db_migration_count + 1 -%} -- {{ m_c::change(c=pr) }} -{% endif -%} -{% endif -%} -{% endfor -%} - -{%- if db_migration_count == 0 -%} -No Database migration detected in this release. -{% else %} - -There is {{ db_migration_count }} database migration(s) in this release. - -Database migrations are operations bringing your database to the latest stand. -Some migrations may break compatibility and making a backup of your database is highly recommended. -{%- endif %} diff --git a/cumulus/scripts/ci/changelog/templates/migrations-runtime.md.tera b/cumulus/scripts/ci/changelog/templates/migrations-runtime.md.tera deleted file mode 100644 index f02499a84d747dbe45f162c785239d947fa40a19..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/migrations-runtime.md.tera +++ /dev/null @@ -1,14 +0,0 @@ -{%- import "change.md.tera" as m_c %} - -## Runtime Migrations - -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 %} -{#- We skip silent ones -#} -{%- else -%} -{%- if pr.meta.E and pr.meta.E.E1 -%} -- {{ m_c::change(c=pr) }} -{% endif -%} -{% endif -%} -{% endfor -%} diff --git a/cumulus/scripts/ci/changelog/templates/pre_release.md.tera b/cumulus/scripts/ci/changelog/templates/pre_release.md.tera deleted file mode 100644 index 53a0e906541274735d50e9ef8df33e25aab97549..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/pre_release.md.tera +++ /dev/null @@ -1,11 +0,0 @@ -{%- if env.PRE_RELEASE == "true" -%} -
⚠️ This is a pre-release - -**Release candidates** are **pre-releases** may not be final. -Although they are reasonably tested, there may be additional changes or issues -before an official release is tagged. Use at your own discretion, and consider -only using published releases on critical production infrastructure. -
-{% else -%} - -{%- endif %} diff --git a/cumulus/scripts/ci/changelog/templates/runtime.md.tera b/cumulus/scripts/ci/changelog/templates/runtime.md.tera deleted file mode 100644 index d2070245838550d82fbbcc5f1adac5e7b930da7e..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/runtime.md.tera +++ /dev/null @@ -1,28 +0,0 @@ -{# This macro shows one runtime #} -{%- macro runtime(runtime) -%} - -### {{ runtime.name | replace(from="-", to=" ") | title }} {%- if runtime.note -%} {{ runtime.note }} {%- endif -%} - -{%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} -{%- set compressed = "Yes" %} -{%- else %} -{%- set compressed = "No" %} -{%- endif %} - -{%- set comp_ratio = 100 - (runtime.data.runtimes.compressed.subwasm.compression.size_compressed / runtime.data.runtimes.compressed.subwasm.compression.size_decompressed *100) %} - - - - - - - -``` -🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) -🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version.specName }}-{{ runtime.data.runtimes.compressed.subwasm.core_version.specVersion }} ({{ runtime.data.runtimes.compressed.subwasm.core_version.implName }}-{{ runtime.data.runtimes.compressed.subwasm.core_version.implVersion }}.tx{{ runtime.data.runtimes.compressed.subwasm.core_version.transactionVersion }}.au{{ runtime.data.runtimes.compressed.subwasm.core_version.authoringVersion }}) -🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% -🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} -🗳️ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} -📦 IPFS: {{ runtime.data.runtimes.compressed.subwasm.ipfs_hash }} -``` -{%- endmacro runtime %} diff --git a/cumulus/scripts/ci/changelog/templates/runtimes.md.tera b/cumulus/scripts/ci/changelog/templates/runtimes.md.tera deleted file mode 100644 index fe2e16aa9c2816352e773ce727bf1666ec476771..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/runtimes.md.tera +++ /dev/null @@ -1,17 +0,0 @@ -{# This include shows the list and details of the runtimes #} -{%- import "runtime.md.tera" as m_r -%} - -## Runtimes - -{% set rtm = srtool[0] -%} - -The information about the runtimes included in this release can be found below. -The runtimes have been built using [{{ rtm.data.gen }}](https://github.com/paritytech/srtool) and `{{ rtm.data.rustc }}`. - -{%- for runtime in srtool | sort(attribute="order") %} -{%- set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} -{%- if not env is containing(HIDE_VAR) %} - -{{ m_r::runtime(runtime=runtime) }} -{%- endif %} -{%- endfor %} diff --git a/cumulus/scripts/ci/changelog/templates/template.md.tera b/cumulus/scripts/ci/changelog/templates/template.md.tera deleted file mode 100644 index 8b14db43fe281be263d2313833241b175eb948cf..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/templates/template.md.tera +++ /dev/null @@ -1,38 +0,0 @@ -{# This is the entry point of the template for the parachains-* releases-#} - -{% include "pre_release.md.tera" -%} - -{% if env.PRE_RELEASE == "true" -%} -This pre-release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`. -{% else -%} -This release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`. -{% endif -%} - -{%- set changes = cumulus.changes | concat(with=substrate.changes) -%} -{%- set changes = changes | concat(with=polkadot.changes) -%} -{%- include "debug.md.tera" -%} - -{%- set CML = "[C]" -%} -{%- set DOT = "[P]" -%} -{%- set SUB = "[S]" -%} - -{# We check for host function first because no matter what the priority is, #} -{# we will force it to HIGH if at least one host function was detected. #} - -{% include "host_functions.md.tera" -%} - -{% if env.RELEASE_TYPE and env.RELEASE_TYPE == "client" -%} -{% include "global_priority.md.tera" -%} -{% include "compiler.md.tera" -%} -{% include "migrations-db.md.tera" %} - -{% else %} -{% include "migrations-runtime.md.tera" %} -{% include "runtimes.md.tera" -%} -{% endif %} - -{% include "changes.md.tera" -%} - -{% if env.RELEASE_TYPE and env.RELEASE_TYPE == "client" -%} -{% include "docker_image.md.tera" -%} -{% endif %} diff --git a/cumulus/scripts/ci/changelog/test/test_basic.rb b/cumulus/scripts/ci/changelog/test/test_basic.rb deleted file mode 100755 index d099fadca43328d034cf753046274414b141888b..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/changelog/test/test_basic.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require_relative '../lib/changelog' -require 'test/unit' - -class TestChangelog < Test::Unit::TestCase - def test_get_dep_ref_polkadot - c = SubRef.new('paritytech/polkadot') - ref = '13c2695' - package = 'sc-cli' - result = c.get_dependency_reference(ref, package) - assert_equal('7db0768a85dc36a3f2a44d042b32f3715c00a90d', result) - end - - def test_get_dep_ref_invalid_ref - c = SubRef.new('paritytech/polkadot') - ref = '9999999' - package = 'sc-cli' - assert_raise do - c.get_dependency_reference(ref, package) - end - end -end diff --git a/cumulus/scripts/ci/common/lib.sh b/cumulus/scripts/ci/common/lib.sh deleted file mode 100644 index 93e0392b3e29d6ef7bfff49558e0de6383aacbbe..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/common/lib.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh - -api_base="https://api.github.com/repos" - -# Function to take 2 git tags/commits and get any lines from commit messages -# that contain something that looks like a PR reference: e.g., (#1234) -sanitised_git_logs(){ - git --no-pager log --pretty=format:"%s" "$1...$2" | - # Only find messages referencing a PR - grep -E '\(#[0-9]+\)' | - # Strip any asterisks - sed 's/^* //g' -} - -# Checks whether a tag on github has been verified -# repo: 'organization/repo' -# tagver: 'v1.2.3' -# Usage: check_tag $repo $tagver -check_tag () { - repo=$1 - tagver=$2 - if [ -n "$GITHUB_RELEASE_TOKEN" ]; then - echo '[+] Fetching tag using privileged token' - tag_out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") - else - echo '[+] Fetching tag using unprivileged token' - tag_out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") - fi - tag_sha=$(echo "$tag_out" | jq -r .object.sha) - object_url=$(echo "$tag_out" | jq -r .object.url) - if [ "$tag_sha" = "null" ]; then - return 2 - fi - echo "[+] Tag object SHA: $tag_sha" - verified_str=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$object_url" | jq -r .verification.verified) - if [ "$verified_str" = "true" ]; then - # Verified, everything is good - return 0 - else - # Not verified. Bad juju. - return 1 - fi -} - -# Checks whether a given PR has a given label. -# repo: 'organization/repo' -# pr_id: 12345 -# label: B1-silent -# Usage: has_label $repo $pr_id $label -has_label(){ - repo="$1" - pr_id="$2" - label="$3" - - # These will exist if the function is called in Gitlab. - # If the function's called in Github, we should have GITHUB_ACCESS_TOKEN set - # already. - if [ -n "$GITHUB_RELEASE_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_RELEASE_TOKEN" - elif [ -n "$GITHUB_PR_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_PR_TOKEN" - fi - - out=$(curl -H "Authorization: token $GITHUB_TOKEN" -s "$api_base/$repo/pulls/$pr_id") - [ -n "$(echo "$out" | tr -d '\r\n' | jq ".labels | .[] | select(.name==\"$label\")")" ] -} - -github_label () { - echo - echo "# run github-api job for labeling it ${1}" - curl -sS -X POST \ - -F "token=${CI_JOB_TOKEN}" \ - -F "ref=master" \ - -F "variables[LABEL]=${1}" \ - -F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \ - -F "variables[PROJECT]=paritytech/polkadot" \ - "${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline" -} - -# Formats a message into a JSON string for posting to Matrix -# message: 'any plaintext message' -# formatted_message: 'optional message formatted in html' -# Usage: structure_message $content $formatted_content (optional) -structure_message() { - if [ -z "$2" ]; then - body=$(jq -Rs --arg body "$1" '{"msgtype": "m.text", $body}' < /dev/null) - else - body=$(jq -Rs --arg body "$1" --arg formatted_body "$2" '{"msgtype": "m.text", $body, "format": "org.matrix.custom.html", $formatted_body}' < /dev/null) - fi - echo "$body" -} - -# Post a message to a matrix room -# body: '{body: "JSON string produced by structure_message"}' -# room_id: !fsfSRjgjBWEWffws:matrix.parity.io -# access_token: see https://matrix.org/docs/guides/client-server-api/ -# Usage: send_message $body (json formatted) $room_id $access_token -send_message() { -curl -XPOST -d "$1" "https://matrix.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3" -} - -# Pretty-printing functions -boldprint () { printf "|\n| \033[1m%s\033[0m\n|\n" "${@}"; } -boldcat () { printf "|\n"; while read -r l; do printf "| \033[1m%s\033[0m\n" "${l}"; done; printf "|\n" ; } - -skip_if_companion_pr() { - url="https://api.github.com/repos/paritytech/polkadot/pulls/${CI_COMMIT_REF_NAME}" - echo "[+] API URL: $url" - - pr_title=$(curl -sSL -H "Authorization: token ${GITHUB_PR_TOKEN}" "$url" | jq -r .title) - echo "[+] PR title: $pr_title" - - if echo "$pr_title" | grep -qi '^companion'; then - echo "[!] PR is a companion PR. Build is already done in substrate" - exit 0 - else - echo "[+] PR is not a companion PR. Proceeding test" - fi -} - -# Fetches the tag name of the latest release from a repository -# repo: 'organisation/repo' -# Usage: latest_release 'paritytech/polkadot' -latest_release() { - curl -s "$api_base/$1/releases/latest" | jq -r '.tag_name' -} - -# Check for runtime changes between two commits. This is defined as any changes -# to /primitives/src/* and any *production* chains under /runtime -has_runtime_changes() { - from=$1 - to=$2 - - if git diff --name-only "${from}...${to}" \ - | grep -q -e '^runtime/polkadot' -e '^runtime/kusama' -e '^primitives/src/' -e '^runtime/common' - then - return 0 - else - return 1 - fi -} diff --git a/cumulus/scripts/ci/create-benchmark-pr.sh b/cumulus/scripts/ci/create-benchmark-pr.sh deleted file mode 100755 index 46927f24b8089b2863253240f6f7a83e9f9cab7d..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/create-benchmark-pr.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -set -Eeu -o pipefail -shopt -s inherit_errexit - -PR_TITLE="$1" -HEAD_REF="$2" - -ORG="paritytech" -REPO="$CI_PROJECT_NAME" -BASE_REF="$CI_COMMIT_BRANCH" -# Change threshold in %. Bigger values excludes the small changes. -THRESHOLD=${THRESHOLD:-30} - -WEIGHTS_COMPARISON_URL_PARTS=( - "https://weights.tasty.limo/compare?" - "repo=$REPO&" - "threshold=$THRESHOLD&" - "path_pattern=**%2Fweights%2F*.rs&" - "method=guess-worst&" - "ignore_errors=true&" - "unit=time&" - "old=$BASE_REF&" - "new=$HEAD_REF" -) -printf -v WEIGHTS_COMPARISON_URL %s "${WEIGHTS_COMPARISON_URL_PARTS[@]}" - -PAYLOAD="$(jq -n \ - --arg title "$PR_TITLE" \ - --arg body " -This PR is generated automatically by CI. - -Compare the weights with \`$BASE_REF\`: $WEIGHTS_COMPARISON_URL - -- [ ] Backport to master and node release branch once merged -" \ - --arg base "$BASE_REF" \ - --arg head "$HEAD_REF" \ - '{ - title: $title, - body: $body, - head: $head, - base: $base - }' -)" - -echo "PAYLOAD: $PAYLOAD" - -curl \ - -H "Authorization: token $GITHUB_TOKEN" \ - -X POST \ - -d "$PAYLOAD" \ - "https://api.github.com/repos/$ORG/$REPO/pulls" diff --git a/cumulus/scripts/ci/github/check-rel-br b/cumulus/scripts/ci/github/check-rel-br deleted file mode 100755 index 1b49ae621722a42d9adbb7f018ff66ee0e935762..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/github/check-rel-br +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env bash - -# This script helps running sanity checks on a release branch -# It is intended to be ran from the repo and from the release branch - -# NOTE: The diener runs do take time and are not really required because -# if we missed the diener runs, the Cargo.lock that we check won't pass -# the tests. See https://github.com/bkchr/diener/issues/17 - -grv=$(git remote --verbose | grep push) -export RUST_LOG=none -REPO=$(echo "$grv" | cut -d ' ' -f1 | cut -d$'\t' -f2 | sed 's/.*github.com\/\(.*\)/\1/g' | cut -d '/' -f2 | cut -d '.' -f1 | sort | uniq) -echo "[+] Detected repo: $REPO" - -BRANCH=$(git branch --show-current) -if ! [[ "$BRANCH" =~ ^release.*$ || "$BRANCH" =~ ^polkadot.*$ ]]; then - echo "This script is meant to run only on a RELEASE branch." - echo "Try one of the following branch:" - git branch -r --format "%(refname:short)" --sort=-committerdate | grep -Ei '/?release' | head - exit 1 -fi -echo "[+] Working on $BRANCH" - -# Tried to get the version of the release from the branch -# input: release-foo-v0.9.22 or release-bar-v9220 or release-foo-v0.9.220 -# output: 0.9.22 -get_version() { - branch=$1 - [[ $branch =~ -v(.*) ]] - version=${BASH_REMATCH[1]} - if [[ $version =~ \. ]]; then - MAJOR=$(($(echo $version | cut -d '.' -f1))) - MINOR=$(($(echo $version | cut -d '.' -f2))) - PATCH=$(($(echo $version | cut -d '.' -f3))) - echo $MAJOR.$MINOR.${PATCH:0:2} - else - MAJOR=$(echo $(($version / 100000))) - remainer=$(($version - $MAJOR * 100000)) - MINOR=$(echo $(($remainer / 1000))) - remainer=$(($remainer - $MINOR * 1000)) - PATCH=$(echo $(($remainer / 10))) - echo $MAJOR.$MINOR.$PATCH - fi -} - -# return the name of the release branch for a given repo and version -get_release_branch() { - repo=$1 - version=$2 - case $repo in - polkadot) - echo "release-v$version" - ;; - - substrate) - echo "polkadot-v$version" - ;; - - *) - echo "Repo $repo is not supported, exiting" - exit 1 - ;; - esac -} - -# repo = substrate / polkadot -check_release_branch_repo() { - repo=$1 - branch=$2 - - echo "[+] Checking deps for $repo=$branch" - - POSTIVE=$(cat Cargo.lock | grep "$repo?branch=$branch" | sort | uniq | wc -l) - NEGATIVE=$(cat Cargo.lock | grep "$repo?branch=" | grep -v $branch | sort | uniq | wc -l) - - if [[ $POSTIVE -eq 1 && $NEGATIVE -eq 0 ]]; then - echo -e "[+] ✅ Looking good" - cat Cargo.lock | grep "$repo?branch=" | sort | uniq | sed 's/^/\t - /' - return 0 - else - echo -e "[+] ❌ Something seems to be wrong, we want 1 unique match and 0 non match (1, 0) and we got ($(($POSTIVE)), $(($NEGATIVE)))" - cat Cargo.lock | grep "$repo?branch=" | sort | uniq | sed 's/^/\t - /' - return 1 - fi -} - -# Check a release branch -check_release_branches() { - SUBSTRATE_BRANCH=$1 - POLKADOT_BRANCH=$2 - - check_release_branch_repo substrate $SUBSTRATE_BRANCH - ret_a1=$? - - ret_b1=0 - if [ $POLKADOT_BRANCH ]; then - check_release_branch_repo polkadot $POLKADOT_BRANCH - ret_b1=$? - fi - - STATUS=$(($ret_a1 + $ret_b1)) - - return $STATUS -} - -VERSION=$(get_version $BRANCH) -echo "[+] Target version: v$VERSION" - -case $REPO in - polkadot) - substrate=$(get_release_branch substrate $VERSION) - - check_release_branches $substrate - ;; - - cumulus) - polkadot=$(get_release_branch polkadot $VERSION) - substrate=$(get_release_branch substrate $VERSION) - - check_release_branches $substrate $polkadot - ;; - - *) - echo "REPO $REPO is not supported, exiting" - exit 1 - ;; -esac diff --git a/cumulus/scripts/ci/github/check_labels.sh b/cumulus/scripts/ci/github/check_labels.sh deleted file mode 100755 index 102b1a4b06661c7686df56ea530c54a0ebc92343..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/github/check_labels.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -repo="$GITHUB_REPOSITORY" -pr="$GITHUB_PR" - -ensure_labels() { - for label in "$@"; do - if has_label "$repo" "$pr" "$label"; then - return 0 - fi - done - return 1 -} - -# Must have one of the following labels -releasenotes_labels=( - 'B0-silent' - 'B1-note_worthy' -) - -# Must be an ordered list of priorities, lowest first -priority_labels=( - 'C1-low' - 'C3-medium' - 'C5-high' - 'C7-critical' -) - -audit_labels=( - 'D1-audited 👍' - 'D2-notlive 💤' - 'D3-trivial 🧸' - 'D5-nicetohaveaudit ⚠️' - 'D9-needsaudit 👮' -) - -x_labels=( - 'X0-node' - 'X1-runtime' - 'X2-API' - 'X9-misc' -) - -echo "[+] Checking release notes (B) labels for $CI_COMMIT_BRANCH" -if ensure_labels "${releasenotes_labels[@]}"; then - echo "[+] Release notes label detected. All is well." -else - echo "[!] Release notes label not detected. Please add one of: ${releasenotes_labels[*]}" - exit 1 -fi - -if has_label "$repo" "$pr" 'B1-note_worthy'; then - echo "[+] B1-note_worthy is chosen. Checking that there X-labels for $CI_COMMIT_BRANCH" - if ensure_labels "${x_labels[@]}"; then - echo "[+] X-label detected. All is well." - else - echo "[!] X-label not detected. Please add one of: ${x_labels[*]}" - exit 1 - fi -fi - -echo "[+] Checking release priority (C) labels for $CI_COMMIT_BRANCH" -if ensure_labels "${priority_labels[@]}"; then - echo "[+] Release priority label detected. All is well." -else - echo "[!] Release priority label not detected. Please add one of: ${priority_labels[*]}" - exit 1 -fi - -if has_runtime_changes "${BASE_SHA}" "${HEAD_SHA}"; then - echo "[+] Runtime changes detected. Checking audit (D) labels" - if ensure_labels "${audit_labels[@]}"; then - echo "[+] Release audit label detected. All is well." - else - echo "[!] Release audit label not detected. Please add one of: ${audit_labels[*]}" - exit 1 - fi -fi - -# If the priority is anything other than the lowest, we *must not* have a B0-silent -# label -if has_label "$repo" "$GITHUB_PR" 'B0-silent' && - ! has_label "$repo" "$GITHUB_PR" "${priority_labels[0]}"; then - echo "[!] Changes with a priority higher than C1-low *MUST* have a B- label that is not B0-Silent" - exit 1 -fi - -exit 0 diff --git a/cumulus/scripts/ci/github/extrinsic-ordering-filter.sh b/cumulus/scripts/ci/github/extrinsic-ordering-filter.sh deleted file mode 100755 index 4fd3337f64a6e9ea93848685cdf2fbac8b0340e7..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/github/extrinsic-ordering-filter.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -# This script is used in a Github Workflow. It helps filtering out what is interesting -# when comparing metadata and spot what would require a tx version bump. - -# shellcheck disable=SC2002,SC2086 - -FILE=$1 - -# Higlight indexes that were deleted -function find_deletions() { - echo "\n## Deletions\n" - RES=$(cat "$FILE" | grep -n '\[\-\]' | tr -s " ") - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' - else - echo "n/a" - fi -} - -# Highlight indexes that have been deleted -function find_index_changes() { - echo "\n## Index changes\n" - RES=$(cat "$FILE" | grep -E -n -i 'idx:\s*([0-9]+)\s*(->)\s*([0-9]+)' | tr -s " ") - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' - else - echo "n/a" - fi -} - -# Highlight values that decreased -function find_decreases() { - echo "\n## Decreases\n" - OUT=$(cat "$FILE" | grep -E -i -o '([0-9]+)\s*(->)\s*([0-9]+)' | awk '$1 > $3 { printf "%s;", $0 }') - IFS=$';' LIST=("$OUT") - unset RES - for line in "${LIST[@]}"; do - RES="$RES\n$(cat "$FILE" | grep -E -i -n \"$line\" | tr -s " ")" - done - - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' | sort -u -g | uniq - else - echo "n/a" - fi -} - -echo "\n------------------------------ SUMMARY -------------------------------" -echo "\n⚠️ This filter is here to help spotting changes that should be reviewed carefully." -echo "\n⚠️ It catches only index changes, deletions and value decreases". - -find_deletions "$FILE" -find_index_changes "$FILE" -find_decreases "$FILE" -echo "\n----------------------------------------------------------------------\n" diff --git a/cumulus/scripts/ci/github/runtime-version.rb b/cumulus/scripts/ci/github/runtime-version.rb deleted file mode 100644 index 14663acaf31a32c739243c445d41a7f3d3774074..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/github/runtime-version.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -# Gets the runtime version for a given runtime from the filesystem. -# Optionally accepts a path that is the root of the project which defaults to -# the current working directory -def get_runtime(runtime: nil, path: '.', runtime_dir: 'runtime') - File.open(path + "/#{runtime_dir}/#{runtime}/src/lib.rs") do |f| - f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0] - end -end diff --git a/cumulus/scripts/ci/gitlab/pipeline/benchmarks.yml b/cumulus/scripts/ci/gitlab/pipeline/benchmarks.yml deleted file mode 100644 index 0cbc42aabae6091d6271ac78c6c26ea12fa9e5d0..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/benchmarks.yml +++ /dev/null @@ -1,84 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "benchmarks" stage -# Work only on release-parachains-v* branches - -benchmarks-build: - stage: benchmarks-build - extends: - - .docker-env - - .collect-artifacts - - .benchmarks-manual-refs - script: - - time cargo build --profile production --locked --features runtime-benchmarks - - mkdir -p artifacts - - cp target/production/polkadot-parachain ./artifacts/ - -benchmarks-assets: - stage: benchmarks-run - timeout: 1d - extends: - - .docker-env - - .collect-artifacts - - .benchmarks-refs - before_script: - - !reference [.docker-env, before_script] - script: - - ./scripts/benchmarks-ci.sh assets asset-hub-kusama ./artifacts - - ./scripts/benchmarks-ci.sh assets asset-hub-polkadot ./artifacts - - ./scripts/benchmarks-ci.sh assets asset-hub-westend ./artifacts - - export CURRENT_TIME=$(date '+%s') - - export BRANCHNAME="weights-asset-hub-polkadot-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" - - !reference [.git-commit-push, script] - - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for asset-hub-kusama/-polkadot" "$BRANCHNAME" - - rm -f ./artifacts/polkadot-parachain - - rm -f ./artifacts/test-parachain - after_script: - - rm -rf .git/config - tags: - - weights-vm - -benchmarks-collectives: - stage: benchmarks-run - timeout: 1d - extends: - - .docker-env - - .collect-artifacts - - .benchmarks-refs - before_script: - - !reference [.docker-env, before_script] - script: - - ./scripts/benchmarks-ci.sh collectives collectives-polkadot ./artifacts - - export CURRENT_TIME=$(date '+%s') - - export BRANCHNAME="weights-collectives-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" - - !reference [.git-commit-push, script] - - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for collectives" "$BRANCHNAME" - - rm -f ./artifacts/polkadot-parachain - - rm -f ./artifacts/test-parachain - after_script: - - rm -rf .git/config - tags: - - weights-vm - -benchmarks-bridge-hubs: - stage: benchmarks-run - timeout: 1d - extends: - - .docker-env - - .collect-artifacts - - .benchmarks-refs - before_script: - - !reference [.docker-env, before_script] - script: - - ./scripts/benchmarks-ci.sh bridge-hubs bridge-hub-polkadot ./artifacts - - ./scripts/benchmarks-ci.sh bridge-hubs bridge-hub-kusama ./artifacts - - ./scripts/benchmarks-ci.sh bridge-hubs bridge-hub-rococo ./artifacts - - export CURRENT_TIME=$(date '+%s') - - export BRANCHNAME="weights-bridge-hubs-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" - - !reference [.git-commit-push, script] - - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for bridge-hubs" "$BRANCHNAME" - - rm -f ./artifacts/polkadot-parachain - - rm -f ./artifacts/test-parachain - after_script: - - rm -rf .git/config - tags: - - weights-vm diff --git a/cumulus/scripts/ci/gitlab/pipeline/build.yml b/cumulus/scripts/ci/gitlab/pipeline/build.yml deleted file mode 100644 index b47dd9fe30df439d77a729fe7b663e37f1b92273..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/build.yml +++ /dev/null @@ -1,138 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "build" stage - -build-linux-stable: - stage: build - extends: - - .docker-env - - .common-refs - - .collect-artifacts - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-rustdoc - artifacts: false - script: - - echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___" - - time cargo build --release --locked --bin polkadot-parachain - - echo "___Packing the artifacts___" - - mkdir -p ./artifacts - - mv ./target/release/polkadot-parachain ./artifacts/. - - echo "___The VERSION is either a tag name or the curent branch if triggered not by a tag___" - - echo ${CI_COMMIT_REF_NAME} | tee ./artifacts/VERSION - -build-test-parachain: - stage: build - extends: - - .docker-env - - .common-refs - - .collect-artifacts - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-rustdoc - artifacts: false - script: - - echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___" - - time cargo build --release --locked --bin test-parachain - - echo "___Packing the artifacts___" - - mkdir -p ./artifacts - - mv ./target/release/test-parachain ./artifacts/. - - mkdir -p ./artifacts/zombienet - - mv ./target/release/wbuild/cumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/. - -# build runtime only if files in $RUNTIME_PATH/$RUNTIME_NAME were changed -.build-runtime-template: &build-runtime-template - stage: build - extends: - - .docker-env - - .pr-refs - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-rustdoc - artifacts: false - variables: - RUNTIME_PATH: "parachains/runtimes/assets" - script: - - cd ${RUNTIME_PATH} - - for directory in $(echo */); do - echo "_____Running cargo check for ${directory} ______"; - cd ${directory}; - pwd; - SKIP_WASM_BUILD=1 cargo check --locked; - cd ..; - done - -# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs -# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts -# DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing -build-runtime-assets: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/assets" - -build-runtime-collectives: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/collectives" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-runtime-assets - artifacts: false - -build-runtime-bridge-hubs: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/bridge-hubs" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-runtime-collectives - artifacts: false - -build-runtime-contracts: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/contracts" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-runtime-collectives - artifacts: false - -build-runtime-starters: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/starters" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-runtime-assets - artifacts: false - -build-runtime-testing: - <<: *build-runtime-template - variables: - RUNTIME_PATH: "parachains/runtimes/testing" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-runtime-starters - artifacts: false - -build-short-benchmark: - stage: build - extends: - - .docker-env - - .common-refs - - .collect-artifacts - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-rustdoc - artifacts: false - script: - - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot-parachain - - mkdir -p ./artifacts - - cp ./target/release/polkadot-parachain ./artifacts/ diff --git a/cumulus/scripts/ci/gitlab/pipeline/integration_tests.yml b/cumulus/scripts/ci/gitlab/pipeline/integration_tests.yml deleted file mode 100644 index a884361aa7cd397cb945c19bdb9e0b4b126388fb..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/integration_tests.yml +++ /dev/null @@ -1,2 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "integration_stage" stage diff --git a/cumulus/scripts/ci/gitlab/pipeline/publish.yml b/cumulus/scripts/ci/gitlab/pipeline/publish.yml deleted file mode 100644 index e59ff167698180057823374c481a2ad4ab7409c0..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/publish.yml +++ /dev/null @@ -1,105 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "publish" stage - -.build-push-image: - image: $BUILDAH_IMAGE - variables: - DOCKERFILE: "" # docker/path-to.Dockerfile - IMAGE_NAME: "" # docker.io/paritypr/image_name - VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" - script: - - test "$PARITYPR_USER" -a "$PARITYPR_PASS" || - ( echo "no docker credentials provided"; exit 1 ) - - $BUILDAH_COMMAND build - --format=docker - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --build-arg IMAGE_NAME="${IMAGE_NAME}" - --tag "$IMAGE_NAME:$VERSION" - --file ${DOCKERFILE} . - - echo "$PARITYPR_PASS" | - buildah login --username "$PARITYPR_USER" --password-stdin docker.io - - $BUILDAH_COMMAND info - - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$VERSION" - after_script: - - buildah logout --all - -build-push-image-polkadot-parachain-debug: - stage: publish - extends: - - .kubernetes-env - - .common-refs - - .build-push-image - needs: - - job: build-linux-stable - artifacts: true - variables: - DOCKERFILE: "docker/polkadot-parachain-debug_unsigned_injected.Dockerfile" - IMAGE_NAME: "docker.io/paritypr/polkadot-parachain-debug" - VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" - -build-push-image-test-parachain: - stage: publish - extends: - - .kubernetes-env - - .common-refs - - .build-push-image - needs: - - job: build-test-parachain - artifacts: true - variables: - DOCKERFILE: "docker/test-parachain_injected.Dockerfile" - IMAGE_NAME: "docker.io/paritypr/test-parachain" - VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" - -publish-s3: - stage: publish - extends: - - .kubernetes-env - - .publish-refs - image: paritytech/awscli:latest - needs: - - job: build-linux-stable - artifacts: true - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "cumulus/${ARCH}-${DOCKER_OS}" - script: - - echo "___Publishing a binary with debug assertions!___" - - echo "___VERSION = $(cat ./artifacts/VERSION) ___" - - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/ - - echo "___Updating objects in latest path___" - - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/ - --recursive --human-readable --summarize - -publish-benchmarks-assets-s3: &publish-benchmarks - stage: publish - extends: - - .kubernetes-env - - .benchmarks-refs - image: paritytech/awscli:latest - needs: - - job: benchmarks-assets - artifacts: true - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "cumulus/$CI_COMMIT_REF_NAME/benchmarks-assets" - script: - - echo "___Publishing benchmark results___" - - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/ --recursive --human-readable --summarize - -publish-benchmarks-collectives-s3: - <<: *publish-benchmarks - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "cumulus/$CI_COMMIT_REF_NAME/benchmarks-collectives" - needs: - - job: benchmarks-collectives - artifacts: true diff --git a/cumulus/scripts/ci/gitlab/pipeline/short-benchmarks.yml b/cumulus/scripts/ci/gitlab/pipeline/short-benchmarks.yml deleted file mode 100644 index f63ad1e0d045518090d37e308bee83affa2d8c46..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/short-benchmarks.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "short-benchmarks" stage - -# Run all pallet benchmarks only once to check if there are any errors -.short-benchmark-template: &short-bench - stage: short-benchmarks - extends: - - .common-refs - - .docker-env - needs: - - job: build-short-benchmark - artifacts: true - variables: - RUNTIME_CHAIN: benchmarked-runtime-chain - script: - - ./artifacts/polkadot-parachain benchmark pallet --wasm-execution compiled --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1 - -short-benchmark-asset-hub-polkadot: - <<: *short-bench - variables: - RUNTIME_CHAIN: asset-hub-polkadot-dev - -short-benchmark-asset-hub-kusama: - <<: *short-bench - variables: - RUNTIME_CHAIN: asset-hub-kusama-dev - -short-benchmark-asset-hub-westend: - <<: *short-bench - variables: - RUNTIME_CHAIN: asset-hub-westend-dev - -short-benchmark-bridge-hub-polkadot: - <<: *short-bench - variables: - RUNTIME_CHAIN: bridge-hub-polkadot-dev - -short-benchmark-bridge-hub-kusama: - <<: *short-bench - variables: - RUNTIME_CHAIN: bridge-hub-kusama-dev - -short-benchmark-bridge-hub-rococo: - <<: *short-bench - variables: - RUNTIME_CHAIN: bridge-hub-rococo-dev - -short-benchmark-collectives-polkadot : - <<: *short-bench - variables: - RUNTIME_CHAIN: collectives-polkadot-dev - -short-benchmark-glutton-kusama : - <<: *short-bench - variables: - RUNTIME_CHAIN: glutton-kusama-dev-1300 diff --git a/cumulus/scripts/ci/gitlab/pipeline/test.yml b/cumulus/scripts/ci/gitlab/pipeline/test.yml deleted file mode 100644 index 2d84010cb74ea5b5c26cf9bd543990e28c0b9e92..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/test.yml +++ /dev/null @@ -1,111 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "test" stage - -# It's more like a check, but we want to run this job with real tests in parallel -find-fail-ci-phrase: - stage: test - variables: - CI_IMAGE: "paritytech/tools:latest" - ASSERT_REGEX: "FAIL-CI" - GIT_DEPTH: 1 - extends: - - .kubernetes-env - script: - - set +e - - rg --line-number --hidden --type rust --glob '!{.git,target}' "$ASSERT_REGEX" .; exit_status=$? - - if [ $exit_status -eq 0 ]; then - echo "$ASSERT_REGEX was found, exiting with 1"; - exit 1; - else - echo "No $ASSERT_REGEX was found, exiting with 0"; - exit 0; - fi - -test-linux-stable: - stage: test - extends: - - .docker-env - - .common-refs - - .pipeline-stopper-artifacts - before_script: - - !reference [.docker-env, before_script] - - !reference [.pipeline-stopper-vars, before_script] - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - script: - - time cargo nextest run --all --release --locked --run-ignored all - -test-doc: - stage: test - extends: - - .docker-env - - .common-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - script: - - time cargo test --doc - -check-runtime-benchmarks: - stage: test - extends: - - .docker-env - - .common-refs - script: - # Check that the node will compile with `runtime-benchmarks` feature flag. - - time cargo check --locked --all --features runtime-benchmarks - # Check that parachain-template will compile with `runtime-benchmarks` feature flag. - - time cargo check --locked -p parachain-template-node --features runtime-benchmarks - -cargo-check-try-runtime: - stage: test - extends: - - .docker-env - - .common-refs - variables: - RUSTFLAGS: "-D warnings" - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-runtime-benchmarks - artifacts: false - script: - # Check that the node will compile with `try-runtime` feature flag. - - time cargo check --locked --all --features try-runtime - # Check that parachain-template will compile with `try-runtime` feature flag. - - time cargo check --locked -p parachain-template-node --features try-runtime - -check-rustdoc: - stage: test - extends: - - .docker-env - - .common-refs - variables: - SKIP_WASM_BUILD: 1 - RUSTDOCFLAGS: "-Dwarnings" - script: - - time cargo doc --workspace --all-features --verbose --no-deps - -cargo-check-benches: - stage: test - extends: - - .docker-env - - .common-refs - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-rustdoc - artifacts: false - script: - - time cargo check --all --benches - -cargo-clippy: - stage: test - extends: - - .docker-env - - .common-refs - script: - - echo $RUSTFLAGS - - cargo version && cargo clippy --version - - SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo clippy --locked --all-targets --workspace diff --git a/cumulus/scripts/ci/gitlab/pipeline/zombienet.yml b/cumulus/scripts/ci/gitlab/pipeline/zombienet.yml deleted file mode 100644 index d5ab3e13d42e24112c8e21be834c959fa56888a4..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/pipeline/zombienet.yml +++ /dev/null @@ -1,141 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "zombienet" stage - -.zombienet-before-script: - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE}" - - echo "${RELAY_IMAGE}" - - echo "${COL_IMAGE}" - - echo "${GH_DIR}" - - export DEBUG=zombie - - export RELAY_IMAGE=${POLKADOT_IMAGE} - - export COL_IMAGE=${COL_IMAGE} - -.zombienet-after-script: - after_script: - - mkdir -p ./zombienet-logs - - cp /tmp/zombie*/logs/* ./zombienet-logs/ - -# common settings for all zombienet jobs -.zombienet-common: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - needs: - - job: build-push-image-test-parachain - artifacts: true - variables: - POLKADOT_IMAGE: "docker.io/paritypr/polkadot-debug:master" - GH_DIR: "https://github.com/paritytech/cumulus/tree/${CI_COMMIT_SHORT_SHA}/zombienet/tests" - COL_IMAGE: "docker.io/paritypr/test-parachain:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1 - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" - when: always - expire_in: 2 days - paths: - - ./zombienet-logs - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-0001-sync_blocks_from_tip_without_connected_collator: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0001-sync_blocks_from_tip_without_connected_collator.zndsl" - -zombienet-0002-pov_recovery: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0002-pov_recovery.zndsl" - -zombienet-0003-full_node_catching_up: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0003-full_node_catching_up.zndsl" - -zombienet-0004-runtime_upgrade: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - needs: - - !reference [.zombienet-common, needs] - - job: build-test-parachain - artifacts: true - before_script: - - ls -ltr * - - cp ./artifacts/zombienet/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm /tmp/ - - ls /tmp - - !reference [.zombienet-before-script, before_script] - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0004-runtime_upgrade.zndsl" - -zombienet-0005-migrate_solo_to_para: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - needs: - - !reference [.zombienet-common, needs] - - job: build-test-parachain - artifacts: true - before_script: - - ls -ltr * - - !reference [.zombienet-before-script, before_script] - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0005-migrate_solo_to_para.zndsl" - -zombienet-0006-rpc_collator_builds_blocks: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0006-rpc_collator_builds_blocks.zndsl" - -zombienet-0007-full_node_warp_sync: - extends: - - .zombienet-common - - .zombienet-refs - - .zombienet-before-script - - .zombienet-after-script - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --concurrency=1 - --test="0007-full_node_warp_sync.zndsl" diff --git a/cumulus/scripts/ci/gitlab/prettier.sh b/cumulus/scripts/ci/gitlab/prettier.sh deleted file mode 100755 index 299bbee179dcaeff3fbadffd89fb4548ac878555..0000000000000000000000000000000000000000 --- a/cumulus/scripts/ci/gitlab/prettier.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# meant to be installed via -# git config filter.ci-prettier.clean "scripts/ci/gitlab/prettier.sh" - -prettier --parser yaml diff --git a/cumulus/test/client/Cargo.toml b/cumulus/test/client/Cargo.toml index 5d8c6643c3c7f4b44c1adc9290013ad1ad9db4ca..290cfd7e4d899a84dc3d4392f4c2c1e6ae671b18 100644 --- a/cumulus/test/client/Cargo.toml +++ b/cumulus/test/client/Cargo.toml @@ -3,6 +3,7 @@ name = "cumulus-test-client" version = "0.1.0" authors.workspace = true edition.workspace = true +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } @@ -28,7 +29,7 @@ pallet-balances = { path = "../../../substrate/frame/balances" } # Polkadot polkadot-primitives = { path = "../../../polkadot/primitives" } -polkadot-parachain = { path = "../../../polkadot/parachain" } +polkadot-parachain-primitives = { path = "../../../polkadot/parachain" } # Cumulus cumulus-test-runtime = { path = "../runtime" } diff --git a/cumulus/test/client/src/block_builder.rs b/cumulus/test/client/src/block_builder.rs index 06c7416be67fb8acd068bb2b48f616b959a5dbc2..2d930d1be59774daf6ab1cd97ef62be88bf1bfe2 100644 --- a/cumulus/test/client/src/block_builder.rs +++ b/cumulus/test/client/src/block_builder.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/client/src/lib.rs b/cumulus/test/client/src/lib.rs index 9660a99c3594967ab166b40319b58f5830fad70a..61249bdb066ad06a0dfbecfa09ac046aca2b0889 100644 --- a/cumulus/test/client/src/lib.rs +++ b/cumulus/test/client/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -31,7 +31,9 @@ use sp_runtime::{generic::Era, BuildStorage, SaturatedConversion}; pub use block_builder::*; pub use cumulus_test_runtime as runtime; -pub use polkadot_parachain::primitives::{BlockData, HeadData, ValidationParams, ValidationResult}; +pub use polkadot_parachain_primitives::primitives::{ + BlockData, HeadData, ValidationParams, ValidationResult, +}; pub use sc_executor::error::Result as ExecutorResult; pub use substrate_test_client::*; diff --git a/cumulus/test/relay-sproof-builder/Cargo.toml b/cumulus/test/relay-sproof-builder/Cargo.toml index e044b92f7c4af4d297c8996c404a479e2d73ec8b..c987a2b66c9026bdc5a40a8a6fb3331258850331 100644 --- a/cumulus/test/relay-sproof-builder/Cargo.toml +++ b/cumulus/test/relay-sproof-builder/Cargo.toml @@ -3,6 +3,7 @@ name = "cumulus-test-relay-sproof-builder" version = "0.1.0" authors.workspace = true edition.workspace = true +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } diff --git a/cumulus/test/relay-sproof-builder/src/lib.rs b/cumulus/test/relay-sproof-builder/src/lib.rs index a17e5df13d0c62d9477e2b0479592c8213ef05d2..69a82d05d81693247f0b47adcbb98dfeaebcb068 100644 --- a/cumulus/test/relay-sproof-builder/src/lib.rs +++ b/cumulus/test/relay-sproof-builder/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/relay-validation-worker-provider/Cargo.toml b/cumulus/test/relay-validation-worker-provider/Cargo.toml index eaa1ce8dc47cf819325b0c9292c8973642d5ae30..b7c59e8329958ad5d32d7b4ee171608302f868a8 100644 --- a/cumulus/test/relay-validation-worker-provider/Cargo.toml +++ b/cumulus/test/relay-validation-worker-provider/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors.workspace = true edition.workspace = true build = "build.rs" +publish = false [dependencies] diff --git a/cumulus/test/relay-validation-worker-provider/build.rs b/cumulus/test/relay-validation-worker-provider/build.rs index a0a476b0195e9c5f3a991ef9113c343b64743968..60bb950db1fcc94c0e558dc885785c1e3724efa2 100644 --- a/cumulus/test/relay-validation-worker-provider/build.rs +++ b/cumulus/test/relay-validation-worker-provider/build.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/relay-validation-worker-provider/src/lib.rs b/cumulus/test/relay-validation-worker-provider/src/lib.rs index 840214eb3c05e517994f818ab17abb28d566fd2b..6c3f4182b03bd6ca473c3380a567dfe682ef3b4d 100644 --- a/cumulus/test/relay-validation-worker-provider/src/lib.rs +++ b/cumulus/test/relay-validation-worker-provider/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/runtime/Cargo.toml b/cumulus/test/runtime/Cargo.toml index 9fe4c55bbd79a297e341c4858458210a730fbfe4..dbfe9f46b1bd2e1dd9c57a79836b5a3065b03d25 100644 --- a/cumulus/test/runtime/Cargo.toml +++ b/cumulus/test/runtime/Cargo.toml @@ -3,6 +3,7 @@ name = "cumulus-test-runtime" version = "0.1.0" authors.workspace = true edition.workspace = true +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } diff --git a/cumulus/test/runtime/build.rs b/cumulus/test/runtime/build.rs index 77631afefe615ca7290f8f1a7221930623ec4b10..5e5f6a35a505a957a3494285b7b649e6ee4e61f7 100644 --- a/cumulus/test/runtime/build.rs +++ b/cumulus/test/runtime/build.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Substrate is free software: you can redistribute it and/or modify diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index 4c213ad4054ac9976310d229be80aa36badff747..ccf624c0ffa4ef85307fcd3c8a0ff24621b5bf5c 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/runtime/src/test_pallet.rs b/cumulus/test/runtime/src/test_pallet.rs index bc72ef19505de429bb78fbe3d19551719b890c6d..0af23797dad6dd13561584f9d1d608f23f1a6bc2 100644 --- a/cumulus/test/runtime/src/test_pallet.rs +++ b/cumulus/test/runtime/src/test_pallet.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/Cargo.toml b/cumulus/test/service/Cargo.toml index ad007c509ffbefa25d0d4da7f8641ea02e930a52..04d53545ead716a6b47fb76b93df587fb3837071 100644 --- a/cumulus/test/service/Cargo.toml +++ b/cumulus/test/service/Cargo.toml @@ -3,6 +3,7 @@ name = "cumulus-test-service" version = "0.1.0" authors.workspace = true edition.workspace = true +publish = false [[bin]] name = "test-parachain" @@ -10,12 +11,12 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.73" -clap = { version = "4.3.24", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } jsonrpsee = { version = "0.16.2", features = ["server"] } rand = "0.8.5" -serde = { version = "1.0.183", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } tokio = { version = "1.32.0", features = ["macros"] } tracing = "0.1.37" url = "2.4.0" diff --git a/cumulus/test/service/benches/transaction_throughput.rs b/cumulus/test/service/benches/transaction_throughput.rs index 48bf49487e64055e9c522ff78e71c54cc26d4da1..83981a91d46f0803d3a77cfb71e36ec3ee85dee3 100644 --- a/cumulus/test/service/benches/transaction_throughput.rs +++ b/cumulus/test/service/benches/transaction_throughput.rs @@ -1,6 +1,6 @@ // This file is part of Cumulus. -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/src/chain_spec.rs b/cumulus/test/service/src/chain_spec.rs index 3d72d0db3ab5753ea178193f34be77381434f55d..7c8c984c2b207bb1ae86bad5042ee469bc622d4f 100644 --- a/cumulus/test/service/src/chain_spec.rs +++ b/cumulus/test/service/src/chain_spec.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/src/cli.rs b/cumulus/test/service/src/cli.rs index 4c86094f81dd05272c43381752882d814a205e9e..f295192c3b10aaa28d359bf2e91085e2f270b04a 100644 --- a/cumulus/test/service/src/cli.rs +++ b/cumulus/test/service/src/cli.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/src/genesis.rs b/cumulus/test/service/src/genesis.rs index fb1825cfbdd30286ca918ed686a8314f3264e3ff..9dba57ba9fbc1ff00059284ed1c92e1c7669d208 100644 --- a/cumulus/test/service/src/genesis.rs +++ b/cumulus/test/service/src/genesis.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/src/lib.rs b/cumulus/test/service/src/lib.rs index 7dcab7c5076cf664cec2216c756a524ffed411ff..3275aabc4d860d73cde4b26025d11ebfa9b05821 100644 --- a/cumulus/test/service/src/lib.rs +++ b/cumulus/test/service/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/test/service/src/main.rs b/cumulus/test/service/src/main.rs index a2b177db251c9dcc268e3facf65758113c61d883..5946e9cc3506e220672cb58561d52b93bcad2d8a 100644 --- a/cumulus/test/service/src/main.rs +++ b/cumulus/test/service/src/main.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/cumulus/xcm/xcm-emulator/Cargo.toml b/cumulus/xcm/xcm-emulator/Cargo.toml index 8560b6401f789b8db68a86d44300faf7d55851bf..72007ba98f7fa1b8962ecbbd6c631449a7c18576 100644 --- a/cumulus/xcm/xcm-emulator/Cargo.toml +++ b/cumulus/xcm/xcm-emulator/Cargo.toml @@ -4,6 +4,7 @@ description = "Test kit to emulate XCM program execution." version = "0.1.0" authors.workspace = true edition.workspace = true +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } @@ -20,22 +21,20 @@ sp-core = { path = "../../../substrate/primitives/core" } sp-std = { path = "../../../substrate/primitives/std" } sp-runtime = { path = "../../../substrate/primitives/runtime" } sp-arithmetic = { path = "../../../substrate/primitives/arithmetic" } -sp-trie = { path = "../../../substrate/primitives/trie" } +sp-tracing = { path = "../../../substrate/primitives/tracing" } pallet-balances = { path = "../../../substrate/frame/balances" } pallet-message-queue = { path = "../../../substrate/frame/message-queue" } # Cumulus cumulus-primitives-core = { path = "../../primitives/core" } -cumulus-pallet-xcmp-queue = { path = "../../pallets/xcmp-queue" } -cumulus-pallet-dmp-queue = { path = "../../pallets/dmp-queue" } cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system" } -parachain-info = { path = "../../parachains/pallets/parachain-info" } cumulus-primitives-parachain-inherent = { path = "../../primitives/parachain-inherent" } cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" } parachains-common = { path = "../../parachains/common" } # Polkadot -xcm = { path = "../../../polkadot/xcm" } -xcm-executor = { path = "../../../polkadot/xcm/xcm-executor" } +xcm = { package = "staging-xcm", path = "../../../polkadot/xcm" } +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor" } polkadot-primitives = { path = "../../../polkadot/primitives" } +polkadot-parachain-primitives = { path = "../../../polkadot/parachain" } polkadot-runtime-parachains = { path = "../../../polkadot/runtime/parachains" } diff --git a/cumulus/xcm/xcm-emulator/src/lib.rs b/cumulus/xcm/xcm-emulator/src/lib.rs index 72f88ee7fa975f3d9f9cb9f0fe56f7602bb270c8..59f238528fc1c3b2d76241c234ad0f88e03cd07b 100644 --- a/cumulus/xcm/xcm-emulator/src/lib.rs +++ b/cumulus/xcm/xcm-emulator/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -14,67 +14,50 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -pub use codec::{Decode, Encode}; +pub use codec::{Decode, Encode, EncodeLike}; pub use lazy_static::lazy_static; pub use log; pub use paste; pub use std::{ - any::type_name, - collections::HashMap, - error::Error, - fmt, - marker::PhantomData, - ops::Deref, - sync::{Condvar, Mutex}, - thread::LocalKey, + any::type_name, collections::HashMap, error::Error, fmt, marker::PhantomData, ops::Deref, + sync::Mutex, }; // Substrate pub use frame_support::{ assert_ok, - dispatch::EncodeLike, - sp_runtime::{AccountId32, DispatchResult}, + sp_runtime::{traits::Header as HeaderT, AccountId32, DispatchResult}, traits::{ - tokens::currency::Currency, EnqueueMessage, Get, Hooks, OriginTrait, ProcessMessage, - ProcessMessageError, ServiceQueues, + EnqueueMessage, Get, Hooks, OriginTrait, ProcessMessage, ProcessMessageError, ServiceQueues, }, weights::{Weight, WeightMeter}, - StorageHasher, }; -pub use frame_system::{AccountInfo, Config as SystemConfig, Pallet as SystemPallet}; +pub use frame_system::{Config as SystemConfig, Pallet as SystemPallet}; pub use pallet_balances::AccountData; pub use sp_arithmetic::traits::Bounded; -pub use sp_core::{sr25519, storage::Storage, Pair, H256}; +pub use sp_core::{blake2_256, parameter_types, sr25519, storage::Storage, Pair}; pub use sp_io::TestExternalities; pub use sp_std::{cell::RefCell, collections::vec_deque::VecDeque, fmt::Debug}; -pub use sp_trie::StorageProof; +pub use sp_tracing; -//Cumulus -pub use cumulus_pallet_dmp_queue; -pub use cumulus_pallet_parachain_system::{self, Pallet as ParachainSystemPallet}; -pub use cumulus_pallet_xcmp_queue::{Config as XcmpQueueConfig, Pallet as XcmpQueuePallet}; +// Cumulus +pub use cumulus_pallet_parachain_system::Pallet as ParachainSystemPallet; pub use cumulus_primitives_core::{ - self, - relay_chain::{BlockNumber as RelayBlockNumber, HeadData}, - DmpMessageHandler, ParaId, PersistedValidationData, XcmpMessageHandler, + relay_chain::{BlockNumber as RelayBlockNumber, HeadData, HrmpChannelId}, + AbridgedHrmpChannel, DmpMessageHandler, ParaId, PersistedValidationData, XcmpMessageHandler, }; pub use cumulus_primitives_parachain_inherent::ParachainInherentData; pub use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; -pub use pallet_message_queue::{ - Config as MessageQueueConfig, Event as MessageQueueEvent, Pallet as MessageQueuePallet, -}; -pub use parachain_info; +pub use pallet_message_queue::{Config as MessageQueueConfig, Pallet as MessageQueuePallet}; pub use parachains_common::{AccountId, Balance, BlockNumber}; pub use polkadot_primitives; -pub use polkadot_runtime_parachains::{ - dmp, - inclusion::{AggregateMessageOrigin, UmpQueueId}, -}; +pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; // Polkadot -pub use xcm::{ - v3::prelude::{AccountId32 as AccountId32Junction, Parachain as ParachainJunction, *}, - VersionedMultiAssets, VersionedMultiLocation, +pub use polkadot_parachain_primitives::primitives::RelayChainBlockNumber; +pub use xcm::v3::prelude::{ + Ancestor, MultiAssets, MultiLocation, Parachain as ParachainJunction, Parent, WeightLimit, + XcmHash, X1, }; pub use xcm_executor::traits::ConvertLocation; @@ -363,23 +346,24 @@ macro_rules! decl_test_relay_chains { } ), + + $(,)? ) => { $( #[derive(Clone)] pub struct $name; - impl Chain for $name { + impl $crate::Chain for $name { type Runtime = $runtime::Runtime; type RuntimeCall = $runtime::RuntimeCall; type RuntimeOrigin = $runtime::RuntimeOrigin; type RuntimeEvent = $runtime::RuntimeEvent; type System = $crate::SystemPallet::; - fn account_data_of(account: AccountId) -> $crate::AccountData { - Self::ext_wrapper(|| $crate::SystemPallet::::account(account).data.into()) + fn account_data_of(account: $crate::AccountId) -> $crate::AccountData<$crate::Balance> { + ::ext_wrapper(|| $crate::SystemPallet::::account(account).data.into()) } - fn events() -> Vec<::RuntimeEvent> { + fn events() -> Vec<::RuntimeEvent> { Self::System::events() .iter() .map(|record| record.event.clone()) @@ -387,7 +371,7 @@ macro_rules! decl_test_relay_chains { } } - impl RelayChain for $name { + impl $crate::RelayChain for $name { type SovereignAccountOf = $sovereign_acc_of; type MessageProcessor = $mp; } @@ -431,7 +415,7 @@ macro_rules! __impl_test_ext_for_relay_chain { (@impl $name:ident, $genesis:expr, $on_init:expr, $api_version:ident, $local_ext:ident, $global_ext:ident) => { thread_local! { pub static $local_ext: $crate::RefCell<$crate::TestExternalities> - = $crate::RefCell::new(<$name>::build_new_ext($genesis)); + = $crate::RefCell::new(<$name as $crate::TestExt>::build_new_ext($genesis)); } $crate::lazy_static! { @@ -439,11 +423,11 @@ macro_rules! __impl_test_ext_for_relay_chain { = $crate::Mutex::new($crate::RefCell::new($crate::HashMap::new())); } - impl TestExt for $name { + impl $crate::TestExt for $name { fn build_new_ext(storage: $crate::Storage) -> $crate::TestExternalities { - use $crate::{NetworkComponent, Network, Chain}; + use $crate::{sp_tracing, NetworkComponent, Network, Chain, TestExternalities}; - let mut ext = $crate::TestExternalities::new(storage); + let mut ext = TestExternalities::new(storage); ext.execute_with(|| { #[allow(clippy::no_effect)] @@ -513,7 +497,7 @@ macro_rules! __impl_test_ext_for_relay_chain { } fn execute_with(execute: impl FnOnce() -> R) -> R { - use $crate::{NetworkComponent, Network}; + use $crate::{Chain, NetworkComponent, Network}; // Make sure the Network is initialized <$name as NetworkComponent>::Network::init(); @@ -528,7 +512,7 @@ macro_rules! __impl_test_ext_for_relay_chain { //TODO: mark sent count & filter out sent msg for para_id in<$name as NetworkComponent>::Network::para_ids() { // downward messages - let downward_messages = ::Runtime::dmq_contents(para_id.into()) + let downward_messages = ::Runtime::dmq_contents(para_id.into()) .into_iter() .map(|inbound| (inbound.sent_at, inbound.msg)); if downward_messages.len() == 0 { @@ -587,23 +571,24 @@ macro_rules! decl_test_parachains { } ), + + $(,)? ) => { $( #[derive(Clone)] pub struct $name; - impl Chain for $name { + impl $crate::Chain for $name { type Runtime = $runtime::Runtime; type RuntimeCall = $runtime::RuntimeCall; type RuntimeOrigin = $runtime::RuntimeOrigin; type RuntimeEvent = $runtime::RuntimeEvent; type System = $crate::SystemPallet::; - fn account_data_of(account: AccountId) -> $crate::AccountData { - Self::ext_wrapper(|| $crate::SystemPallet::::account(account).data.into()) + fn account_data_of(account: $crate::AccountId) -> $crate::AccountData<$crate::Balance> { + ::ext_wrapper(|| $crate::SystemPallet::::account(account).data.into()) } - fn events() -> Vec<::RuntimeEvent> { + fn events() -> Vec<::RuntimeEvent> { Self::System::events() .iter() .map(|record| record.event.clone()) @@ -611,25 +596,25 @@ macro_rules! decl_test_parachains { } } - impl Parachain for $name { + impl $crate::Parachain for $name { type XcmpMessageHandler = $xcmp_message_handler; type DmpMessageHandler = $dmp_message_handler; type LocationToAccountId = $location_to_account; - type ParachainSystem = $crate::ParachainSystemPallet<::Runtime>; + type ParachainSystem = $crate::ParachainSystemPallet<::Runtime>; type ParachainInfo = $parachain_info; fn init() { - use $crate::{Network, NetworkComponent, Hooks}; + use $crate::{Chain, HeadData, Network, NetworkComponent, Hooks, Encode, Parachain, TestExt}; let para_id = Self::para_id(); - ::ext_wrapper(|| { + Self::ext_wrapper(|| { let block_number = ::System::block_number(); let mut relay_block_number = ::Network::relay_block_number(); // Get parent head data let header = ::System::finalize(); - let parent_head_data = $crate::HeadData(header.encode()); + let parent_head_data = HeadData(header.encode()); $crate::LAST_HEAD.with(|b| b.borrow_mut() .get_mut(::Network::name()) @@ -639,7 +624,7 @@ macro_rules! decl_test_parachains { let next_block_number = block_number + 1; ::System::initialize(&next_block_number, &header.hash(), &Default::default()); - ::ParachainSystem::on_initialize(next_block_number); + <::ParachainSystem as Hooks<$crate::BlockNumber>>::on_initialize(next_block_number); }); } } @@ -676,7 +661,7 @@ macro_rules! __impl_test_ext_for_parachain { (@impl $name:ident, $genesis:expr, $on_init:expr, $local_ext:ident, $global_ext:ident) => { thread_local! { pub static $local_ext: $crate::RefCell<$crate::TestExternalities> - = $crate::RefCell::new(<$name>::build_new_ext($genesis)); + = $crate::RefCell::new(<$name as $crate::TestExt>::build_new_ext($genesis)); } $crate::lazy_static! { @@ -684,20 +669,18 @@ macro_rules! __impl_test_ext_for_parachain { = $crate::Mutex::new($crate::RefCell::new($crate::HashMap::new())); } - impl TestExt for $name { + impl $crate::TestExt for $name { fn build_new_ext(storage: $crate::Storage) -> $crate::TestExternalities { - use $crate::{NetworkComponent, Network, Chain}; - let mut ext = $crate::TestExternalities::new(storage); ext.execute_with(|| { #[allow(clippy::no_effect)] $on_init; - sp_tracing::try_init_simple(); + $crate::sp_tracing::try_init_simple(); - let mut block_number = ::System::block_number(); + let mut block_number = ::System::block_number(); block_number = std::cmp::max(1, block_number); - ::System::set_block_number(block_number); + ::System::set_block_number(block_number); }); ext } @@ -758,10 +741,7 @@ macro_rules! __impl_test_ext_for_parachain { } fn execute_with(execute: impl FnOnce() -> R) -> R { - use $crate::{Get, Hooks, NetworkComponent, Network, Bridge}; - use sp_core::Encode; - use sp_runtime::traits::BlakeTwo256; - use polkadot_primitives::HashT; + use $crate::{Chain, Get, Hooks, NetworkComponent, Network, Parachain, Encode}; // Make sure the Network is initialized <$name as NetworkComponent>::Network::init(); @@ -802,10 +782,8 @@ macro_rules! __impl_test_ext_for_parachain { // Finalize block and send messages if needed $local_ext.with(|v| { v.borrow_mut().execute_with(|| { - use sp_runtime::traits::Header as HeaderT; - let block_number = ::System::block_number(); - let mock_header = HeaderT::new( + let mock_header = $crate::HeaderT::new( 0, Default::default(), Default::default(), @@ -840,9 +818,9 @@ macro_rules! __impl_test_ext_for_parachain { } // get bridge messages - type NetworkBridge = <<$name as NetworkComponent>::Network as Network>::Bridge; + type NetworkBridge = <<$name as NetworkComponent>::Network as $crate::Network>::Bridge; - let bridge_messages = ::Handler::get_source_outbound_messages(); + let bridge_messages = <::Handler as $crate::BridgeMessageHandler>::get_source_outbound_messages(); // send bridged messages for msg in bridge_messages { @@ -850,17 +828,17 @@ macro_rules! __impl_test_ext_for_parachain { } // log events - Self::events().iter().for_each(|event| { + ::events().iter().for_each(|event| { $crate::log::debug!(target: concat!("events::", stringify!($name)), "{:?}", event); }); // clean events - ::System::reset_events(); + ::System::reset_events(); // reinitialize before next call. let next_block_number = block_number + 1; - ::System::initialize(&next_block_number, &created_header.hash(), &Default::default()); - ::ParachainSystem::on_initialize(next_block_number); + ::System::initialize(&next_block_number, &created_header.hash(), &Default::default()); + <::ParachainSystem as Hooks<$crate::BlockNumber>>::on_initialize(next_block_number); }) }); @@ -895,6 +873,7 @@ macro_rules! decl_test_networks { } ), + + $(,)? ) => { $( pub struct $name; @@ -908,7 +887,7 @@ macro_rules! decl_test_networks { } fn reset() { - use $crate::{TestExt, VecDeque}; + use $crate::{TestExt}; $crate::INITIALIZED.with(|b| b.borrow_mut().remove(Self::name())); $crate::DOWNWARD_MESSAGES.with(|b| b.borrow_mut().remove(Self::name())); @@ -934,25 +913,25 @@ macro_rules! decl_test_networks { $crate::PARA_IDS.with(|b| b.borrow_mut().insert(Self::name().to_string(), Self::para_ids())); $crate::LAST_HEAD.with(|b| b.borrow_mut().insert(Self::name().to_string(), $crate::HashMap::new())); - $( <$parachain>::init(); )* + $( <$parachain as $crate::Parachain>::init(); )* } } fn para_ids() -> Vec { vec![$( - <$parachain>::para_id().into(), + <$parachain as $crate::Parachain>::para_id().into(), )*] } fn relay_block_number() -> u32 { - Self::Relay::ext_wrapper(|| { - ::System::block_number() + ::ext_wrapper(|| { + ::System::block_number() }) } fn set_relay_block_number(number: u32) { - Self::Relay::ext_wrapper(|| { - ::System::set_block_number(number); + ::ext_wrapper(|| { + ::System::set_block_number(number); }) } @@ -973,8 +952,7 @@ macro_rules! decl_test_networks { } fn process_downward_messages() { - use $crate::{DmpMessageHandler, Bounded}; - use polkadot_parachain::primitives::RelayChainBlockNumber; + use $crate::{DmpMessageHandler, Bounded, Parachain, RelayChainBlockNumber, TestExt}; while let Some((to_para_id, messages)) = $crate::DOWNWARD_MESSAGES.with(|b| b.borrow_mut().get_mut(Self::name()).unwrap().pop_front()) { @@ -1006,7 +984,7 @@ macro_rules! decl_test_networks { } fn process_horizontal_messages() { - use $crate::{XcmpMessageHandler, Bounded}; + use $crate::{XcmpMessageHandler, Bounded, Parachain, TestExt}; while let Some((to_para_id, messages)) = $crate::HORIZONTAL_MESSAGES.with(|b| b.borrow_mut().get_mut(Self::name()).unwrap().pop_front()) { @@ -1025,16 +1003,16 @@ macro_rules! decl_test_networks { } fn process_upward_messages() { - use $crate::{Bounded, ProcessMessage, WeightMeter}; - use sp_core::Encode; + use $crate::{Encode, ProcessMessage, TestExt}; + while let Some((from_para_id, msg)) = $crate::UPWARD_MESSAGES.with(|b| b.borrow_mut().get_mut(Self::name()).unwrap().pop_front()) { - let mut weight_meter = WeightMeter::max_limit(); + let mut weight_meter = $crate::WeightMeter::new(); <$relay_chain>::ext_wrapper(|| { - let _ = <$relay_chain as RelayChain>::MessageProcessor::process_message( + let _ = <$relay_chain as $crate::RelayChain>::MessageProcessor::process_message( &msg[..], from_para_id.into(), &mut weight_meter, - &mut msg.using_encoded(sp_core::blake2_256), + &mut msg.using_encoded($crate::blake2_256), ); }); $crate::log::debug!(target: concat!("ump::", stringify!($name)) , "Upward message processed {:?} from para_id {:?}", &msg, &from_para_id); @@ -1042,19 +1020,19 @@ macro_rules! decl_test_networks { } fn process_bridged_messages() { - use $crate::Bridge; + use $crate::{Bridge, BridgeMessageHandler, TestExt}; // Make sure both, including the target `Network` are initialized ::init(); while let Some(msg) = $crate::BRIDGED_MESSAGES.with(|b| b.borrow_mut().get_mut(Self::name()).unwrap().pop_front()) { - let dispatch_result = <::Target as TestExt>::ext_wrapper(|| { + let dispatch_result = <::Target as TestExt>::ext_wrapper(|| { <::Handler as BridgeMessageHandler>::dispatch_target_inbound_message(msg.clone()) }); match dispatch_result { Err(e) => panic!("Error {:?} processing bridged message: {:?}", e, msg.clone()), Ok(()) => { - <::Source as TestExt>::ext_wrapper(|| { + <::Source as TestExt>::ext_wrapper(|| { <::Handler as BridgeMessageHandler>::notify_source_message_delivery(msg.id); }); $crate::log::debug!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg.clone()); @@ -1068,8 +1046,6 @@ macro_rules! decl_test_networks { relay_parent_number: u32, parent_head_data: $crate::HeadData, ) -> $crate::ParachainInherentData { - use $crate::cumulus_primitives_core::{relay_chain::{HeadData, HrmpChannelId}, AbridgedHrmpChannel}; - let mut sproof = $crate::RelayStateSproofBuilder::default(); sproof.para_id = para_id.into(); @@ -1085,11 +1061,11 @@ macro_rules! decl_test_networks { sproof .hrmp_channels - .entry(HrmpChannelId { + .entry($crate::HrmpChannelId { sender: sproof.para_id, recipient: recipient_para_id, }) - .or_insert_with(|| AbridgedHrmpChannel { + .or_insert_with(|| $crate::AbridgedHrmpChannel { max_capacity: 1024, max_total_size: 1024 * 1024, max_message_size: 1024 * 1024, @@ -1139,6 +1115,7 @@ macro_rules! decl_test_bridges { } ), + + $(,)? ) => { $( #[derive(Debug)] @@ -1166,8 +1143,8 @@ macro_rules! __impl_check_assertion { impl $crate::CheckAssertion for $chain where - Origin: Chain + Clone, - Destination: Chain + Clone, + Origin: $crate::Chain + Clone, + Destination: $crate::Chain + Clone, Origin::RuntimeOrigin: $crate::OriginTrait + Clone, Destination::RuntimeOrigin: $crate::OriginTrait + Clone, @@ -1175,6 +1152,8 @@ macro_rules! __impl_check_assertion { Args: Clone, { fn check_assertion(test: $crate::Test) { + use $crate::TestExt; + let chain_name = std::any::type_name::<$chain>(); <$chain>::execute_with(|| { @@ -1194,7 +1173,7 @@ macro_rules! __impl_check_assertion { macro_rules! assert_expected_events { ( $chain:ident, vec![$( $event_pat:pat => { $($attr:ident : $condition:expr, )* }, )*] ) => { let mut message: Vec = Vec::new(); - let mut events = <$chain>::events(); + let mut events = <$chain as $crate::Chain>::events(); $( let mut event_received = false; @@ -1257,7 +1236,7 @@ macro_rules! assert_expected_events { if !message.is_empty() { // Log events as they will not be logged after the panic - <$chain>::events().iter().for_each(|event| { + <$chain as $crate::Chain>::events().iter().for_each(|event| { $crate::log::debug!(target: concat!("events::", stringify!($chain)), "{:?}", event); }); panic!("{}", message.concat()) @@ -1276,10 +1255,10 @@ macro_rules! bx { macro_rules! decl_test_sender_receiver_accounts_parameter_types { ( $( $chain:ident { sender: $sender:expr, receiver: $receiver:expr }),+ ) => { $crate::paste::paste! { - parameter_types! { + $crate::parameter_types! { $( - pub [<$chain Sender>]: $crate::AccountId = <$chain>::account_id_of($sender); - pub [<$chain Receiver>]: $crate::AccountId = <$chain>::account_id_of($receiver); + pub [<$chain Sender>]: $crate::AccountId = <$chain as $crate::Chain>::account_id_of($sender); + pub [<$chain Receiver>]: $crate::AccountId = <$chain as $crate::Chain>::account_id_of($receiver); )+ } } diff --git a/cumulus/zombienet/tests/0007-full_node_warp_sync.toml b/cumulus/zombienet/tests/0007-full_node_warp_sync.toml index 937c0b83683f19f08be2fcb4344360873cf901c7..42d1de7148d693b0a1c518adc735dc342b4db28b 100644 --- a/cumulus/zombienet/tests/0007-full_node_warp_sync.toml +++ b/cumulus/zombienet/tests/0007-full_node_warp_sync.toml @@ -3,7 +3,7 @@ default_image = "{{RELAY_IMAGE}}" default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" -chain_spec_path = "zombienet/tests/0007-warp-sync-relaychain-spec.json" +chain_spec_path = "cumulus/zombienet/tests/0007-warp-sync-relaychain-spec.json" [[relaychain.nodes]] name = "alice" @@ -28,7 +28,7 @@ chain_spec_path = "zombienet/tests/0007-warp-sync-relaychain-spec.json" [[parachains]] id = 2000 cumulus_based = true -chain_spec_path = "zombienet/tests/0007-warp-sync-parachain-spec.json" +chain_spec_path = "cumulus/zombienet/tests/0007-warp-sync-parachain-spec.json" add_to_genesis = false # Run 'dave' as parachain collator. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index fa850f6bdc2edea93f56f558ab7e99ac2610376e..5e892625fb77e7b6dc2784d315414b0191f4ba0a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -34,7 +34,7 @@ No PR should be merged until all reviews' comments are addressed. ### Labels: -The set of labels and their description can be found [here](linktobeinserted) +The set of labels and their description can be found [here](https://paritytech.github.io/labels/doc_polkadot-sdk.html). ### Process: @@ -96,9 +96,9 @@ d) that the docs team was included in the review process of a docs update We use [labels](https://github.com/paritytech/polkadot-sdk/labels) to manage PRs and issues and communicate state of a PR. Please familiarise yourself with them. Best way to get started is to a pick a ticket tagged -`[easy](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AD0-easy)` -or `[medium](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AD1-medium)` -and get going or `[mentor](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AC1-mentor)` +[easy](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AD0-easy) +or [medium](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AD1-medium) +and get going. Alternatively, look out for issues tagged [mentor](https://github.com/paritytech/polkadot-sdk/issues?q=is%3Aopen+is%3Aissue+label%3AC1-mentor) and get in contact with the mentor offering their support on that larger task. **** diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md index 15482d9e85a89b69afa95660201e75e6f247c901..1d0ef338c10b1acd1e27d3c265d6e7a35ebceb8a 100644 --- a/docs/PULL_REQUEST_TEMPLATE.md +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ ✄ ----------------------------------------------------------------------------- Thank you for your Pull Request! 🙏 Please make sure it follows the contribution -guidelines outlined in [this document](CONTRIBUTING.md) and fill out the +guidelines outlined in [this document](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md) and fill out the sections below. Once you're ready to submit your PR for review, please delete this section and leave only the text under the "Description" heading. @@ -29,7 +29,7 @@ Cumulus companion: (*if applicable*) # Checklist - [ ] My PR includes a detailed description as outlined in the "Description" section above -- [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process) of this project (at minimum one label for `T` required) +- [ ] My PR follows the [labeling requirements](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md#process) of this project (at minimum one label for `T` required) - [ ] I have made corresponding changes to the documentation (if applicable) - [ ] I have added tests that prove my fix is effective or that my feature works (if applicable) - [ ] If this PR alters any external APIs or interfaces used by Polkadot, the corresponding Polkadot PR is ready as well as the corresponding Cumulus PR (optional) diff --git a/polkadot/Cargo.toml b/polkadot/Cargo.toml index 48bc0877c0f21ad46bf30c6ccadadacba3a7c31d..f173557a0ffba1fb2b696cfb7a98cf665bac0d51 100644 --- a/polkadot/Cargo.toml +++ b/polkadot/Cargo.toml @@ -22,7 +22,7 @@ version = "1.0.0" [dependencies] color-eyre = { version = "0.6.1", default-features = false } -tikv-jemallocator = "0.5.0" +tikv-jemallocator = { version = "0.5.0", optional = true } # Crates in our workspace, defined as dependencies so we can pass them feature flags. polkadot-cli = { path = "cli", features = [ @@ -38,6 +38,9 @@ polkadot-overseer = { path = "node/overseer" } polkadot-node-core-pvf-common = { path = "node/core/pvf/common" } polkadot-node-core-pvf-execute-worker = { path = "node/core/pvf/execute-worker" } +[target.'cfg(target_os = "linux")'.dependencies] +tikv-jemallocator = "0.5.0" + [dev-dependencies] assert_cmd = "2.0.4" nix = { version = "0.26.1", features = ["signal"] } @@ -59,13 +62,16 @@ fast-runtime = [ "polkadot-cli/fast-runtime" ] runtime-metrics = [ "polkadot-cli/runtime-metrics" ] pyroscope = [ "polkadot-cli/pyroscope" ] jemalloc-allocator = [ + "dep:tikv-jemallocator", "polkadot-node-core-pvf-prepare-worker/jemalloc-allocator", + "polkadot-node-core-pvf/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator", ] # Enables timeout-based tests supposed to be run only in CI environment as they may be flaky # when run locally depending on system load ci-only-tests = [ "polkadot-node-core-pvf/ci-only-tests" ] +network-protocol-staging = [ "polkadot-cli/network-protocol-staging" ] # Configuration for building a .deb package - for use with `cargo-deb` [package.metadata.deb] diff --git a/polkadot/cli/Cargo.toml b/polkadot/cli/Cargo.toml index 2da40193e96336198daaa8210de1b3b466e154be..bcb4f2ac130863e790710ee716be819ad4081bb1 100644 --- a/polkadot/cli/Cargo.toml +++ b/polkadot/cli/Cargo.toml @@ -15,7 +15,7 @@ wasm-opt = false crate-type = ["cdylib", "rlib"] [dependencies] -clap = { version = "4.0.9", features = ["derive"], optional = true } +clap = { version = "4.4.2", features = ["derive"], optional = true } log = "0.4.17" thiserror = "1.0.31" futures = "0.3.21" diff --git a/polkadot/core-primitives/src/lib.rs b/polkadot/core-primitives/src/lib.rs index aa01cf8dfc4594d711d6d233332c412ec37961d2..a74cdef3ad763a552fcb33586eb3e1956006ee47 100644 --- a/polkadot/core-primitives/src/lib.rs +++ b/polkadot/core-primitives/src/lib.rs @@ -60,7 +60,7 @@ pub type Hash = sp_core::H256; /// Unit type wrapper around [`type@Hash`] that represents a candidate hash. /// -/// This type is produced by [`CandidateReceipt::hash`]. +/// This type is produced by `CandidateReceipt::hash`. /// /// This type makes it easy to enforce that a hash is a candidate hash on the type level. #[derive(Clone, Copy, Encode, Decode, Hash, Eq, PartialEq, Default, PartialOrd, Ord, TypeInfo)] diff --git a/polkadot/node/core/approval-voting/src/import.rs b/polkadot/node/core/approval-voting/src/import.rs index 6f376fc6fcc1e8f952d72776ec2b24a9c51de6fe..df712fc45a53d4cd21266e348247ec7f99ec09b8 100644 --- a/polkadot/node/core/approval-voting/src/import.rs +++ b/polkadot/node/core/approval-voting/src/import.rs @@ -598,7 +598,9 @@ pub(crate) mod tests { use polkadot_node_subsystem::messages::{AllMessages, ApprovalVotingMessage}; use polkadot_node_subsystem_test_helpers::make_subsystem_context; use polkadot_node_subsystem_util::database::Database; - use polkadot_primitives::{Id as ParaId, IndexedVec, SessionInfo, ValidatorId, ValidatorIndex}; + use polkadot_primitives::{ + ExecutorParams, Id as ParaId, IndexedVec, SessionInfo, ValidatorId, ValidatorIndex, + }; pub(crate) use sp_consensus_babe::{ digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest}, AllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch, @@ -835,6 +837,20 @@ pub(crate) mod tests { si_tx.send(Ok(Some(session_info.clone()))).unwrap(); } ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + req_block_hash, + RuntimeApiRequest::SessionExecutorParams(idx, si_tx), + ) + ) => { + assert_eq!(session, idx); + assert_eq!(req_block_hash, hash); + si_tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); }); futures::executor::block_on(futures::future::join(test_fut, aux_fut)); @@ -952,6 +968,20 @@ pub(crate) mod tests { si_tx.send(Ok(Some(session_info.clone()))).unwrap(); } ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + req_block_hash, + RuntimeApiRequest::SessionExecutorParams(idx, si_tx), + ) + ) => { + assert_eq!(session, idx); + assert_eq!(req_block_hash, hash); + si_tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); }); futures::executor::block_on(futures::future::join(test_fut, aux_fut)); @@ -1172,6 +1202,20 @@ pub(crate) mod tests { si_tx.send(Ok(Some(session_info.clone()))).unwrap(); } ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + req_block_hash, + RuntimeApiRequest::SessionExecutorParams(idx, si_tx), + ) + ) => { + assert_eq!(session, idx); + assert_eq!(req_block_hash, hash); + si_tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); }); futures::executor::block_on(futures::future::join(test_fut, aux_fut)); @@ -1374,6 +1418,20 @@ pub(crate) mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + req_block_hash, + RuntimeApiRequest::SessionExecutorParams(idx, si_tx), + ) + ) => { + assert_eq!(session, idx); + assert_eq!(req_block_hash, hash); + si_tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( handle.recv().await, AllMessages::ApprovalDistribution(ApprovalDistributionMessage::NewBlocks( diff --git a/polkadot/node/core/approval-voting/src/lib.rs b/polkadot/node/core/approval-voting/src/lib.rs index e99572b31c4b5fb62abc57edf6cb8c507d3b257b..0087f8e1435047dfc8e558c033c45d7d9dcf1c9d 100644 --- a/polkadot/node/core/approval-voting/src/lib.rs +++ b/polkadot/node/core/approval-voting/src/lib.rs @@ -45,13 +45,13 @@ use polkadot_node_subsystem_util::{ self, database::Database, metrics::{self, prometheus}, - runtime::{Config as RuntimeInfoConfig, RuntimeInfo}, + runtime::{Config as RuntimeInfoConfig, ExtendedSessionInfo, RuntimeInfo}, TimeoutExt, }; use polkadot_primitives::{ ApprovalVote, BlockNumber, CandidateHash, CandidateIndex, CandidateReceipt, DisputeStatement, - GroupIndex, Hash, PvfExecTimeoutKind, SessionIndex, SessionInfo, ValidDisputeStatementKind, - ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature, + ExecutorParams, GroupIndex, Hash, PvfExecTimeoutKind, SessionIndex, SessionInfo, + ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature, }; use sc_keystore::LocalKeystore; use sp_application_crypto::Pair; @@ -643,12 +643,12 @@ impl CurrentlyCheckingSet { } } -async fn get_session_info<'a, Sender>( +async fn get_extended_session_info<'a, Sender>( runtime_info: &'a mut RuntimeInfo, sender: &mut Sender, relay_parent: Hash, session_index: SessionIndex, -) -> Option<&'a SessionInfo> +) -> Option<&'a ExtendedSessionInfo> where Sender: SubsystemSender, { @@ -656,19 +656,33 @@ where .get_session_info_by_index(sender, relay_parent, session_index) .await { - Ok(extended_info) => Some(&extended_info.session_info), + Ok(extended_info) => Some(&extended_info), Err(_) => { gum::debug!( target: LOG_TARGET, session = session_index, ?relay_parent, - "Can't obtain SessionInfo" + "Can't obtain SessionInfo or ExecutorParams" ); None }, } } +async fn get_session_info<'a, Sender>( + runtime_info: &'a mut RuntimeInfo, + sender: &mut Sender, + relay_parent: Hash, + session_index: SessionIndex, +) -> Option<&'a SessionInfo> +where + Sender: SubsystemSender, +{ + get_extended_session_info(runtime_info, sender, relay_parent, session_index) + .await + .map(|extended_info| &extended_info.session_info) +} + struct State { keystore: Arc, slot_duration_millis: u64, @@ -746,6 +760,7 @@ enum Action { relay_block_hash: Hash, candidate_index: CandidateIndex, session: SessionIndex, + executor_params: ExecutorParams, candidate: CandidateReceipt, backing_group: GroupIndex, }, @@ -968,6 +983,7 @@ async fn handle_actions( relay_block_hash, candidate_index, session, + executor_params, candidate, backing_group, } => { @@ -1008,6 +1024,7 @@ async fn handle_actions( }, None => { let ctx = &mut *ctx; + currently_checking_set .insert_relay_block_hash( candidate_hash, @@ -1022,6 +1039,7 @@ async fn handle_actions( validator_index, block_hash, backing_group, + executor_params, &launch_approval_span, ) .await @@ -2328,17 +2346,18 @@ async fn process_wakeup( _ => return Ok(Vec::new()), }; - let session_info = match get_session_info( - session_info_provider, - ctx.sender(), - block_entry.parent_hash(), - block_entry.session(), - ) - .await - { - Some(i) => i, - None => return Ok(Vec::new()), - }; + let ExtendedSessionInfo { ref session_info, ref executor_params, .. } = + match get_extended_session_info( + session_info_provider, + ctx.sender(), + block_entry.parent_hash(), + block_entry.session(), + ) + .await + { + Some(i) => i, + None => return Ok(Vec::new()), + }; let block_tick = slot_number_to_tick(state.slot_duration_millis, block_entry.slot()); let no_show_duration = slot_number_to_tick( @@ -2425,6 +2444,7 @@ async fn process_wakeup( relay_block_hash: relay_block, candidate_index: i as _, session: block_entry.session(), + executor_params: executor_params.clone(), candidate: candidate_receipt, backing_group, }); @@ -2466,6 +2486,7 @@ async fn launch_approval( validator_index: ValidatorIndex, block_hash: Hash, backing_group: GroupIndex, + executor_params: ExecutorParams, span: &jaeger::Span, ) -> SubsystemResult> { let (a_tx, a_rx) = oneshot::channel(); @@ -2611,6 +2632,7 @@ async fn launch_approval( validation_code, candidate.clone(), available_data.pov, + executor_params, PvfExecTimeoutKind::Approval, val_tx, )) diff --git a/polkadot/node/core/approval-voting/src/tests.rs b/polkadot/node/core/approval-voting/src/tests.rs index f58e60c6a4879f320a850b0058e6aeb07a6d0e68..3c7b74b26fbed50d2c860ac885bf3e8ecea1665d 100644 --- a/polkadot/node/core/approval-voting/src/tests.rs +++ b/polkadot/node/core/approval-voting/src/tests.rs @@ -910,6 +910,19 @@ async fn import_block( si_tx.send(Ok(Some(session_info.clone()))).unwrap(); } ); + assert_matches!( + overseer_recv(overseer).await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + req_block_hash, + RuntimeApiRequest::SessionExecutorParams(_, si_tx), + ) + ) => { + // Make sure all SessionExecutorParams calls are not made for the leaf (but for its relay parent) + assert_ne!(req_block_hash, hashes[(number-1) as usize].0); + si_tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); } assert_matches!( @@ -2376,7 +2389,7 @@ async fn handle_double_assignment_import( assert_matches!( overseer_recv(virtual_overseer).await, - AllMessages::CandidateValidation(CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, timeout, tx)) if timeout == PvfExecTimeoutKind::Approval => { + AllMessages::CandidateValidation(CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, _, timeout, tx)) if timeout == PvfExecTimeoutKind::Approval => { tx.send(Ok(ValidationResult::Valid(Default::default(), Default::default()))) .unwrap(); } diff --git a/polkadot/node/core/backing/src/error.rs b/polkadot/node/core/backing/src/error.rs index d8f9e82d8f4828f7f65c6910f88065a153e32b16..1b00a62510b7c634b3135a56ca6412c0948ef6a0 100644 --- a/polkadot/node/core/backing/src/error.rs +++ b/polkadot/node/core/backing/src/error.rs @@ -79,6 +79,7 @@ pub enum Error { RuntimeApiUnavailable(#[source] oneshot::Canceled), #[error("a channel was closed before receipt in try_join!")] + #[fatal] JoinMultiple(#[source] oneshot::Canceled), #[error("Obtaining erasure chunks failed")] diff --git a/polkadot/node/core/backing/src/lib.rs b/polkadot/node/core/backing/src/lib.rs index 58763e6d80cc1ad31ea07cd2cedb0b4d1d9076c2..97efb3ba8089fc9ece8a53b5e8c705dd66c5dd1e 100644 --- a/polkadot/node/core/backing/src/lib.rs +++ b/polkadot/node/core/backing/src/lib.rs @@ -80,8 +80,8 @@ use futures::{ use error::{Error, FatalResult}; use polkadot_node_primitives::{ - minimum_votes, AvailableData, InvalidCandidate, PoV, SignedFullStatementWithPVD, - StatementWithPVD, ValidationResult, + AvailableData, InvalidCandidate, PoV, SignedFullStatementWithPVD, StatementWithPVD, + ValidationResult, }; use polkadot_node_subsystem::{ messages::{ @@ -96,16 +96,18 @@ use polkadot_node_subsystem::{ use polkadot_node_subsystem_util::{ self as util, backing_implicit_view::{FetchError as ImplicitViewFetchError, View as ImplicitView}, - request_from_runtime, request_session_index_for_child, request_validator_groups, - request_validators, - runtime::{prospective_parachains_mode, ProspectiveParachainsMode}, + executor_params_at_relay_parent, request_from_runtime, request_session_index_for_child, + request_validator_groups, request_validators, + runtime::{ + self, prospective_parachains_mode, request_min_backing_votes, ProspectiveParachainsMode, + }, Validator, }; use polkadot_primitives::{ BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt, - CommittedCandidateReceipt, CoreIndex, CoreState, Hash, Id as ParaId, PersistedValidationData, - PvfExecTimeoutKind, SigningContext, ValidationCode, ValidatorId, ValidatorIndex, - ValidatorSignature, ValidityAttestation, + CommittedCandidateReceipt, CoreIndex, CoreState, ExecutorParams, Hash, Id as ParaId, + PersistedValidationData, PvfExecTimeoutKind, SigningContext, ValidationCode, ValidatorId, + ValidatorIndex, ValidatorSignature, ValidityAttestation, }; use sp_keystore::KeystorePtr; use statement_table::{ @@ -219,6 +221,8 @@ struct PerRelayParentState { awaiting_validation: HashSet, /// Data needed for retrying in case of `ValidatedCandidateCommand::AttestNoPoV`. fallbacks: HashMap, + /// The minimum backing votes threshold. + minimum_backing_votes: u32, } struct PerCandidateState { @@ -400,8 +404,8 @@ impl TableContextTrait for TableContext { self.groups.get(group).map_or(false, |g| g.iter().any(|a| a == authority)) } - fn requisite_votes(&self, group: &ParaId) -> usize { - self.groups.get(group).map_or(usize::MAX, |g| minimum_votes(g.len())) + fn get_group_size(&self, group: &ParaId) -> Option { + self.groups.get(group).map(|g| g.len()) } } @@ -551,6 +555,7 @@ async fn request_candidate_validation( code: ValidationCode, candidate_receipt: CandidateReceipt, pov: Arc, + executor_params: ExecutorParams, ) -> Result { let (tx, rx) = oneshot::channel(); @@ -560,6 +565,7 @@ async fn request_candidate_validation( code, candidate_receipt, pov, + executor_params, PvfExecTimeoutKind::Backing, tx, )) @@ -626,6 +632,11 @@ async fn validate_and_make_available( } }; + let executor_params = match executor_params_at_relay_parent(relay_parent, &mut sender).await { + Ok(ep) => ep, + Err(e) => return Err(Error::UtilError(e)), + }; + let pov = match pov { PoVData::Ready(pov) => pov, PoVData::FetchFromValidator { from_validator, candidate_hash, pov_hash } => @@ -661,6 +672,7 @@ async fn validate_and_make_available( validation_code, candidate.clone(), pov.clone(), + executor_params, ) .await? }; @@ -965,28 +977,25 @@ async fn construct_per_relay_parent_state( ($x: expr) => { match $x { Ok(x) => x, - Err(e) => { - gum::warn!( - target: LOG_TARGET, - err = ?e, - "Failed to fetch runtime API data for job", - ); + Err(err) => { + // Only bubble up fatal errors. + error::log_error(Err(Into::::into(err).into()))?; // We can't do candidate validation work if we don't have the // requisite runtime API data. But these errors should not take // down the node. - return Ok(None); - } + return Ok(None) + }, } - } + }; } let parent = relay_parent; - let (validators, groups, session_index, cores) = futures::try_join!( + let (session_index, validators, groups, cores) = futures::try_join!( + request_session_index_for_child(parent, ctx.sender()).await, request_validators(parent, ctx.sender()).await, request_validator_groups(parent, ctx.sender()).await, - request_session_index_for_child(parent, ctx.sender()).await, request_from_runtime(parent, ctx.sender(), |tx| { RuntimeApiRequest::AvailabilityCores(tx) },) @@ -994,10 +1003,12 @@ async fn construct_per_relay_parent_state( ) .map_err(Error::JoinMultiple)?; + let session_index = try_runtime_api!(session_index); let validators: Vec<_> = try_runtime_api!(validators); let (validator_groups, group_rotation_info) = try_runtime_api!(groups); - let session_index = try_runtime_api!(session_index); let cores = try_runtime_api!(cores); + let minimum_backing_votes = + try_runtime_api!(request_min_backing_votes(parent, session_index, ctx.sender()).await); let signing_context = SigningContext { parent_hash: parent, session_index }; let validator = @@ -1061,6 +1072,7 @@ async fn construct_per_relay_parent_state( issued_statements: HashSet::new(), awaiting_validation: HashSet::new(), fallbacks: HashMap::new(), + minimum_backing_votes, })) } @@ -1563,10 +1575,13 @@ async fn post_import_statement_actions( rp_state: &mut PerRelayParentState, summary: Option<&TableSummary>, ) -> Result<(), Error> { - if let Some(attested) = summary - .as_ref() - .and_then(|s| rp_state.table.attested_candidate(&s.candidate, &rp_state.table_context)) - { + if let Some(attested) = summary.as_ref().and_then(|s| { + rp_state.table.attested_candidate( + &s.candidate, + &rp_state.table_context, + rp_state.minimum_backing_votes, + ) + }) { let candidate_hash = attested.candidate.hash(); // `HashSet::insert` returns true if the thing wasn't in there already. @@ -2009,7 +2024,11 @@ fn handle_get_backed_candidates_message( }; rp_state .table - .attested_candidate(&candidate_hash, &rp_state.table_context) + .attested_candidate( + &candidate_hash, + &rp_state.table_context, + rp_state.minimum_backing_votes, + ) .and_then(|attested| table_attested_to_backed(attested, &rp_state.table_context)) }) .collect(); diff --git a/polkadot/node/core/backing/src/tests/mod.rs b/polkadot/node/core/backing/src/tests/mod.rs index 054337669c07781f85514299e93c9ac8886cc5f5..f5ea827d254c6d95c59c8dac848461dd5a9eac9e 100644 --- a/polkadot/node/core/backing/src/tests/mod.rs +++ b/polkadot/node/core/backing/src/tests/mod.rs @@ -34,7 +34,7 @@ use polkadot_node_subsystem::{ use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_primitives::{ CandidateDescriptor, GroupRotationInfo, HeadData, PersistedValidationData, PvfExecTimeoutKind, - ScheduledCore, SessionIndex, + ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES, }; use sp_application_crypto::AppCrypto; use sp_keyring::Sr25519Keyring; @@ -80,6 +80,7 @@ struct TestState { head_data: HashMap, signing_context: SigningContext, relay_parent: Hash, + minimum_backing_votes: u32, } impl TestState { @@ -150,6 +151,7 @@ impl Default for TestState { validation_data, signing_context, relay_parent, + minimum_backing_votes: LEGACY_MIN_BACKING_VOTES, } } } @@ -250,6 +252,16 @@ async fn test_startup(virtual_overseer: &mut VirtualOverseer, test_state: &TestS } ); + // Check that subsystem job issues a request for the session index for child. + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(parent, RuntimeApiRequest::SessionIndexForChild(tx)) + ) if parent == test_state.relay_parent => { + tx.send(Ok(test_state.signing_context.session_index)).unwrap(); + } + ); + // Check that subsystem job issues a request for a validator set. assert_matches!( virtual_overseer.recv().await, @@ -270,23 +282,24 @@ async fn test_startup(virtual_overseer: &mut VirtualOverseer, test_state: &TestS } ); - // Check that subsystem job issues a request for the session index for child. + // Check that subsystem job issues a request for the availability cores. assert_matches!( virtual_overseer.recv().await, AllMessages::RuntimeApi( - RuntimeApiMessage::Request(parent, RuntimeApiRequest::SessionIndexForChild(tx)) + RuntimeApiMessage::Request(parent, RuntimeApiRequest::AvailabilityCores(tx)) ) if parent == test_state.relay_parent => { - tx.send(Ok(test_state.signing_context.session_index)).unwrap(); + tx.send(Ok(test_state.availability_cores.clone())).unwrap(); } ); - // Check that subsystem job issues a request for the availability cores. + // Check if subsystem job issues a request for the minimum backing votes. assert_matches!( virtual_overseer.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request(parent, RuntimeApiRequest::AvailabilityCores(tx)) - ) if parent == test_state.relay_parent => { - tx.send(Ok(test_state.availability_cores.clone())).unwrap(); + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + parent, + RuntimeApiRequest::MinimumBackingVotes(session_index, tx), + )) if parent == test_state.relay_parent && session_index == test_state.signing_context.session_index => { + tx.send(Ok(test_state.minimum_backing_votes)).unwrap(); } ); } @@ -335,6 +348,24 @@ fn backing_second_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( @@ -343,6 +374,7 @@ fn backing_second_works() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -481,6 +513,24 @@ fn backing_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + // Sending a `Statement::Seconded` for our assignment will start // validation process. The first thing requested is the PoV. assert_matches!( @@ -506,6 +556,7 @@ fn backing_works() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -665,6 +716,24 @@ fn backing_works_while_validation_ongoing() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + // Sending a `Statement::Seconded` for our assignment will start // validation process. The first thing requested is PoV from the // `PoVDistribution`. @@ -691,6 +760,7 @@ fn backing_works_while_validation_ongoing() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -837,6 +907,24 @@ fn backing_misbehavior_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::AvailabilityDistribution( @@ -858,6 +946,7 @@ fn backing_misbehavior_works() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1023,6 +1112,24 @@ fn backing_dont_second_invalid() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( @@ -1031,6 +1138,7 @@ fn backing_dont_second_invalid() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1069,6 +1177,24 @@ fn backing_dont_second_invalid() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( @@ -1077,6 +1203,7 @@ fn backing_dont_second_invalid() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1187,6 +1314,24 @@ fn backing_second_after_first_fails_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + // Subsystem requests PoV and requests validation. assert_matches!( virtual_overseer.recv().await, @@ -1210,6 +1355,7 @@ fn backing_second_after_first_fails_works() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1276,6 +1422,24 @@ fn backing_second_after_first_fails_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( @@ -1344,6 +1508,24 @@ fn backing_works_after_failed_validation() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + // Subsystem requests PoV and requests validation. assert_matches!( virtual_overseer.recv().await, @@ -1367,6 +1549,7 @@ fn backing_works_after_failed_validation() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1553,6 +1736,24 @@ fn retry_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + // Subsystem requests PoV and requests validation. // We cancel - should mean retry on next backing statement. assert_matches!( @@ -1573,7 +1774,7 @@ fn retry_works() { virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await; // Not deterministic which message comes first: - for _ in 0u32..3 { + for _ in 0u32..5 { match virtual_overseer.recv().await { AllMessages::Provisioner(ProvisionerMessage::ProvisionableData( _, @@ -1592,6 +1793,18 @@ fn retry_works() { )) if hash == validation_code.hash() => { tx.send(Ok(Some(validation_code.clone()))).unwrap(); }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + tx.send(Ok(1u32.into())).unwrap(); + }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(sess_idx, tx), + )) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + }, msg => { assert!(false, "Unexpected message: {:?}", msg); }, @@ -1611,6 +1824,24 @@ fn retry_works() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::AvailabilityDistribution( @@ -1634,6 +1865,7 @@ fn retry_works() { _validation_code, candidate_receipt, _pov, + _, timeout, .. ), @@ -1808,6 +2040,24 @@ fn cannot_second_multiple_candidates_per_parent() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( @@ -1816,6 +2066,7 @@ fn cannot_second_multiple_candidates_per_parent() { _validation_code, candidate_receipt, _pov, + _, timeout, tx, ), @@ -1894,6 +2145,24 @@ fn cannot_second_multiple_candidates_per_parent() { } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + assert_matches!( virtual_overseer.recv().await, AllMessages::CandidateValidation( diff --git a/polkadot/node/core/backing/src/tests/prospective_parachains.rs b/polkadot/node/core/backing/src/tests/prospective_parachains.rs index 7c2773c8e3b6b1a4c6af62ef44af7edb95d1e498..07e2a3a89bb66a573b00e59e05aaa96eae38ae72 100644 --- a/polkadot/node/core/backing/src/tests/prospective_parachains.rs +++ b/polkadot/node/core/backing/src/tests/prospective_parachains.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -138,13 +138,24 @@ async fn activate_leaf( } for (hash, number) in ancestry_iter.take(requested_len) { - // Check that subsystem job issues a request for a validator set. let msg = match next_overseer_message.take() { Some(msg) => msg, None => virtual_overseer.recv().await, }; + + // Check that subsystem job issues a request for the session index for child. assert_matches!( msg, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(parent, RuntimeApiRequest::SessionIndexForChild(tx)) + ) if parent == hash => { + tx.send(Ok(test_state.signing_context.session_index)).unwrap(); + } + ); + + // Check that subsystem job issues a request for a validator set. + assert_matches!( + virtual_overseer.recv().await, AllMessages::RuntimeApi( RuntimeApiMessage::Request(parent, RuntimeApiRequest::Validators(tx)) ) if parent == hash => { @@ -164,23 +175,24 @@ async fn activate_leaf( } ); - // Check that subsystem job issues a request for the session index for child. + // Check that subsystem job issues a request for the availability cores. assert_matches!( virtual_overseer.recv().await, AllMessages::RuntimeApi( - RuntimeApiMessage::Request(parent, RuntimeApiRequest::SessionIndexForChild(tx)) + RuntimeApiMessage::Request(parent, RuntimeApiRequest::AvailabilityCores(tx)) ) if parent == hash => { - tx.send(Ok(test_state.signing_context.session_index)).unwrap(); + tx.send(Ok(test_state.availability_cores.clone())).unwrap(); } ); - // Check that subsystem job issues a request for the availability cores. + // Check if subsystem job issues a request for the minimum backing votes. assert_matches!( virtual_overseer.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request(parent, RuntimeApiRequest::AvailabilityCores(tx)) - ) if parent == hash => { - tx.send(Ok(test_state.availability_cores.clone())).unwrap(); + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + parent, + RuntimeApiRequest::MinimumBackingVotes(session_index, tx), + )) if parent == hash && session_index == test_state.signing_context.session_index => { + tx.send(Ok(test_state.minimum_backing_votes)).unwrap(); } ); } @@ -205,6 +217,24 @@ async fn assert_validate_seconded_candidate( } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) + ) => { + tx.send(Ok(1u32.into())).unwrap(); + } + ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(sess_idx, tx)) + ) if sess_idx == 1 => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + } + ); + if fetch_pov { assert_matches!( virtual_overseer.recv().await, @@ -227,6 +257,7 @@ async fn assert_validate_seconded_candidate( _validation_code, candidate_receipt, _pov, + _, timeout, tx, )) if &_pvd == pvd && @@ -1327,7 +1358,7 @@ fn concurrent_dependent_candidates() { tx.send(pov.clone()).unwrap(); }, AllMessages::CandidateValidation( - CandidateValidationMessage::ValidateFromExhaustive(.., candidate, _, _, tx), + CandidateValidationMessage::ValidateFromExhaustive(.., candidate, _, _, _, tx), ) => { let candidate_hash = candidate.hash(); let (head_data, pvd) = if candidate_hash == candidate_a_hash { @@ -1384,6 +1415,20 @@ fn concurrent_dependent_candidates() { break } }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + tx.send(Ok(1u32.into())).unwrap(); + }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(sess_idx, tx), + )) => { + assert_eq!(sess_idx, 1); + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + }, + _ => panic!("unexpected message received from overseer: {:?}", msg), } } diff --git a/polkadot/node/core/candidate-validation/Cargo.toml b/polkadot/node/core/candidate-validation/Cargo.toml index 3935c91d8977e4d5e91ba2da979c019ce0fb2802..a2e88778532f754cd429c5c156fe27cf5dd88d75 100644 --- a/polkadot/node/core/candidate-validation/Cargo.toml +++ b/polkadot/node/core/candidate-validation/Cargo.toml @@ -16,7 +16,7 @@ sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", path = "../.. parity-scale-codec = { version = "3.6.1", default-features = false, features = ["bit-vec", "derive"] } polkadot-primitives = { path = "../../../primitives" } -polkadot-parachain = { path = "../../../parachain" } +polkadot-parachain-primitives = { path = "../../../parachain" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/polkadot/node/core/candidate-validation/src/lib.rs b/polkadot/node/core/candidate-validation/src/lib.rs index f53f2a6aee066c236827001ad8149cf67b74cf7f..3281fcc59a158cc49c07009d43e9de29d42b9d02 100644 --- a/polkadot/node/core/candidate-validation/src/lib.rs +++ b/polkadot/node/core/candidate-validation/src/lib.rs @@ -40,7 +40,9 @@ use polkadot_node_subsystem::{ SubsystemSender, }; use polkadot_node_subsystem_util::executor_params_at_relay_parent; -use polkadot_parachain::primitives::{ValidationParams, ValidationResult as WasmValidationResult}; +use polkadot_parachain_primitives::primitives::{ + ValidationParams, ValidationResult as WasmValidationResult, +}; use polkadot_primitives::{ CandidateCommitments, CandidateDescriptor, CandidateReceipt, ExecutorParams, Hash, OccupiedCoreAssumption, PersistedValidationData, PvfExecTimeoutKind, PvfPrepTimeoutKind, @@ -111,10 +113,7 @@ pub struct CandidateValidationSubsystem { } impl CandidateValidationSubsystem { - /// Create a new `CandidateValidationSubsystem` with the given task spawner and isolation - /// strategy. - /// - /// Check out [`IsolationStrategy`] to get more details. + /// Create a new `CandidateValidationSubsystem`. pub fn with_config( config: Option, metrics: Metrics, @@ -165,6 +164,7 @@ async fn run( CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ) => { @@ -180,6 +180,7 @@ async fn run( validation_host, candidate_receipt, pov, + executor_params, timeout, &metrics, ) @@ -197,23 +198,23 @@ async fn run( validation_code, candidate_receipt, pov, + executor_params, timeout, response_sender, ) => { let bg = { - let mut sender = ctx.sender().clone(); let metrics = metrics.clone(); let validation_host = validation_host.clone(); async move { let _timer = metrics.time_validate_from_exhaustive(); let res = validate_candidate_exhaustive( - &mut sender, validation_host, persisted_validation_data, validation_code, candidate_receipt, pov, + executor_params, timeout, &metrics, ) @@ -498,6 +499,7 @@ async fn validate_from_chain_state( validation_host: ValidationHost, candidate_receipt: CandidateReceipt, pov: Arc, + executor_params: ExecutorParams, exec_timeout_kind: PvfExecTimeoutKind, metrics: &Metrics, ) -> Result @@ -512,12 +514,12 @@ where }; let validation_result = validate_candidate_exhaustive( - sender, validation_host, validation_data, validation_code, candidate_receipt.clone(), pov, + executor_params, exec_timeout_kind, metrics, ) @@ -547,19 +549,16 @@ where validation_result } -async fn validate_candidate_exhaustive( - sender: &mut Sender, +async fn validate_candidate_exhaustive( mut validation_backend: impl ValidationBackend + Send, persisted_validation_data: PersistedValidationData, validation_code: ValidationCode, candidate_receipt: CandidateReceipt, pov: Arc, + executor_params: ExecutorParams, exec_timeout_kind: PvfExecTimeoutKind, metrics: &Metrics, -) -> Result -where - Sender: SubsystemSender, -{ +) -> Result { let _timer = metrics.time_validate_candidate_exhaustive(); let validation_code_hash = validation_code.hash(); @@ -616,27 +615,6 @@ where relay_parent_storage_root: persisted_validation_data.relay_parent_storage_root, }; - let executor_params = if let Ok(executor_params) = - executor_params_at_relay_parent(candidate_receipt.descriptor.relay_parent, sender).await - { - gum::debug!( - target: LOG_TARGET, - ?validation_code_hash, - ?para_id, - "Acquired executor params for the session: {:?}", - executor_params, - ); - executor_params - } else { - gum::warn!( - target: LOG_TARGET, - ?validation_code_hash, - ?para_id, - "Failed to acquire executor params for the session", - ); - return Ok(ValidationResult::Invalid(InvalidCandidate::BadParent)) - }; - let result = validation_backend .validate_candidate_with_retry( raw_validation_code.to_vec(), diff --git a/polkadot/node/core/candidate-validation/src/tests.rs b/polkadot/node/core/candidate-validation/src/tests.rs index 2dcead4db466510001f732e61ab542c78b8829e5..af530a20c4e0ca61fcf44f4ce0e3121ffeab1363 100644 --- a/polkadot/node/core/candidate-validation/src/tests.rs +++ b/polkadot/node/core/candidate-validation/src/tests.rs @@ -26,37 +26,6 @@ use polkadot_primitives::{HeadData, Id as ParaId, UpwardMessage}; use sp_core::testing::TaskExecutor; use sp_keyring::Sr25519Keyring; -fn test_with_executor_params, R, M>( - mut ctx_handle: test_helpers::TestSubsystemContextHandle, - test: impl FnOnce() -> T, -) -> R { - let test_fut = test(); - - let overseer = async move { - assert_matches!( - ctx_handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx)) - ) => { - tx.send(Ok(1u32.into())).unwrap(); - } - ); - assert_matches!( - ctx_handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(_, tx)) - ) => { - tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); - } - ); - }; - - futures::pin_mut!(test_fut); - futures::pin_mut!(overseer); - let v = executor::block_on(future::join(test_fut, overseer)); - v.0 -} - #[test] fn correctly_checks_included_assumption() { let validation_data: PersistedValidationData = Default::default(); @@ -460,23 +429,16 @@ fn candidate_validation_ok_is_ok() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), - validation_data.clone(), - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }) + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), + validation_data.clone(), + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )) .unwrap(); assert_matches!(v, ValidationResult::Valid(outputs, used_validation_data) => { @@ -517,27 +479,21 @@ fn candidate_validation_bad_return_is_invalid() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result(Err( - ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout), - )), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }); + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result(Err( + ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout), + )), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )) + .unwrap(); - assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::Timeout))); + assert_matches!(v, ValidationResult::Invalid(InvalidCandidate::Timeout)); } // Test that we vote valid if we get `AmbiguousWorkerDeath`, retry, and then succeed. @@ -588,26 +544,19 @@ fn candidate_validation_one_ambiguous_error_is_valid() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result_list(vec![ - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), - Ok(validation_result), - ]), - validation_data.clone(), - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }) + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result_list(vec![ + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), + Ok(validation_result), + ]), + validation_data.clone(), + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )) .unwrap(); assert_matches!(v, ValidationResult::Valid(outputs, used_validation_data) => { @@ -648,26 +597,19 @@ fn candidate_validation_multiple_ambiguous_errors_is_invalid() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result_list(vec![ - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), - ]), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }) + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result_list(vec![ + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), + ]), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )) .unwrap(); assert_matches!(v, ValidationResult::Invalid(InvalidCandidate::ExecutionError(_))); @@ -702,29 +644,22 @@ fn candidate_validation_retry_internal_errors() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result_list(vec![ - Err(InternalValidationError::HostCommunication("foo".into()).into()), - // Throw an AWD error, we should still retry again. - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), - // Throw another internal error. - Err(InternalValidationError::HostCommunication("bar".into()).into()), - ]), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }); + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result_list(vec![ + Err(InternalValidationError::HostCommunication("foo".into()).into()), + // Throw an AWD error, we should still retry again. + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), + // Throw another internal error. + Err(InternalValidationError::HostCommunication("bar".into()).into()), + ]), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )); assert_matches!(v, Err(ValidationFailed(s)) if s.contains("bar")); } @@ -758,29 +693,22 @@ fn candidate_validation_retry_panic_errors() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result_list(vec![ - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("foo".into()))), - // Throw an AWD error, we should still retry again. - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), - // Throw another panic error. - Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("bar".into()))), - ]), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }); + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result_list(vec![ + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("foo".into()))), + // Throw an AWD error, we should still retry again. + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)), + // Throw another panic error. + Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("bar".into()))), + ]), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )); assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::ExecutionError(s))) if s == "bar".to_string()); } @@ -813,25 +741,18 @@ fn candidate_validation_timeout_is_internal_error() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result(Err( - ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout), - )), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }); + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result(Err( + ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout), + )), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )); assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::Timeout))); } @@ -867,23 +788,16 @@ fn candidate_validation_commitment_hash_mismatch_is_invalid() { hrmp_watermark: 12345, }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let result = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }) + let result = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )) .unwrap(); // Ensure `post validation` check on the commitments hash works as expected. @@ -919,11 +833,9 @@ fn candidate_validation_code_mismatch_is_invalid() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; let pool = TaskExecutor::new(); - let (mut ctx, _ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); + let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::(pool.clone()); let v = executor::block_on(validate_candidate_exhaustive( - ctx.sender(), MockValidateCandidateBackend::with_hardcoded_result(Err( ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout), )), @@ -931,6 +843,7 @@ fn candidate_validation_code_mismatch_is_invalid() { validation_code, candidate_receipt, Arc::new(pov), + ExecutorParams::default(), PvfExecTimeoutKind::Backing, &Default::default(), )) @@ -981,23 +894,16 @@ fn compressed_code_works() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() }; - let pool = TaskExecutor::new(); - let (mut ctx, ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); - let metrics = Metrics::default(); - - let v = test_with_executor_params(ctx_handle, || { - validate_candidate_exhaustive( - ctx.sender(), - MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), - validation_data, - validation_code, - candidate_receipt, - Arc::new(pov), - PvfExecTimeoutKind::Backing, - &metrics, - ) - }); + let v = executor::block_on(validate_candidate_exhaustive( + MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), + validation_data, + validation_code, + candidate_receipt, + Arc::new(pov), + ExecutorParams::default(), + PvfExecTimeoutKind::Backing, + &Default::default(), + )); assert_matches!(v, Ok(ValidationResult::Valid(_, _))); } @@ -1037,16 +943,15 @@ fn code_decompression_failure_is_error() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; let pool = TaskExecutor::new(); - let (mut ctx, _ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); + let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::(pool.clone()); let v = executor::block_on(validate_candidate_exhaustive( - ctx.sender(), MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), validation_data, validation_code, candidate_receipt, Arc::new(pov), + ExecutorParams::default(), PvfExecTimeoutKind::Backing, &Default::default(), )); @@ -1090,16 +995,15 @@ fn pov_decompression_failure_is_invalid() { let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() }; let pool = TaskExecutor::new(); - let (mut ctx, _ctx_handle) = - test_helpers::make_subsystem_context::(pool.clone()); + let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::(pool.clone()); let v = executor::block_on(validate_candidate_exhaustive( - ctx.sender(), MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)), validation_data, validation_code, candidate_receipt, Arc::new(pov), + ExecutorParams::default(), PvfExecTimeoutKind::Backing, &Default::default(), )); diff --git a/polkadot/node/core/dispute-coordinator/src/import.rs b/polkadot/node/core/dispute-coordinator/src/import.rs index 0da3723ebf229cadf88969f8db9ba54daf863742..cf51ae4d3655e935859878fbc67564dfafbf1a9e 100644 --- a/polkadot/node/core/dispute-coordinator/src/import.rs +++ b/polkadot/node/core/dispute-coordinator/src/import.rs @@ -34,8 +34,9 @@ use polkadot_node_primitives::{ use polkadot_node_subsystem::overseer; use polkadot_node_subsystem_util::runtime::RuntimeInfo; use polkadot_primitives::{ - CandidateReceipt, DisputeStatement, Hash, IndexedVec, SessionIndex, SessionInfo, - ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature, + CandidateReceipt, DisputeStatement, ExecutorParams, Hash, IndexedVec, SessionIndex, + SessionInfo, ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorPair, + ValidatorSignature, }; use sc_keystore::LocalKeystore; @@ -47,6 +48,8 @@ pub struct CandidateEnvironment<'a> { session_index: SessionIndex, /// Session for above index. session: &'a SessionInfo, + /// Executor parameters for the session. + executor_params: &'a ExecutorParams, /// Validator indices controlled by this node. controlled_indices: HashSet, } @@ -63,17 +66,17 @@ impl<'a> CandidateEnvironment<'a> { session_index: SessionIndex, relay_parent: Hash, ) -> Option> { - let session_info = match runtime_info + let (session, executor_params) = match runtime_info .get_session_info_by_index(ctx.sender(), relay_parent, session_index) .await { - Ok(extended_session_info) => &extended_session_info.session_info, + Ok(extended_session_info) => + (&extended_session_info.session_info, &extended_session_info.executor_params), Err(_) => return None, }; - let controlled_indices = - find_controlled_validator_indices(keystore, &session_info.validators); - Some(Self { session_index, session: session_info, controlled_indices }) + let controlled_indices = find_controlled_validator_indices(keystore, &session.validators); + Some(Self { session_index, session, executor_params, controlled_indices }) } /// Validators in the candidate's session. @@ -86,6 +89,11 @@ impl<'a> CandidateEnvironment<'a> { &self.session } + /// Executor parameters for the candidate's session + pub fn executor_params(&self) -> &ExecutorParams { + &self.executor_params + } + /// Retrieve `SessionIndex` for this environment. pub fn session_index(&self) -> SessionIndex { self.session_index diff --git a/polkadot/node/core/dispute-coordinator/src/initialized.rs b/polkadot/node/core/dispute-coordinator/src/initialized.rs index c1d02ef976cb666f056ffa24602fd1affb9971d1..2d8e15064e4736776864b3a2ecfb8b37960002ef 100644 --- a/polkadot/node/core/dispute-coordinator/src/initialized.rs +++ b/polkadot/node/core/dispute-coordinator/src/initialized.rs @@ -1160,6 +1160,7 @@ impl Initialized { ParticipationRequest::new( new_state.candidate_receipt().clone(), session, + env.executor_params().clone(), request_timer, ), ) @@ -1270,7 +1271,7 @@ impl Initialized { if import_result.has_fresh_byzantine_threshold_against() { let blocks_including = self.scraper.get_blocks_including_candidate(&candidate_hash); for (parent_block_number, parent_block_hash) in &blocks_including { - gum::trace!( + gum::warn!( target: LOG_TARGET, ?candidate_hash, ?parent_block_number, @@ -1281,7 +1282,7 @@ impl Initialized { if blocks_including.len() > 0 { ctx.send_message(ChainSelectionMessage::RevertBlocks(blocks_including)).await; } else { - gum::debug!( + gum::warn!( target: LOG_TARGET, ?candidate_hash, ?session, diff --git a/polkadot/node/core/dispute-coordinator/src/lib.rs b/polkadot/node/core/dispute-coordinator/src/lib.rs index f7e3d0657f2d941ff9a6b96dbbbb8c977663d566..3f0fd4013141925fb57e462934b0312698c89291 100644 --- a/polkadot/node/core/dispute-coordinator/src/lib.rs +++ b/polkadot/node/core/dispute-coordinator/src/lib.rs @@ -398,6 +398,7 @@ impl DisputeCoordinatorSubsystem { ParticipationRequest::new( vote_state.votes().candidate_receipt.clone(), session, + env.executor_params().clone(), request_timer, ), )); diff --git a/polkadot/node/core/dispute-coordinator/src/participation/mod.rs b/polkadot/node/core/dispute-coordinator/src/participation/mod.rs index 25b7352807f6b540c0de0973800ecb6ce983804e..5a3c4be90aa0107a245a16e97c303a568a083851 100644 --- a/polkadot/node/core/dispute-coordinator/src/participation/mod.rs +++ b/polkadot/node/core/dispute-coordinator/src/participation/mod.rs @@ -366,6 +366,7 @@ async fn participate( validation_code, req.candidate_receipt().clone(), available_data.pov, + req.executor_params(), PvfExecTimeoutKind::Approval, validation_tx, )) diff --git a/polkadot/node/core/dispute-coordinator/src/participation/queues/mod.rs b/polkadot/node/core/dispute-coordinator/src/participation/queues/mod.rs index 8a4374999f88392c58eb60d5120a5b957090f9c9..1105135a747f2a6fb16c5f1cf8e21c6ef9c0271b 100644 --- a/polkadot/node/core/dispute-coordinator/src/participation/queues/mod.rs +++ b/polkadot/node/core/dispute-coordinator/src/participation/queues/mod.rs @@ -21,7 +21,9 @@ use std::{ use futures::channel::oneshot; use polkadot_node_subsystem::{messages::ChainApiMessage, overseer}; -use polkadot_primitives::{BlockNumber, CandidateHash, CandidateReceipt, Hash, SessionIndex}; +use polkadot_primitives::{ + BlockNumber, CandidateHash, CandidateReceipt, ExecutorParams, Hash, SessionIndex, +}; use crate::{ error::{FatalError, FatalResult, Result}, @@ -73,6 +75,7 @@ pub struct ParticipationRequest { candidate_hash: CandidateHash, candidate_receipt: CandidateReceipt, session: SessionIndex, + executor_params: ExecutorParams, request_timer: Option, // Sends metric data when request is dropped } @@ -120,9 +123,16 @@ impl ParticipationRequest { pub fn new( candidate_receipt: CandidateReceipt, session: SessionIndex, + executor_params: ExecutorParams, request_timer: Option, ) -> Self { - Self { candidate_hash: candidate_receipt.hash(), candidate_receipt, session, request_timer } + Self { + candidate_hash: candidate_receipt.hash(), + candidate_receipt, + session, + executor_params, + request_timer, + } } pub fn candidate_receipt(&'_ self) -> &'_ CandidateReceipt { @@ -134,6 +144,9 @@ impl ParticipationRequest { pub fn session(&self) -> SessionIndex { self.session } + pub fn executor_params(&self) -> ExecutorParams { + self.executor_params.clone() + } pub fn discard_timer(&mut self) { if let Some(timer) = self.request_timer.take() { timer.stop_and_discard(); @@ -150,11 +163,17 @@ impl ParticipationRequest { #[cfg(test)] impl PartialEq for ParticipationRequest { fn eq(&self, other: &Self) -> bool { - let ParticipationRequest { candidate_receipt, candidate_hash, session, request_timer: _ } = - self; + let ParticipationRequest { + candidate_receipt, + candidate_hash, + session, + executor_params, + request_timer: _, + } = self; candidate_receipt == other.candidate_receipt() && candidate_hash == other.candidate_hash() && - *session == other.session() + *session == other.session() && + executor_params.hash() == other.executor_params.hash() } } #[cfg(test)] diff --git a/polkadot/node/core/dispute-coordinator/src/participation/queues/tests.rs b/polkadot/node/core/dispute-coordinator/src/participation/queues/tests.rs index d4f43639ce87f9091c5d4b5493c3e617850dbbb3..63bfc1d7d026cc7ae406f138d332d42b56fb5949 100644 --- a/polkadot/node/core/dispute-coordinator/src/participation/queues/tests.rs +++ b/polkadot/node/core/dispute-coordinator/src/participation/queues/tests.rs @@ -27,7 +27,7 @@ fn make_participation_request(hash: Hash) -> ParticipationRequest { // make it differ: receipt.commitments_hash = hash; let request_timer = Metrics::default().time_participation_pipeline(); - ParticipationRequest::new(receipt, 1, request_timer) + ParticipationRequest::new(receipt, 1, Default::default(), request_timer) } /// Make dummy comparator for request, based on the given block number. @@ -46,6 +46,7 @@ fn clone_request(request: &ParticipationRequest) -> ParticipationRequest { candidate_receipt: request.candidate_receipt.clone(), candidate_hash: request.candidate_hash, session: request.session, + executor_params: request.executor_params.clone(), request_timer: None, } } diff --git a/polkadot/node/core/dispute-coordinator/src/participation/tests.rs b/polkadot/node/core/dispute-coordinator/src/participation/tests.rs index 32725a3ac658df73bc25536b99a89a712f82833b..a2e8e88cb674a3e760b88d49c5409188203008d0 100644 --- a/polkadot/node/core/dispute-coordinator/src/participation/tests.rs +++ b/polkadot/node/core/dispute-coordinator/src/participation/tests.rs @@ -73,7 +73,8 @@ async fn participate_with_commitments_hash( let session = 1; let request_timer = participation.metrics.time_participation_pipeline(); - let req = ParticipationRequest::new(candidate_receipt, session, request_timer); + let req = + ParticipationRequest::new(candidate_receipt, session, Default::default(), request_timer); participation .queue_participation(ctx, ParticipationPriority::BestEffort, req) @@ -120,7 +121,7 @@ pub async fn participation_full_happy_path( assert_matches!( ctx_handle.recv().await, AllMessages::CandidateValidation( - CandidateValidationMessage::ValidateFromExhaustive(_, _, candidate_receipt, _, timeout, tx) + CandidateValidationMessage::ValidateFromExhaustive(_, _, candidate_receipt, _, _, timeout, tx) ) if timeout == PvfExecTimeoutKind::Approval => { if expected_commitments_hash != candidate_receipt.commitments_hash { tx.send(Ok(ValidationResult::Invalid(InvalidCandidate::CommitmentsHashMismatch))).unwrap(); @@ -455,7 +456,7 @@ fn cast_invalid_vote_if_validation_fails_or_is_invalid() { assert_matches!( ctx_handle.recv().await, AllMessages::CandidateValidation( - CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, timeout, tx) + CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, _, timeout, tx) ) if timeout == PvfExecTimeoutKind::Approval => { tx.send(Ok(ValidationResult::Invalid(InvalidCandidate::Timeout))).unwrap(); }, @@ -492,7 +493,7 @@ fn cast_invalid_vote_if_commitments_dont_match() { assert_matches!( ctx_handle.recv().await, AllMessages::CandidateValidation( - CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, timeout, tx) + CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, _, timeout, tx) ) if timeout == PvfExecTimeoutKind::Approval => { tx.send(Ok(ValidationResult::Invalid(InvalidCandidate::CommitmentsHashMismatch))).unwrap(); }, @@ -529,7 +530,7 @@ fn cast_valid_vote_if_validation_passes() { assert_matches!( ctx_handle.recv().await, AllMessages::CandidateValidation( - CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, timeout, tx) + CandidateValidationMessage::ValidateFromExhaustive(_, _, _, _, _, timeout, tx) ) if timeout == PvfExecTimeoutKind::Approval => { tx.send(Ok(ValidationResult::Valid(dummy_candidate_commitments(None), PersistedValidationData::default()))).unwrap(); }, diff --git a/polkadot/node/core/dispute-coordinator/src/scraping/candidates.rs b/polkadot/node/core/dispute-coordinator/src/scraping/candidates.rs index 38956700545cd46971120a415310880c2b6c3b9f..b1870164cb88cadaad7019ca0be5a0f23f5a3454 100644 --- a/polkadot/node/core/dispute-coordinator/src/scraping/candidates.rs +++ b/polkadot/node/core/dispute-coordinator/src/scraping/candidates.rs @@ -135,11 +135,14 @@ impl ScrapedCandidates { } pub fn insert(&mut self, block_number: BlockNumber, candidate_hash: CandidateHash) { - self.candidates.insert(candidate_hash); - self.candidates_by_block_number + if self + .candidates_by_block_number .entry(block_number) .or_default() - .insert(candidate_hash); + .insert(candidate_hash) + { + self.candidates.insert(candidate_hash); + } } // Used only for tests to verify the pruning doesn't leak data. @@ -159,6 +162,8 @@ mod scraped_candidates_tests { let mut candidates = ScrapedCandidates::new(); let target = CandidateHash(BlakeTwo256::hash(&vec![1, 2, 3])); candidates.insert(1, target); + // Repeated inserts at same height should be fine: + candidates.insert(1, target); assert!(candidates.contains(&target)); diff --git a/polkadot/node/core/dispute-coordinator/src/tests.rs b/polkadot/node/core/dispute-coordinator/src/tests.rs index 75eae8200dc6afa0ea5b5446b0ecc78564602d1f..8d6a2e10396286c605df620b0d89776cc7045bba 100644 --- a/polkadot/node/core/dispute-coordinator/src/tests.rs +++ b/polkadot/node/core/dispute-coordinator/src/tests.rs @@ -63,9 +63,9 @@ use polkadot_node_subsystem_test_helpers::{ }; use polkadot_primitives::{ ApprovalVote, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, - CandidateReceipt, CoreIndex, DisputeStatement, GroupIndex, Hash, HeadData, Header, IndexedVec, - MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex, SessionInfo, SigningContext, - ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorSignature, + CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, GroupIndex, Hash, HeadData, + Header, IndexedVec, MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex, SessionInfo, + SigningContext, ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorSignature, }; use crate::{ @@ -347,6 +347,17 @@ impl TestState { let _ = tx.send(Ok(Some(self.session_info()))); } ); + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionExecutorParams(session_index, tx), + )) => { + assert_eq!(h, block_hash); + assert_eq!(session_index, i); + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); } } @@ -3482,6 +3493,16 @@ fn session_info_is_requested_only_once() { let _ = tx.send(Ok(Some(test_state.session_info()))); } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(session_index, tx), + )) => { + assert_eq!(session_index, 2); + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); test_state }) }); @@ -3532,6 +3553,16 @@ fn session_info_big_jump_works() { let _ = tx.send(Ok(Some(test_state.session_info()))); } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(session_index, tx), + )) => { + assert_eq!(session_index, expected_idx); + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); } test_state }) @@ -3582,6 +3613,16 @@ fn session_info_small_jump_works() { let _ = tx.send(Ok(Some(test_state.session_info()))); } ); + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(session_index, tx), + )) => { + assert_eq!(session_index, expected_idx); + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); } test_state }) diff --git a/polkadot/node/core/parachains-inherent/src/lib.rs b/polkadot/node/core/parachains-inherent/src/lib.rs index 3063147fb1360ad87f76c7a2605104677e893104..1de3cab32bed1678822438b22b95b43028a01784 100644 --- a/polkadot/node/core/parachains-inherent/src/lib.rs +++ b/polkadot/node/core/parachains-inherent/src/lib.rs @@ -19,7 +19,7 @@ //! Parachain backing and approval is an off-chain process, but the parachain needs to progress on //! chain as well. To make it progress on chain a block producer needs to forward information about //! the state of a parachain to the runtime. This information is forwarded through an inherent to -//! the runtime. Here we provide the [`ParachainInherentDataProvider`] that requests the relevant +//! the runtime. Here we provide the [`ParachainsInherentDataProvider`] that requests the relevant //! data from the provisioner subsystem and creates the the inherent data that the runtime will use //! to create an inherent. diff --git a/polkadot/node/core/prospective-parachains/src/error.rs b/polkadot/node/core/prospective-parachains/src/error.rs index 0ad98d1ff9088087dc096d14d20e432dba85264a..2b0933ab1c7e03e1a020d3cdc2c4953dfd9d294a 100644 --- a/polkadot/node/core/prospective-parachains/src/error.rs +++ b/polkadot/node/core/prospective-parachains/src/error.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/core/prospective-parachains/src/fragment_tree.rs b/polkadot/node/core/prospective-parachains/src/fragment_tree.rs index ec06f2d6070e58139365ef558c9464195f0367c6..ed2988fcb39f2be0768b1d9c0cb927689223e955 100644 --- a/polkadot/node/core/prospective-parachains/src/fragment_tree.rs +++ b/polkadot/node/core/prospective-parachains/src/fragment_tree.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/core/prospective-parachains/src/lib.rs b/polkadot/node/core/prospective-parachains/src/lib.rs index a7f37d873d6a84525a8dc6ab3cf0aac886e3e09e..6e5844a62a16b2387dc9bc7c3d515102fe0828e8 100644 --- a/polkadot/node/core/prospective-parachains/src/lib.rs +++ b/polkadot/node/core/prospective-parachains/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/core/prospective-parachains/src/metrics.rs b/polkadot/node/core/prospective-parachains/src/metrics.rs index d7a1760bb4597e18eb49d1f5efcbde374f1443a2..57061497a1c0d2923dedeea341a4cf4cf2ed8807 100644 --- a/polkadot/node/core/prospective-parachains/src/metrics.rs +++ b/polkadot/node/core/prospective-parachains/src/metrics.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/core/prospective-parachains/src/tests.rs b/polkadot/node/core/prospective-parachains/src/tests.rs index de7a84d9a608a98efa0baf7fd38eccb6458a5827..9fc77624b979919d5e28cb91936c009b6b6e801e 100644 --- a/polkadot/node/core/prospective-parachains/src/tests.rs +++ b/polkadot/node/core/prospective-parachains/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/core/pvf/Cargo.toml b/polkadot/node/core/pvf/Cargo.toml index eb61b4ccb0e7766ec7168fecd7ab3252375541c7..a265139d95c01ef3d2ac2334d2570fdab4d83994 100644 --- a/polkadot/node/core/pvf/Cargo.toml +++ b/polkadot/node/core/pvf/Cargo.toml @@ -25,7 +25,7 @@ tokio = { version = "1.24.2", features = ["fs", "process"] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } -polkadot-parachain = { path = "../../../parachain" } +polkadot-parachain-primitives = { path = "../../../parachain" } polkadot-core-primitives = { path = "../../../core-primitives" } polkadot-node-core-pvf-common = { path = "common" } polkadot-node-metrics = { path = "../../metrics" } @@ -47,13 +47,14 @@ assert_matches = "1.4.0" hex-literal = "0.3.4" polkadot-node-core-pvf-common = { path = "common", features = ["test-utils"] } # For the puppet worker, depend on ourselves with the test-utils feature. -polkadot-node-core-pvf = { path = "", features = ["test-utils"] } +polkadot-node-core-pvf = { path = ".", features = ["test-utils"] } adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" } halt = { package = "test-parachain-halt", path = "../../../parachain/test-parachains/halt" } [features] ci-only-tests = [] +jemalloc-allocator = [ "polkadot-node-core-pvf-common/jemalloc-allocator" ] # This feature is used to export test code to other crates without putting it in the production build. # This is also used by the `puppet_worker` binary. test-utils = [ diff --git a/polkadot/node/core/pvf/common/Cargo.toml b/polkadot/node/core/pvf/common/Cargo.toml index ded8f0dc63beda87ffff3b7b879124c9ad394ded..621f7e24f72bef8650337a05372b1075054d4964 100644 --- a/polkadot/node/core/pvf/common/Cargo.toml +++ b/polkadot/node/core/pvf/common/Cargo.toml @@ -15,7 +15,7 @@ tokio = { version = "1.24.2", features = ["fs", "process", "io-util"] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } -polkadot-parachain = { path = "../../../../parachain" } +polkadot-parachain-primitives = { path = "../../../../parachain" } polkadot-primitives = { path = "../../../../primitives" } sc-executor = { path = "../../../../../substrate/client/executor" } @@ -38,3 +38,4 @@ tempfile = "3.3.0" # This feature is used to export test code to other crates without putting it in the production build. # Also used for building the puppet worker. test-utils = [] +jemalloc-allocator = [] diff --git a/polkadot/node/core/pvf/common/src/execute.rs b/polkadot/node/core/pvf/common/src/execute.rs index de5ce39f78381dc87156dcbcd8fa0d68fb3b3c52..399b847791a91e616c6ae6589dae9ce5fef2cdf9 100644 --- a/polkadot/node/core/pvf/common/src/execute.rs +++ b/polkadot/node/core/pvf/common/src/execute.rs @@ -16,7 +16,7 @@ use crate::error::InternalValidationError; use parity_scale_codec::{Decode, Encode}; -use polkadot_parachain::primitives::ValidationResult; +use polkadot_parachain_primitives::primitives::ValidationResult; use polkadot_primitives::ExecutorParams; use std::time::Duration; diff --git a/polkadot/node/core/pvf/common/src/executor_intf.rs b/polkadot/node/core/pvf/common/src/executor_intf.rs index 42ed4b79c76120320c1e6c823d236f30b40f1875..79839149ebdf1c09b80b346d31ba0ebf9dc6e299 100644 --- a/polkadot/node/core/pvf/common/src/executor_intf.rs +++ b/polkadot/node/core/pvf/common/src/executor_intf.rs @@ -141,7 +141,7 @@ impl Executor { /// # Safety /// /// The caller must ensure that the compiled artifact passed here was: - /// 1) produced by [`prepare`], + /// 1) produced by `prepare`, /// 2) was not modified, /// /// Failure to adhere to these requirements might lead to crashes and arbitrary code execution. @@ -171,7 +171,7 @@ impl Executor { /// # Safety /// /// The caller must ensure that the compiled artifact passed here was: - /// 1) produced by [`prepare`], + /// 1) produced by `prepare`, /// 2) was not modified, /// /// Failure to adhere to these requirements might lead to crashes and arbitrary code execution. diff --git a/polkadot/node/core/pvf/common/src/lib.rs b/polkadot/node/core/pvf/common/src/lib.rs index 2cc9c72e182c1b6e886c1d2efb234d37a56b7460..c358ad6e134de50367bb2941b0b12d91e8dcb21f 100644 --- a/polkadot/node/core/pvf/common/src/lib.rs +++ b/polkadot/node/core/pvf/common/src/lib.rs @@ -25,11 +25,8 @@ pub mod worker; pub use cpu_time::ProcessTime; -/// DO NOT USE - internal for macros only. -#[doc(hidden)] -pub mod __private { - pub use sp_tracing::try_init_simple; -} +// Used by `decl_worker_main!`. +pub use sp_tracing; const LOG_TARGET: &str = "parachain::pvf-common"; diff --git a/polkadot/node/core/pvf/common/src/pvf.rs b/polkadot/node/core/pvf/common/src/pvf.rs index e31264713a571587f718e049c56b06a4e4a6b54b..0cc86434c19526396b67565bee30c3a38dae9ac6 100644 --- a/polkadot/node/core/pvf/common/src/pvf.rs +++ b/polkadot/node/core/pvf/common/src/pvf.rs @@ -16,7 +16,7 @@ use crate::prepare::PrepareJobKind; use parity_scale_codec::{Decode, Encode}; -use polkadot_parachain::primitives::ValidationCodeHash; +use polkadot_parachain_primitives::primitives::ValidationCodeHash; use polkadot_primitives::ExecutorParams; use sp_core::blake2_256; use std::{ diff --git a/polkadot/node/core/pvf/common/src/worker/mod.rs b/polkadot/node/core/pvf/common/src/worker/mod.rs index 4ea0e5aa1a9a68c14a8cbe3a18d40eefac2bfa6c..40e540bb3f7eb165dddee7fc2394ec53b147ef4a 100644 --- a/polkadot/node/core/pvf/common/src/worker/mod.rs +++ b/polkadot/node/core/pvf/common/src/worker/mod.rs @@ -41,7 +41,9 @@ macro_rules! decl_worker_main { } fn main() { - $crate::__private::try_init_simple(); + // TODO: Remove this dependency, and `pub use sp_tracing` in `lib.rs`. + // See . + $crate::sp_tracing::try_init_simple(); let args = std::env::args().collect::>(); if args.len() == 1 { diff --git a/polkadot/node/core/pvf/execute-worker/Cargo.toml b/polkadot/node/core/pvf/execute-worker/Cargo.toml index 5ef7c8e8e87e3a5667a5c317e27ec10d6d971436..23678d95696e7ec10f7ac9a69a6d433b5e9275bb 100644 --- a/polkadot/node/core/pvf/execute-worker/Cargo.toml +++ b/polkadot/node/core/pvf/execute-worker/Cargo.toml @@ -11,21 +11,17 @@ cpu-time = "1.0.0" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../../gum" } rayon = "1.5.1" -tikv-jemalloc-ctl = { version = "0.5.0", optional = true } tokio = { version = "1.24.2", features = ["fs", "process"] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } polkadot-node-core-pvf-common = { path = "../common" } -polkadot-parachain = { path = "../../../../parachain" } +polkadot-parachain-primitives = { path = "../../../../parachain" } polkadot-primitives = { path = "../../../../primitives" } sp-core = { path = "../../../../../substrate/primitives/core" } sp-maybe-compressed-blob = { path = "../../../../../substrate/primitives/maybe-compressed-blob" } sp-tracing = { path = "../../../../../substrate/primitives/tracing" } -[target.'cfg(target_os = "linux")'.dependencies] -tikv-jemalloc-ctl = "0.5.0" - [features] builder = [] diff --git a/polkadot/node/core/pvf/execute-worker/src/lib.rs b/polkadot/node/core/pvf/execute-worker/src/lib.rs index 7a14de18a82fa392e55e91897bc9e49cc4fb7ca4..36793a5c71eca169c09da8565006dfbc133518ef 100644 --- a/polkadot/node/core/pvf/execute-worker/src/lib.rs +++ b/polkadot/node/core/pvf/execute-worker/src/lib.rs @@ -37,7 +37,7 @@ use polkadot_node_core_pvf_common::{ worker_event_loop, }, }; -use polkadot_parachain::primitives::ValidationResult; +use polkadot_parachain_primitives::primitives::ValidationResult; use std::{ path::PathBuf, sync::{mpsc::channel, Arc}, diff --git a/polkadot/node/core/pvf/prepare-worker/Cargo.toml b/polkadot/node/core/pvf/prepare-worker/Cargo.toml index dfa87e4d2407725fe842353f00fcebe0f505bb23..e7a12cd9a809c5ef2fafa32df9b3cf4588dc1b52 100644 --- a/polkadot/node/core/pvf/prepare-worker/Cargo.toml +++ b/polkadot/node/core/pvf/prepare-worker/Cargo.toml @@ -17,7 +17,7 @@ tokio = { version = "1.24.2", features = ["fs", "process"] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } polkadot-node-core-pvf-common = { path = "../common" } -polkadot-parachain = { path = "../../../../parachain" } +polkadot-parachain-primitives = { path = "../../../../parachain" } polkadot-primitives = { path = "../../../../primitives" } sc-executor = { path = "../../../../../substrate/client/executor" } @@ -32,4 +32,7 @@ tikv-jemalloc-ctl = "0.5.0" [features] builder = [] -jemalloc-allocator = [ "dep:tikv-jemalloc-ctl" ] +jemalloc-allocator = [ + "dep:tikv-jemalloc-ctl", + "polkadot-node-core-pvf-common/jemalloc-allocator", +] diff --git a/polkadot/node/core/pvf/src/artifacts.rs b/polkadot/node/core/pvf/src/artifacts.rs index a180af15db27763542e318753f016a9645a2726a..dc5921df96884dd8ce0bbb10b8de3c6eca90b1f6 100644 --- a/polkadot/node/core/pvf/src/artifacts.rs +++ b/polkadot/node/core/pvf/src/artifacts.rs @@ -58,7 +58,7 @@ use crate::host::PrepareResultSender; use always_assert::always; use polkadot_node_core_pvf_common::{error::PrepareError, prepare::PrepareStats, pvf::PvfPrepData}; -use polkadot_parachain::primitives::ValidationCodeHash; +use polkadot_parachain_primitives::primitives::ValidationCodeHash; use polkadot_primitives::ExecutorParamsHash; use std::{ collections::HashMap, diff --git a/polkadot/node/core/pvf/src/error.rs b/polkadot/node/core/pvf/src/error.rs index cb35ec9e9d9a4d360513869279d8b6d032e3e0a6..87ef0b54a0406776b865ea143185fd8012ef82e1 100644 --- a/polkadot/node/core/pvf/src/error.rs +++ b/polkadot/node/core/pvf/src/error.rs @@ -28,7 +28,7 @@ pub enum ValidationError { } /// A description of an error raised during executing a PVF and can be attributed to the combination -/// of the candidate [`polkadot_parachain::primitives::ValidationParams`] and the PVF. +/// of the candidate [`polkadot_parachain_primitives::primitives::ValidationParams`] and the PVF. #[derive(Debug, Clone)] pub enum InvalidCandidate { /// PVF preparation ended up with a deterministic error. diff --git a/polkadot/node/core/pvf/src/execute/worker_intf.rs b/polkadot/node/core/pvf/src/execute/worker_intf.rs index 948abd2261d720e14e4f691d626febdf48dbf743..d66444a8102d9124188a48e98e5fa8f321a0bb97 100644 --- a/polkadot/node/core/pvf/src/execute/worker_intf.rs +++ b/polkadot/node/core/pvf/src/execute/worker_intf.rs @@ -32,7 +32,7 @@ use polkadot_node_core_pvf_common::{ execute::{Handshake, Response}, framed_recv, framed_send, }; -use polkadot_parachain::primitives::ValidationResult; +use polkadot_parachain_primitives::primitives::ValidationResult; use polkadot_primitives::ExecutorParams; use std::{path::Path, time::Duration}; use tokio::{io, net::UnixStream}; diff --git a/polkadot/node/core/pvf/src/host.rs b/polkadot/node/core/pvf/src/host.rs index 9f3b7e23fd89e419350329bd2226242a51b5628e..5290b2760f423403d9fa9cf334f735e253952e19 100644 --- a/polkadot/node/core/pvf/src/host.rs +++ b/polkadot/node/core/pvf/src/host.rs @@ -35,7 +35,7 @@ use polkadot_node_core_pvf_common::{ error::{PrepareError, PrepareResult}, pvf::PvfPrepData, }; -use polkadot_parachain::primitives::ValidationResult; +use polkadot_parachain_primitives::primitives::ValidationResult; use std::{ collections::HashMap, path::{Path, PathBuf}, diff --git a/polkadot/node/core/pvf/src/lib.rs b/polkadot/node/core/pvf/src/lib.rs index 1da0593835fb403b36d126cb948fd41247a71742..c3a7a4613139ef121bc445a7957a50afb1495865 100644 --- a/polkadot/node/core/pvf/src/lib.rs +++ b/polkadot/node/core/pvf/src/lib.rs @@ -33,8 +33,8 @@ //! compile) in order to pre-check its validity. //! //! (b) PVF execution. This accepts the PVF -//! [`params`][`polkadot_parachain::primitives::ValidationParams`] and the `Pvf` code, prepares -//! (verifies and compiles) the code, and then executes PVF with the `params`. +//! [`params`][`polkadot_parachain_primitives::primitives::ValidationParams`] and the `Pvf` +//! code, prepares (verifies and compiles) the code, and then executes PVF with the `params`. //! //! (c) Heads up. This request allows to signal that the given PVF may be needed soon and that it //! should be prepared for execution. @@ -86,7 +86,7 @@ //! //! The execute workers will be fed by the requests from the execution queue, which is basically a //! combination of a path to the compiled artifact and the -//! [`params`][`polkadot_parachain::primitives::ValidationParams`]. +//! [`params`][`polkadot_parachain_primitives::primitives::ValidationParams`]. mod artifacts; mod error; diff --git a/polkadot/node/core/pvf/tests/it/adder.rs b/polkadot/node/core/pvf/tests/it/adder.rs index a4c2e21bdeaa7638dcdfa52ae00e128c789d654f..bad7a66054c9e885c6693f2652e1d6235b7324f4 100644 --- a/polkadot/node/core/pvf/tests/it/adder.rs +++ b/polkadot/node/core/pvf/tests/it/adder.rs @@ -17,7 +17,7 @@ use super::TestHost; use adder::{hash_state, BlockData, HeadData}; use parity_scale_codec::{Decode, Encode}; -use polkadot_parachain::primitives::{ +use polkadot_parachain_primitives::primitives::{ BlockData as GenericBlockData, HeadData as GenericHeadData, RelayChainBlockNumber, ValidationParams, }; diff --git a/polkadot/node/core/pvf/tests/it/main.rs b/polkadot/node/core/pvf/tests/it/main.rs index 72c459c2f63214cd1ab5c9708fc9f87cb46dcc5b..12d87ee4426226b887317ab995cfefdf4ab55b6c 100644 --- a/polkadot/node/core/pvf/tests/it/main.rs +++ b/polkadot/node/core/pvf/tests/it/main.rs @@ -21,7 +21,7 @@ use polkadot_node_core_pvf::{ start, Config, InvalidCandidate, Metrics, PrepareJobKind, PvfPrepData, ValidationError, ValidationHost, JOB_TIMEOUT_WALL_CLOCK_FACTOR, }; -use polkadot_parachain::primitives::{BlockData, ValidationParams, ValidationResult}; +use polkadot_parachain_primitives::primitives::{BlockData, ValidationParams, ValidationResult}; use polkadot_primitives::ExecutorParams; #[cfg(feature = "ci-only-tests")] @@ -258,7 +258,7 @@ async fn execute_queue_doesnt_stall_with_varying_executor_params() { #[tokio::test] async fn deleting_prepared_artifact_does_not_dispute() { let host = TestHost::new(); - let cache_dir = host.cache_dir.path().clone(); + let cache_dir = host.cache_dir.path(); let result = host .validate_candidate( diff --git a/polkadot/node/core/runtime-api/src/cache.rs b/polkadot/node/core/runtime-api/src/cache.rs index cd22f37ddee43e096ffb5414f61293e609ccd7cd..7f41d74e616c6152038f6ac58d8189c5d722fab3 100644 --- a/polkadot/node/core/runtime-api/src/cache.rs +++ b/polkadot/node/core/runtime-api/src/cache.rs @@ -65,6 +65,7 @@ pub(crate) struct RequestResultCache { LruMap>, key_ownership_proof: LruMap<(Hash, ValidatorId), Option>, + minimum_backing_votes: LruMap, staging_para_backing_state: LruMap<(Hash, ParaId), Option>, staging_async_backing_params: LruMap, @@ -97,6 +98,7 @@ impl Default for RequestResultCache { disputes: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), unapplied_slashes: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), key_ownership_proof: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), + minimum_backing_votes: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), staging_para_backing_state: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), staging_async_backing_params: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)), @@ -434,6 +436,18 @@ impl RequestResultCache { None } + pub(crate) fn minimum_backing_votes(&mut self, session_index: SessionIndex) -> Option { + self.minimum_backing_votes.get(&session_index).copied() + } + + pub(crate) fn cache_minimum_backing_votes( + &mut self, + session_index: SessionIndex, + minimum_backing_votes: u32, + ) { + self.minimum_backing_votes.insert(session_index, minimum_backing_votes); + } + pub(crate) fn staging_para_backing_state( &mut self, key: (Hash, ParaId), @@ -469,6 +483,7 @@ pub(crate) enum RequestResult { // The structure of each variant is (relay_parent, [params,]*, result) Authorities(Hash, Vec), Validators(Hash, Vec), + MinimumBackingVotes(Hash, SessionIndex, u32), ValidatorGroups(Hash, (Vec>, GroupRotationInfo)), AvailabilityCores(Hash, Vec), PersistedValidationData(Hash, ParaId, OccupiedCoreAssumption, Option), diff --git a/polkadot/node/core/runtime-api/src/lib.rs b/polkadot/node/core/runtime-api/src/lib.rs index 78531d41272b58483661a5fd628d49347939aa43..ec9bf10fa6e3add92ca37a274966a1e84277f07e 100644 --- a/polkadot/node/core/runtime-api/src/lib.rs +++ b/polkadot/node/core/runtime-api/src/lib.rs @@ -101,6 +101,9 @@ where self.requests_cache.cache_authorities(relay_parent, authorities), Validators(relay_parent, validators) => self.requests_cache.cache_validators(relay_parent, validators), + MinimumBackingVotes(_, session_index, minimum_backing_votes) => self + .requests_cache + .cache_minimum_backing_votes(session_index, minimum_backing_votes), ValidatorGroups(relay_parent, groups) => self.requests_cache.cache_validator_groups(relay_parent, groups), AvailabilityCores(relay_parent, cores) => @@ -301,6 +304,15 @@ where Request::StagingAsyncBackingParams(sender) => query!(staging_async_backing_params(), sender) .map(|sender| Request::StagingAsyncBackingParams(sender)), + Request::MinimumBackingVotes(index, sender) => { + if let Some(value) = self.requests_cache.minimum_backing_votes(index) { + self.metrics.on_cached_request(); + let _ = sender.send(Ok(value)); + None + } else { + Some(Request::MinimumBackingVotes(index, sender)) + } + }, } } @@ -551,6 +563,12 @@ where ver = Request::SUBMIT_REPORT_DISPUTE_LOST_RUNTIME_REQUIREMENT, sender ), + Request::MinimumBackingVotes(index, sender) => query!( + MinimumBackingVotes, + minimum_backing_votes(index), + ver = Request::MINIMUM_BACKING_VOTES_RUNTIME_REQUIREMENT, + sender + ), Request::StagingParaBackingState(para, sender) => { query!( diff --git a/polkadot/node/core/runtime-api/src/tests.rs b/polkadot/node/core/runtime-api/src/tests.rs index c3f8108312be13508fff8abcfe80d44ea17b8577..bb7c2968961171151e5690503b61d0950bd6a56a 100644 --- a/polkadot/node/core/runtime-api/src/tests.rs +++ b/polkadot/node/core/runtime-api/src/tests.rs @@ -264,6 +264,10 @@ impl RuntimeApiSubsystemClient for MockSubsystemClient { ) -> Result, ApiError> { todo!("Not required for tests") } + + async fn minimum_backing_votes(&self, _: Hash, _: SessionIndex) -> Result { + todo!("Not required for tests") + } } #[test] diff --git a/polkadot/node/malus/Cargo.toml b/polkadot/node/malus/Cargo.toml index 6f39368168fece661fe2d23200c726d96e978834..56053b8814a704d8ca49f25fc13189e3f8f839d8 100644 --- a/polkadot/node/malus/Cargo.toml +++ b/polkadot/node/malus/Cargo.toml @@ -40,7 +40,7 @@ assert_matches = "1.5" async-trait = "0.1.57" sp-keystore = { path = "../../../substrate/primitives/keystore" } sp-core = { path = "../../../substrate/primitives/core" } -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../gum" } diff --git a/polkadot/node/malus/src/variants/common.rs b/polkadot/node/malus/src/variants/common.rs index 475ca8f314520958e0677e232632abe59731fc0d..bc5f6f92aedbc3e4b0aa26bf17b22013d54256ba 100644 --- a/polkadot/node/malus/src/variants/common.rs +++ b/polkadot/node/malus/src/variants/common.rs @@ -278,6 +278,7 @@ where validation_code, candidate_receipt, pov, + executor_params, timeout, sender, ), @@ -292,6 +293,7 @@ where validation_code, candidate_receipt, pov, + executor_params, timeout, sender, ), @@ -329,6 +331,7 @@ where validation_code, candidate_receipt, pov, + executor_params, timeout, sender, ), @@ -368,6 +371,7 @@ where validation_code, candidate_receipt, pov, + executor_params, timeout, sender, ), @@ -382,6 +386,7 @@ where validation_code, candidate_receipt, pov, + executor_params, timeout, sender, ), @@ -394,6 +399,7 @@ where CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ), @@ -406,6 +412,7 @@ where msg: CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ), @@ -435,6 +442,7 @@ where msg: CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ), @@ -468,6 +476,7 @@ where msg: CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ), @@ -479,6 +488,7 @@ where msg: CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + executor_params, timeout, response_sender, ), diff --git a/polkadot/node/metrics/Cargo.toml b/polkadot/node/metrics/Cargo.toml index 3b6a67abc133082770ca709edd7e141ab7d448be..d497fa7607a16bb95f23550bfaf82c69ba062659 100644 --- a/polkadot/node/metrics/Cargo.toml +++ b/polkadot/node/metrics/Cargo.toml @@ -21,7 +21,7 @@ substrate-prometheus-endpoint = { path = "../../../substrate/utils/prometheus" } sc-tracing = { path = "../../../substrate/client/tracing" } codec = { package = "parity-scale-codec", version = "3.6.1" } primitives = { package = "polkadot-primitives", path = "../../primitives" } -bs58 = { version = "0.4.0", features = ["alloc"] } +bs58 = { version = "0.5.0", features = ["alloc"] } log = "0.4.17" [dev-dependencies] diff --git a/polkadot/node/metrics/src/tests.rs b/polkadot/node/metrics/src/tests.rs index 68abfeebc12446e080a5b24d1460f4e54f12e044..861080228cd8dc90f9d074d54355983ab30e8e53 100644 --- a/polkadot/node/metrics/src/tests.rs +++ b/polkadot/node/metrics/src/tests.rs @@ -24,7 +24,7 @@ use std::collections::HashMap; const DEFAULT_PROMETHEUS_PORT: u16 = 9616; -#[substrate_test_utils::test(flavor = "multi_thread")] +#[tokio::test(flavor = "multi_thread")] async fn runtime_can_publish_metrics() { let mut alice_config = node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true); diff --git a/polkadot/node/network/approval-distribution/src/lib.rs b/polkadot/node/network/approval-distribution/src/lib.rs index ac525ea6faf3b77956c9ecd90a8b1de5466b7674..70c20437d125d234b47b0953fbf019931c72c33d 100644 --- a/polkadot/node/network/approval-distribution/src/lib.rs +++ b/polkadot/node/network/approval-distribution/src/lib.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! [`ApprovalDistributionSubsystem`] implementation. +//! [`ApprovalDistribution`] implementation. //! -//! https://w3f.github.io/parachain-implementers-guide/node/approval/approval-distribution.html +//! #![warn(missing_docs)] diff --git a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs index 8fc9fa82153e2035d8c037b8b6b86caf638bf5cc..12a97a1fb5a18330be6d94c43ef6a59b14772b40 100644 --- a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs +++ b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs @@ -146,7 +146,7 @@ mod tests { AllMessages, AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest, }; use polkadot_node_subsystem_test_helpers as test_helpers; - use polkadot_primitives::{CandidateHash, Hash, ValidatorIndex}; + use polkadot_primitives::{CandidateHash, ExecutorParams, Hash, ValidatorIndex}; use test_helpers::mock::make_ferdie_keystore; use super::*; @@ -208,6 +208,12 @@ mod tests { )) => { tx.send(Ok(Some(make_session_info()))).unwrap(); }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(_, tx), + )) => { + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + }, AllMessages::NetworkBridgeTx(NetworkBridgeTxMessage::SendRequests( mut reqs, _, diff --git a/polkadot/node/network/availability-distribution/src/requester/tests.rs b/polkadot/node/network/availability-distribution/src/requester/tests.rs index b74a69ea0769b2dec61c4b3ef1ddb0120ff17f5f..5f7e4c36f063431bc08a6c43e4ed7acbf4a8612c 100644 --- a/polkadot/node/network/availability-distribution/src/requester/tests.rs +++ b/polkadot/node/network/availability-distribution/src/requester/tests.rs @@ -24,8 +24,8 @@ use polkadot_node_network_protocol::jaeger; use polkadot_node_primitives::{BlockData, ErasureChunk, PoV}; use polkadot_node_subsystem_util::runtime::RuntimeInfo; use polkadot_primitives::{ - BlockNumber, CoreState, GroupIndex, Hash, Id as ParaId, ScheduledCore, SessionIndex, - SessionInfo, + BlockNumber, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, ScheduledCore, + SessionIndex, SessionInfo, }; use sp_core::traits::SpawnNamed; @@ -120,6 +120,10 @@ fn spawn_virtual_overseer( tx.send(Ok(Some(test_state.session_info.clone()))) .expect("Receiver should be alive."); }, + RuntimeApiRequest::SessionExecutorParams(_, tx) => { + tx.send(Ok(Some(ExecutorParams::default()))) + .expect("Receiver should be alive."); + }, RuntimeApiRequest::AvailabilityCores(tx) => { let para_id = ParaId::from(1_u32); let maybe_block_position = diff --git a/polkadot/node/network/availability-distribution/src/tests/state.rs b/polkadot/node/network/availability-distribution/src/tests/state.rs index 706ec13a3e9b3dc19dfb3208b924bd6d231414da..ecde44788c25def8c4565c15ec57ae2a81951e6e 100644 --- a/polkadot/node/network/availability-distribution/src/tests/state.rs +++ b/polkadot/node/network/availability-distribution/src/tests/state.rs @@ -48,8 +48,8 @@ use polkadot_node_subsystem::{ }; use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_primitives::{ - CandidateHash, CoreState, GroupIndex, Hash, Id as ParaId, ScheduledCore, SessionInfo, - ValidatorIndex, + CandidateHash, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, ScheduledCore, + SessionInfo, ValidatorIndex, }; use test_helpers::mock::make_ferdie_keystore; @@ -267,6 +267,10 @@ impl TestState { tx.send(Ok(Some(self.session_info.clone()))) .expect("Receiver should be alive."); }, + RuntimeApiRequest::SessionExecutorParams(_, tx) => { + tx.send(Ok(Some(ExecutorParams::default()))) + .expect("Receiver should be alive."); + }, RuntimeApiRequest::AvailabilityCores(tx) => { gum::trace!(target: LOG_TARGET, cores= ?self.cores[&hash], hash = ?hash, "Sending out cores for hash"); tx.send(Ok(self.cores[&hash].clone())) diff --git a/polkadot/node/network/bridge/src/rx/mod.rs b/polkadot/node/network/bridge/src/rx/mod.rs index 002919c5b0e50d1ae6da8f807900b545eb0a7e0d..51d248ca2d49fbe5d6b2cf3b246f42cfb849fe19 100644 --- a/polkadot/node/network/bridge/src/rx/mod.rs +++ b/polkadot/node/network/bridge/src/rx/mod.rs @@ -92,7 +92,7 @@ impl NetworkBridgeRx { /// discovery service. /// /// This assumes that the network service has had the notifications protocol for the network - /// bridge already registered. See [`peers_sets_info`](peers_sets_info). + /// bridge already registered. See [`peer_sets_info`]. pub fn new( network_service: N, authority_discovery_service: AD, diff --git a/polkadot/node/network/bridge/src/tx/mod.rs b/polkadot/node/network/bridge/src/tx/mod.rs index e0ca633547f4c0be8a7273f7688a3a5e75eafc9a..1b386ce1239bd2e3204aa6871dd3f40309eda9c1 100644 --- a/polkadot/node/network/bridge/src/tx/mod.rs +++ b/polkadot/node/network/bridge/src/tx/mod.rs @@ -65,7 +65,7 @@ impl NetworkBridgeTx { /// discovery service. /// /// This assumes that the network service has had the notifications protocol for the network - /// bridge already registered. See [`peers_sets_info`](peers_sets_info). + /// bridge already registered. See [`peer_sets_info`]. pub fn new( network_service: N, authority_discovery_service: AD, diff --git a/polkadot/node/network/collator-protocol/src/collator_side/collation.rs b/polkadot/node/network/collator-protocol/src/collator_side/collation.rs index 28dd9e0a959e73b5ff660b169b3857ebf890a6b0..627c38b776f7c6cffd4ba5ebd848d55ab02f32b4 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/collation.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/collation.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/collator-protocol/src/collator_side/tests/mod.rs b/polkadot/node/network/collator-protocol/src/collator_side/tests/mod.rs index fae719b2b4a1faf9202a93c0c43f843783981a71..8b28730c90125b3b6c2788b700389ddb2738e0b7 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/tests/mod.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/tests/mod.rs @@ -45,8 +45,8 @@ use polkadot_node_subsystem::{ use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_node_subsystem_util::{reputation::add_reputation, TimeoutExt}; use polkadot_primitives::{ - AuthorityDiscoveryId, CollatorPair, GroupIndex, GroupRotationInfo, IndexedVec, ScheduledCore, - SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, + AuthorityDiscoveryId, CollatorPair, ExecutorParams, GroupIndex, GroupRotationInfo, IndexedVec, + ScheduledCore, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, }; use polkadot_primitives_test_helpers::TestCandidateBuilder; @@ -398,6 +398,16 @@ async fn distribute_collation_with_receipt( tx.send(Ok(Some(test_state.session_info.clone()))).unwrap(); }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionExecutorParams(session_index, tx), + )) => { + assert_eq!(relay_parent, relay_parent); + assert_eq!(session_index, test_state.current_session_index()); + + tx.send(Ok(Some(ExecutorParams::default()))).unwrap(); + }, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( _relay_parent, RuntimeApiRequest::ValidatorGroups(tx), diff --git a/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs b/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs index 02e8d0a7a81da8833f14f2f2464df78fc8ff559f..bd55c35852fa96bf7a8f5747f2cb904bdf038fba 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/tests/prospective_parachains.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/collator-protocol/src/validator_side/collation.rs b/polkadot/node/network/collator-protocol/src/validator_side/collation.rs index ba59cce56b60aa454b5fc00abf99d39efa0cb971..4c92780f2da9448f3b3a0992a3cc16c9b3676c30 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side/collation.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side/collation.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/collator-protocol/src/validator_side/metrics.rs b/polkadot/node/network/collator-protocol/src/validator_side/metrics.rs index d898a5e7cefdfd3d7de5b0a338aca2b65f682ac3..195a135947d88b460d3699828f1fb66a3fdb731a 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side/metrics.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side/metrics.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/collator-protocol/src/validator_side/tests/prospective_parachains.rs b/polkadot/node/network/collator-protocol/src/validator_side/tests/prospective_parachains.rs index a803827792d8b6ed51c17e13d5d238b6809d0097..e2a007b308e54a9e65af18646f5353363e45ef3d 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side/tests/prospective_parachains.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side/tests/prospective_parachains.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/dispute-distribution/src/lib.rs b/polkadot/node/network/dispute-distribution/src/lib.rs index 071dc3c3343b25068c1ca73a02947c9492350877..2b4466fc2fc558ab4e29844dec0ac7adb5e8d6c0 100644 --- a/polkadot/node/network/dispute-distribution/src/lib.rs +++ b/polkadot/node/network/dispute-distribution/src/lib.rs @@ -21,8 +21,8 @@ //! - a sender //! - and a receiver //! -//! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles -//! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. +//! The sender is responsible for getting our vote out, see `sender`. The receiver handles +//! incoming [`DisputeRequest`](v1::DisputeRequest)s and offers spam protection, see `receiver`. use std::time::Duration; diff --git a/polkadot/node/network/dispute-distribution/src/tests/mod.rs b/polkadot/node/network/dispute-distribution/src/tests/mod.rs index bc8e8e8be16059ddd3c4a9ae1bda4b5aa449dbff..f53b9c0dd4b57a0bd65e49b1c1896999eb9e1d23 100644 --- a/polkadot/node/network/dispute-distribution/src/tests/mod.rs +++ b/polkadot/node/network/dispute-distribution/src/tests/mod.rs @@ -57,7 +57,8 @@ use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::{ - AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo, + AuthorityDiscoveryId, CandidateHash, CandidateReceipt, ExecutorParams, Hash, SessionIndex, + SessionInfo, }; use self::mock::{ @@ -635,6 +636,16 @@ async fn nested_network_dispute_request<'a, F, O>( }, unexpected => panic!("Unexpected message {:?}", unexpected), } + match handle.recv().await { + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _, + RuntimeApiRequest::SessionExecutorParams(_, tx), + )) => { + tx.send(Ok(Some(ExecutorParams::default()))) + .expect("Receiver should stay alive."); + }, + unexpected => panic!("Unexpected message {:?}", unexpected), + } } // Import should get initiated: @@ -746,15 +757,27 @@ async fn activate_leaf( if let Some(session_info) = new_session { assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionInfo(session_idx, tx) - )) => { - assert_eq!(h, activate); - assert_eq!(session_index, session_idx); - tx.send(Ok(Some(session_info))).expect("Receiver should stay alive."); - }); + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionInfo(session_idx, tx) + )) => { + assert_eq!(h, activate); + assert_eq!(session_index, session_idx); + tx.send(Ok(Some(session_info))).expect("Receiver should stay alive."); + } + ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionExecutorParams(session_idx, tx) + )) => { + assert_eq!(h, activate); + assert_eq!(session_index, session_idx); + tx.send(Ok(Some(ExecutorParams::default()))).expect("Receiver should stay alive."); + } + ); } assert_matches!( diff --git a/polkadot/node/network/protocol/src/authority_discovery.rs b/polkadot/node/network/protocol/src/authority_discovery.rs index 0cf11b93d18439ae400f967540d4a926d3ba553d..beb5409d4ac04a58b1ba276fdfd8f7c6cae030f7 100644 --- a/polkadot/node/network/protocol/src/authority_discovery.rs +++ b/polkadot/node/network/protocol/src/authority_discovery.rs @@ -30,12 +30,12 @@ use sc_network::{Multiaddr, PeerId}; /// Needed for mocking in tests mostly. #[async_trait] pub trait AuthorityDiscovery: Send + Debug + 'static { - /// Get the addresses for the given [`AuthorityId`] from the local address cache. + /// Get the addresses for the given [`AuthorityDiscoveryId`] from the local address cache. async fn get_addresses_by_authority_id( &mut self, authority: AuthorityDiscoveryId, ) -> Option>; - /// Get the [`AuthorityId`] for the given [`PeerId`] from the local address cache. + /// Get the [`AuthorityDiscoveryId`] for the given [`PeerId`] from the local address cache. async fn get_authority_ids_by_peer_id( &mut self, peer_id: PeerId, diff --git a/polkadot/node/network/protocol/src/peer_set.rs b/polkadot/node/network/protocol/src/peer_set.rs index b6f8c9dec2318791d863286ea3ed72e37224cbde..c2163783c2ce05d9eaac9b3718745107baaeeb08 100644 --- a/polkadot/node/network/protocol/src/peer_set.rs +++ b/polkadot/node/network/protocol/src/peer_set.rs @@ -197,7 +197,7 @@ impl IndexMut for PerPeerSet { /// Get `NonDefaultSetConfig`s for all available peer sets, at their default versions. /// -/// Should be used during network configuration (added to [`NetworkConfiguration::extra_sets`]) +/// Should be used during network configuration (added to `NetworkConfiguration::extra_sets`) /// or shortly after startup to register the protocols with the network service. pub fn peer_sets_info( is_authority: IsAuthority, @@ -288,7 +288,7 @@ pub struct PeerSetProtocolNames { } impl PeerSetProtocolNames { - /// Construct [`PeerSetProtocols`] using `genesis_hash` and `fork_id`. + /// Construct [`PeerSetProtocolNames`] using `genesis_hash` and `fork_id`. pub fn new(genesis_hash: Hash, fork_id: Option<&str>) -> Self { let mut protocols = HashMap::new(); let mut names = HashMap::new(); diff --git a/polkadot/node/network/protocol/src/request_response/vstaging.rs b/polkadot/node/network/protocol/src/request_response/vstaging.rs index f84de9505534aa35f43217ada837ce4184d51d72..34a17b4baaa64ab6eda18382cfa4c9c3ccd36d3a 100644 --- a/polkadot/node/network/protocol/src/request_response/vstaging.rs +++ b/polkadot/node/network/protocol/src/request_response/vstaging.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/Cargo.toml b/polkadot/node/network/statement-distribution/Cargo.toml index 4c835bc3a688c9cf8282442bad182f5d94f01db3..5ff1ba9de02ba380c83facd840303fbb0b770c73 100644 --- a/polkadot/node/network/statement-distribution/Cargo.toml +++ b/polkadot/node/network/statement-distribution/Cargo.toml @@ -16,6 +16,7 @@ sp-keystore = { path = "../../../../substrate/primitives/keystore" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } +polkadot-node-subsystem-types = { path = "../../subsystem-types" } polkadot-node-network-protocol = { path = "../protocol" } arrayvec = "0.7.4" indexmap = "1.9.1" @@ -39,4 +40,3 @@ sc-network = { path = "../../../../substrate/client/network" } futures-timer = "3.0.2" polkadot-primitives-test-helpers = { path = "../../../primitives/test-helpers" } rand_chacha = "0.3" -polkadot-node-subsystem-types = { path = "../../subsystem-types" } diff --git a/polkadot/node/network/statement-distribution/src/legacy_v1/mod.rs b/polkadot/node/network/statement-distribution/src/legacy_v1/mod.rs index b5895cb9f65ba270cc2acd09c58d4e9af1b73a99..9ae76047383cde679b4a9393ecdaef38fbcf8930 100644 --- a/polkadot/node/network/statement-distribution/src/legacy_v1/mod.rs +++ b/polkadot/node/network/statement-distribution/src/legacy_v1/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/legacy_v1/tests.rs b/polkadot/node/network/statement-distribution/src/legacy_v1/tests.rs index a8ce65f2986118c9b0c432ce8bb3821026019a57..63ac1febde56a7bd53a2acacd38f5ae40d8e2913 100644 --- a/polkadot/node/network/statement-distribution/src/legacy_v1/tests.rs +++ b/polkadot/node/network/statement-distribution/src/legacy_v1/tests.rs @@ -44,7 +44,8 @@ use polkadot_node_subsystem::{ }; use polkadot_node_subsystem_test_helpers::mock::make_ferdie_keystore; use polkadot_primitives::{ - GroupIndex, Hash, HeadData, Id as ParaId, IndexedVec, SessionInfo, ValidationCode, + ExecutorParams, GroupIndex, Hash, HeadData, Id as ParaId, IndexedVec, SessionInfo, + ValidationCode, }; use polkadot_primitives_test_helpers::{ dummy_committed_candidate_receipt, dummy_hash, AlwaysZeroRng, @@ -828,6 +829,17 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == hash_a && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of peers and view handle .send(FromOrchestra::Communication { @@ -1062,6 +1074,17 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing( } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == hash_a && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of peers and view handle .send(FromOrchestra::Communication { @@ -1586,6 +1609,17 @@ fn delay_reputation_changes() { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == hash_a && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of peers and view handle .send(FromOrchestra::Communication { @@ -2060,6 +2094,17 @@ fn share_prioritizes_backing_group() { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == hash_a && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of dummy peers and view for (peer, pair) in dummy_peers.clone().into_iter().zip(dummy_pairs) { handle @@ -2376,6 +2421,17 @@ fn peer_cant_flood_with_large_statements() { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == hash_a && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of peers and view handle .send(FromOrchestra::Communication { @@ -2595,6 +2651,17 @@ fn handle_multiple_seconded_statements() { } ); + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request(r, RuntimeApiRequest::SessionExecutorParams(sess_index, tx)) + ) + if r == relay_parent_hash && sess_index == session_index + => { + let _ = tx.send(Ok(Some(ExecutorParams::default()))); + } + ); + // notify of peers and view for peer in all_peers.iter() { handle diff --git a/polkadot/node/network/statement-distribution/src/vstaging/candidates.rs b/polkadot/node/network/statement-distribution/src/vstaging/candidates.rs index 42d243614506974566bab52665dee61f9aa2add6..d6b68510f1c100e5dfd7c4ff7898399b2fd2eacc 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/candidates.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/candidates.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/cluster.rs b/polkadot/node/network/statement-distribution/src/vstaging/cluster.rs index 3214507407aa5bacb78f16cbc244ed59ac10241c..55d847f831574eeef44d8214682c52c5370081b4 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/cluster.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/cluster.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/grid.rs b/polkadot/node/network/statement-distribution/src/vstaging/grid.rs index c6c73f8bae529cc29c1345ee88b4b7f744612f64..4fd77d0ced1cef3dcba81a088c1030c444a54d04 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/grid.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/grid.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -1074,7 +1074,7 @@ mod tests { fn dummy_groups(group_size: usize) -> Groups { let groups = vec![(0..(group_size as u32)).map(ValidatorIndex).collect()].into(); - Groups::new(groups) + Groups::new(groups, 2) } #[test] diff --git a/polkadot/node/network/statement-distribution/src/vstaging/groups.rs b/polkadot/node/network/statement-distribution/src/vstaging/groups.rs index 86321b30f220ebdeadab74c7c0164458bcf46e9a..b2daa1c0ac7caf3181c12dfc74fcff0f2f0cc6ed 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/groups.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/groups.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -16,8 +16,10 @@ //! A utility for tracking groups and their members within a session. -use polkadot_node_primitives::minimum_votes; -use polkadot_primitives::vstaging::{GroupIndex, IndexedVec, ValidatorIndex}; +use polkadot_primitives::{ + effective_minimum_backing_votes, + vstaging::{GroupIndex, IndexedVec, ValidatorIndex}, +}; use std::collections::HashMap; @@ -27,12 +29,16 @@ use std::collections::HashMap; pub struct Groups { groups: IndexedVec>, by_validator_index: HashMap, + backing_threshold: u32, } impl Groups { /// Create a new [`Groups`] tracker with the groups and discovery keys /// from the session. - pub fn new(groups: IndexedVec>) -> Self { + pub fn new( + groups: IndexedVec>, + backing_threshold: u32, + ) -> Self { let mut by_validator_index = HashMap::new(); for (i, group) in groups.iter().enumerate() { @@ -42,7 +48,7 @@ impl Groups { } } - Groups { groups, by_validator_index } + Groups { groups, by_validator_index, backing_threshold } } /// Access all the underlying groups. @@ -60,7 +66,8 @@ impl Groups { &self, group_index: GroupIndex, ) -> Option<(usize, usize)> { - self.get(group_index).map(|g| (g.len(), minimum_votes(g.len()))) + self.get(group_index) + .map(|g| (g.len(), effective_minimum_backing_votes(g.len(), self.backing_threshold))) } /// Get the group index for a validator by index. diff --git a/polkadot/node/network/statement-distribution/src/vstaging/mod.rs b/polkadot/node/network/statement-distribution/src/vstaging/mod.rs index 03af4ce81598eaf79ab985c7fb85cdf9232553d0..4639720b3221add0d61eb040f44844e07cd2a502 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/mod.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -41,8 +41,9 @@ use polkadot_node_subsystem::{ overseer, ActivatedLeaf, }; use polkadot_node_subsystem_util::{ - backing_implicit_view::View as ImplicitView, reputation::ReputationAggregator, - runtime::ProspectiveParachainsMode, + backing_implicit_view::View as ImplicitView, + reputation::ReputationAggregator, + runtime::{request_min_backing_votes, ProspectiveParachainsMode}, }; use polkadot_primitives::vstaging::{ AuthorityDiscoveryId, CandidateHash, CompactStatement, CoreIndex, CoreState, GroupIndex, @@ -163,8 +164,8 @@ struct PerSessionState { } impl PerSessionState { - fn new(session_info: SessionInfo, keystore: &KeystorePtr) -> Self { - let groups = Groups::new(session_info.validator_groups.clone()); + fn new(session_info: SessionInfo, keystore: &KeystorePtr, backing_threshold: u32) -> Self { + let groups = Groups::new(session_info.validator_groups.clone(), backing_threshold); let mut authority_lookup = HashMap::new(); for (i, ad) in session_info.discovery_keys.iter().cloned().enumerate() { authority_lookup.insert(ad, ValidatorIndex(i as _)); @@ -504,9 +505,13 @@ pub(crate) async fn handle_active_leaves_update( Some(s) => s, }; - state - .per_session - .insert(session_index, PerSessionState::new(session_info, &state.keystore)); + let minimum_backing_votes = + request_min_backing_votes(new_relay_parent, session_index, ctx.sender()).await?; + + state.per_session.insert( + session_index, + PerSessionState::new(session_info, &state.keystore, minimum_backing_votes), + ); } let per_session = state @@ -2502,7 +2507,7 @@ pub(crate) async fn dispatch_requests(ctx: &mut Context, state: &mut St Some(RequestProperties { unwanted_mask, backing_threshold: if require_backing { - Some(polkadot_node_primitives::minimum_votes(group.len())) + Some(per_session.groups.get_size_and_backing_threshold(group_index)?.1) } else { None }, diff --git a/polkadot/node/network/statement-distribution/src/vstaging/requests.rs b/polkadot/node/network/statement-distribution/src/vstaging/requests.rs index 2593d81ba0b2c795f354eaa07765ad7f662cc3f9..79925f2115d430e61232e600b1db13a0886d3e88 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/requests.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/requests.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/statement_store.rs b/polkadot/node/network/statement-distribution/src/vstaging/statement_store.rs index 50ac99d0a8135482d7c4d70d2c089c58a0084b83..9ea926f24aa833177230aa9bf1c8962517acd49a 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/statement_store.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/statement_store.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/tests/cluster.rs b/polkadot/node/network/statement-distribution/src/vstaging/tests/cluster.rs index 1ff53d3fd99eed1937faa4fbd8fd4e46f39d3bb4..50d0477eb5167cb2d8a179813452373061aedd9e 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/tests/cluster.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/tests/cluster.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/tests/grid.rs b/polkadot/node/network/statement-distribution/src/vstaging/tests/grid.rs index 0c9fa60ed2e608ea86abfad3e85d59704157ca52..0739f30194378e1ec7f5e6540e37f24d60130d89 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/tests/grid.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/tests/grid.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/network/statement-distribution/src/vstaging/tests/mod.rs b/polkadot/node/network/statement-distribution/src/vstaging/tests/mod.rs index f5f4c8443257b2b5ffe8ce32af77843b7fb9349e..c5a4d14d2c7a5c13920bbc753429442d95eb3c5e 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/tests/mod.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -356,7 +356,7 @@ async fn activate_leaf( virtual_overseer: &mut VirtualOverseer, leaf: &TestLeaf, test_state: &TestState, - expect_session_info_request: bool, + is_new_session: bool, ) { let activated = ActivatedLeaf { hash: leaf.hash, @@ -371,14 +371,14 @@ async fn activate_leaf( )))) .await; - handle_leaf_activation(virtual_overseer, leaf, test_state, expect_session_info_request).await; + handle_leaf_activation(virtual_overseer, leaf, test_state, is_new_session).await; } async fn handle_leaf_activation( virtual_overseer: &mut VirtualOverseer, leaf: &TestLeaf, test_state: &TestState, - expect_session_info_request: bool, + is_new_session: bool, ) { let TestLeaf { number, hash, parent_hash, para_data, session, availability_cores } = leaf; @@ -447,7 +447,7 @@ async fn handle_leaf_activation( } ); - if expect_session_info_request { + if is_new_session { assert_matches!( virtual_overseer.recv().await, AllMessages::RuntimeApi( @@ -455,6 +455,16 @@ async fn handle_leaf_activation( tx.send(Ok(Some(test_state.session_info.clone()))).unwrap(); } ); + + assert_matches!( + virtual_overseer.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + parent, + RuntimeApiRequest::MinimumBackingVotes(session_index, tx), + )) if parent == *hash && session_index == *session => { + tx.send(Ok(2)).unwrap(); + } + ); } } diff --git a/polkadot/node/network/statement-distribution/src/vstaging/tests/requests.rs b/polkadot/node/network/statement-distribution/src/vstaging/tests/requests.rs index a86ef97f780787d101789290fe931067dba4c330..5eef5809b4d497e9334572ffa4e44f5d13ba48c5 100644 --- a/polkadot/node/network/statement-distribution/src/vstaging/tests/requests.rs +++ b/polkadot/node/network/statement-distribution/src/vstaging/tests/requests.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/overseer/examples/minimal-example.rs b/polkadot/node/overseer/examples/minimal-example.rs index a823b1d3961ec9549cc9a01dff3814b387611321..e78941776d5ec1d79d3cd52096e3bb2e649c6e54 100644 --- a/polkadot/node/overseer/examples/minimal-example.rs +++ b/polkadot/node/overseer/examples/minimal-example.rs @@ -76,6 +76,7 @@ impl Subsystem1 { let msg = CandidateValidationMessage::ValidateFromChainState( candidate_receipt, PoV { block_data: BlockData(Vec::new()) }.into(), + Default::default(), PvfExecTimeoutKind::Backing, tx, ); diff --git a/polkadot/node/overseer/src/tests.rs b/polkadot/node/overseer/src/tests.rs index 4ac538a7fd3a26bf1be149c11d2c53d132ec9235..22d9bf0a708d578a21eb53331c07a1c74630fbfb 100644 --- a/polkadot/node/overseer/src/tests.rs +++ b/polkadot/node/overseer/src/tests.rs @@ -106,6 +106,7 @@ where ctx.send_message(CandidateValidationMessage::ValidateFromChainState( candidate_receipt, PoV { block_data: BlockData(Vec::new()) }.into(), + Default::default(), PvfExecTimeoutKind::Backing, tx, )) @@ -779,6 +780,7 @@ fn test_candidate_validation_msg() -> CandidateValidationMessage { CandidateValidationMessage::ValidateFromChainState( candidate_receipt, pov, + Default::default(), PvfExecTimeoutKind::Backing, sender, ) diff --git a/polkadot/node/primitives/Cargo.toml b/polkadot/node/primitives/Cargo.toml index fcd7d4b3af97598da909f428b7330bbe8464d6c4..ef03c02f7bc67d55e4ffb9f61c0d4a3c8ecf4897 100644 --- a/polkadot/node/primitives/Cargo.toml +++ b/polkadot/node/primitives/Cargo.toml @@ -17,13 +17,13 @@ sp-consensus-babe = { path = "../../../substrate/primitives/consensus/babe" } sp-keystore = { path = "../../../substrate/primitives/keystore" } sp-maybe-compressed-blob = { path = "../../../substrate/primitives/maybe-compressed-blob" } sp-runtime = { path = "../../../substrate/primitives/runtime" } -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } schnorrkel = "0.9.1" thiserror = "1.0.31" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } [target.'cfg(not(target_os = "unknown"))'.dependencies] -zstd = { version = "0.11.2", default-features = false } +zstd = { version = "0.12.4", default-features = false } [dev-dependencies] polkadot-erasure-coding = { path = "../../erasure-coding" } diff --git a/polkadot/node/primitives/src/disputes/mod.rs b/polkadot/node/primitives/src/disputes/mod.rs index ae8602dd5fc4d81aec63e493b2735887851224a7..500b705be9574868c4b173333b6f84dd427d470c 100644 --- a/polkadot/node/primitives/src/disputes/mod.rs +++ b/polkadot/node/primitives/src/disputes/mod.rs @@ -263,9 +263,9 @@ impl SignedDisputeStatement { self.session_index } - /// Convert a [`SignedFullStatement`] to a [`SignedDisputeStatement`] + /// Convert a unchecked backing statement to a [`SignedDisputeStatement`] /// - /// As [`SignedFullStatement`] contains only the validator index and + /// As the unchecked backing statement contains only the validator index and /// not the validator public key, the public key must be passed as well, /// along with the signing context. /// diff --git a/polkadot/node/primitives/src/lib.rs b/polkadot/node/primitives/src/lib.rs index 4cebc23ad31da8e67243b4490460e2d74989be6a..463c7f960ba089c26bda8d3dad916cd1641f5ef5 100644 --- a/polkadot/node/primitives/src/lib.rs +++ b/polkadot/node/primitives/src/lib.rs @@ -39,7 +39,9 @@ pub use sp_consensus_babe::{ AllowedSlots as BabeAllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch, }; -pub use polkadot_parachain::primitives::{BlockData, HorizontalMessages, UpwardMessages}; +pub use polkadot_parachain_primitives::primitives::{ + BlockData, HorizontalMessages, UpwardMessages, +}; pub mod approval; @@ -463,8 +465,8 @@ impl CollationResult { /// Collation function. /// /// Will be called with the hash of the relay chain block the parachain block should be build on and -/// the [`ValidationData`] that provides information about the state of the parachain on the relay -/// chain. +/// the [`PersistedValidationData`] that provides information about the state of the parachain on +/// the relay chain. /// /// Returns an optional [`CollationResult`]. #[cfg(not(target_os = "unknown"))] @@ -498,7 +500,7 @@ impl std::fmt::Debug for CollationGenerationConfig { } } -/// Parameters for [`CollationGenerationMessage::SubmitCollation`]. +/// Parameters for `CollationGenerationMessage::SubmitCollation`. #[derive(Debug)] pub struct SubmitCollationParams { /// The relay-parent the collation is built against. @@ -634,7 +636,7 @@ pub struct ErasureChunk { } impl ErasureChunk { - /// Convert bounded Vec Proof to regular Vec> + /// Convert bounded Vec Proof to regular `Vec>` pub fn proof(&self) -> &Proof { &self.proof } @@ -649,10 +651,3 @@ pub fn maybe_compress_pov(pov: PoV) -> PoV { let pov = PoV { block_data: BlockData(raw) }; pov } - -/// How many votes we need to consider a candidate backed. -/// -/// WARNING: This has to be kept in sync with the runtime check in the inclusion module. -pub fn minimum_votes(n_validators: usize) -> usize { - std::cmp::min(2, n_validators) -} diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index 3c89f1d2a54bf5d47343f6a23d85be6b83bcf6ab..90881aa051a0f0952c0af71a6879c165567b5008 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -77,7 +77,7 @@ frame-benchmarking = { path = "../../../substrate/frame/benchmarking" } futures = "0.3.21" hex-literal = "0.4.1" gum = { package = "tracing-gum", path = "../gum" } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.96" thiserror = "1.0.31" kvdb = "0.13.0" @@ -94,7 +94,7 @@ is_executable = "1.0.1" polkadot-core-primitives = { path = "../../core-primitives" } polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" } polkadot-overseer = { path = "../overseer" } -polkadot-parachain = { path = "../../parachain" } +polkadot-parachain-primitives = { path = "../../parachain" } polkadot-primitives = { path = "../../primitives" } polkadot-node-primitives = { path = "../primitives" } polkadot-rpc = { path = "../../rpc" } @@ -113,7 +113,7 @@ westend-runtime-constants = { path = "../../runtime/westend/constants", optional # Polkadot Runtimes polkadot-runtime = { path = "../../runtime/polkadot", optional = true } -kusama-runtime = { path = "../../runtime/kusama", optional = true } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../runtime/kusama", optional = true } westend-runtime = { path = "../../runtime/westend", optional = true } rococo-runtime = { path = "../../runtime/rococo", optional = true } @@ -200,7 +200,7 @@ runtime-benchmarks = [ "pallet-babe/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", "pallet-staking/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", diff --git a/polkadot/node/service/src/benchmarking.rs b/polkadot/node/service/src/benchmarking.rs index 6955bc6d96900a7f4c38b419dbb8b7c9e4d06656..cfe1c873c0554b4a75d1cf6fefa389a5f56f22bd 100644 --- a/polkadot/node/service/src/benchmarking.rs +++ b/polkadot/node/service/src/benchmarking.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Code related to benchmarking a [`crate::Client`]. +//! Code related to benchmarking a node. use polkadot_primitives::AccountId; use sc_client_api::UsageProvider; diff --git a/polkadot/node/service/src/overseer.rs b/polkadot/node/service/src/overseer.rs index 1c49577508f6e3089917060e1fa685f52fe9c54e..33127b638e5a51800d3c5f88af1ac420a941b48c 100644 --- a/polkadot/node/service/src/overseer.rs +++ b/polkadot/node/service/src/overseer.rs @@ -139,7 +139,7 @@ where pub overseer_message_channel_capacity_override: Option, /// Request-response protocol names source. pub req_protocol_names: ReqProtocolNames, - /// [`PeerSet`] protocol names to protocols mapping. + /// `PeerSet` protocol names to protocols mapping. pub peerset_protocol_names: PeerSetProtocolNames, /// The offchain transaction pool factory. pub offchain_transaction_pool_factory: OffchainTransactionPoolFactory, diff --git a/polkadot/node/subsystem-test-helpers/src/lib.rs b/polkadot/node/subsystem-test-helpers/src/lib.rs index 339b99a4b5ac08723bbb3780744eaf256d998ae2..6f0c3016c7aeed7b9cddba123c7cd22013a50304 100644 --- a/polkadot/node/subsystem-test-helpers/src/lib.rs +++ b/polkadot/node/subsystem-test-helpers/src/lib.rs @@ -338,7 +338,7 @@ pub fn subsystem_test_harness( }); } -/// A forward subsystem that implements [`Subsystem`]. +/// A forward subsystem that implements [`Subsystem`](overseer::Subsystem). /// /// It forwards all communication from the overseer to the internal message /// channel. diff --git a/polkadot/node/subsystem-types/src/messages.rs b/polkadot/node/subsystem-types/src/messages.rs index 8adc39eed56db1b25880a96392dcbe97806755bb..a53908d3c2cb384c1eb004fb0bde00b5d35b6a56 100644 --- a/polkadot/node/subsystem-types/src/messages.rs +++ b/polkadot/node/subsystem-types/src/messages.rs @@ -143,6 +143,7 @@ pub enum CandidateValidationMessage { ValidateFromChainState( CandidateReceipt, Arc, + ExecutorParams, /// Execution timeout PvfExecTimeoutKind, oneshot::Sender>, @@ -161,6 +162,7 @@ pub enum CandidateValidationMessage { ValidationCode, CandidateReceipt, Arc, + ExecutorParams, /// Execution timeout PvfExecTimeoutKind, oneshot::Sender>, @@ -691,6 +693,8 @@ pub enum RuntimeApiRequest { slashing::OpaqueKeyOwnershipProof, RuntimeApiSender>, ), + /// Get the minimum required backing votes. + MinimumBackingVotes(SessionIndex, RuntimeApiSender), /// Get the backing state of the given para. /// This is a staging API that will not be available on production runtimes. @@ -719,6 +723,9 @@ impl RuntimeApiRequest { /// `SubmitReportDisputeLost` pub const SUBMIT_REPORT_DISPUTE_LOST_RUNTIME_REQUIREMENT: u32 = 5; + /// `MinimumBackingVotes` + pub const MINIMUM_BACKING_VOTES_RUNTIME_REQUIREMENT: u32 = 6; + /// Minimum version for backing state, required for async backing. /// /// 99 for now, should be adjusted to VSTAGING/actual runtime version once released. diff --git a/polkadot/node/subsystem-types/src/runtime_client.rs b/polkadot/node/subsystem-types/src/runtime_client.rs index 312cc4eec6ce997ef0c5370097bf2146e4c473bc..06aa351efb4bce18868893b9bbb2163f17e2cbe5 100644 --- a/polkadot/node/subsystem-types/src/runtime_client.rs +++ b/polkadot/node/subsystem-types/src/runtime_client.rs @@ -232,6 +232,14 @@ pub trait RuntimeApiSubsystemClient { session_index: SessionIndex, ) -> Result, ApiError>; + // === STAGING v6 === + /// Get the minimum number of backing votes. + async fn minimum_backing_votes( + &self, + at: Hash, + session_index: SessionIndex, + ) -> Result; + // === Asynchronous backing API === /// Returns candidate's acceptance limitations for asynchronous backing for a relay parent. @@ -473,6 +481,14 @@ where runtime_api.submit_report_dispute_lost(at, dispute_proof, key_ownership_proof) } + async fn minimum_backing_votes( + &self, + at: Hash, + _session_index: SessionIndex, + ) -> Result { + self.client.runtime_api().minimum_backing_votes(at) + } + async fn staging_para_backing_state( &self, at: Hash, diff --git a/polkadot/node/subsystem-util/src/backing_implicit_view.rs b/polkadot/node/subsystem-util/src/backing_implicit_view.rs index adf7fbd54258f9b2102348174b0b1cc3cb69bdb1..83c15fdef9593a3268b6c14f4ef67d2f4363dadb 100644 --- a/polkadot/node/subsystem-util/src/backing_implicit_view.rs +++ b/polkadot/node/subsystem-util/src/backing_implicit_view.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/subsystem-util/src/inclusion_emulator/mod.rs b/polkadot/node/subsystem-util/src/inclusion_emulator/mod.rs index 6ab19fa660bd2fd05bc0cbb97745e1232b26a4e2..1487077d9edaba66a6cbcfa97cb5adae067284cc 100644 --- a/polkadot/node/subsystem-util/src/inclusion_emulator/mod.rs +++ b/polkadot/node/subsystem-util/src/inclusion_emulator/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/subsystem-util/src/inclusion_emulator/staging.rs b/polkadot/node/subsystem-util/src/inclusion_emulator/staging.rs index a4b85775981d952dddb56fddaf0f9115771ef431..eb06322975282cd7ee7db14eec80b2d1556f57fd 100644 --- a/polkadot/node/subsystem-util/src/inclusion_emulator/staging.rs +++ b/polkadot/node/subsystem-util/src/inclusion_emulator/staging.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/node/subsystem-util/src/reputation.rs b/polkadot/node/subsystem-util/src/reputation.rs index 89e3eb64df9bd8d47a8e9aabb701c8bca504f140..349a6425433c55b919f74818e1e3aec2bfed0e7f 100644 --- a/polkadot/node/subsystem-util/src/reputation.rs +++ b/polkadot/node/subsystem-util/src/reputation.rs @@ -25,6 +25,7 @@ use std::{collections::HashMap, time::Duration}; /// Default delay for sending reputation changes pub const REPUTATION_CHANGE_INTERVAL: Duration = Duration::from_secs(30); +const LOG_TARGET: &'static str = "parachain::reputation-aggregator"; type BatchReputationChange = HashMap; @@ -75,6 +76,10 @@ impl ReputationAggregator { peer_id: PeerId, rep: UnifiedReputationChange, ) { + if rep.cost_or_benefit() < 0 { + gum::debug!(target: LOG_TARGET, peer = ?peer_id, ?rep, "Reduce reputation"); + } + if (self.send_immediately_if)(rep) { self.single_send(sender, peer_id, rep).await; } else { @@ -97,12 +102,8 @@ impl ReputationAggregator { } fn add(&mut self, peer_id: PeerId, rep: UnifiedReputationChange) { - if self.by_peer.is_none() { - self.by_peer = Some(HashMap::new()); - } - if let Some(ref mut by_peer) = self.by_peer { - add_reputation(by_peer, peer_id, rep) - } + let by_peer = self.by_peer.get_or_insert(HashMap::new()); + add_reputation(by_peer, peer_id, rep) } } diff --git a/polkadot/node/subsystem-util/src/runtime/error.rs b/polkadot/node/subsystem-util/src/runtime/error.rs index db3eacd68514124170bbdb972cc1e1cacbd03e00..8751693b078a6797584ed59a2ebd3c320d87cd78 100644 --- a/polkadot/node/subsystem-util/src/runtime/error.rs +++ b/polkadot/node/subsystem-util/src/runtime/error.rs @@ -33,17 +33,21 @@ pub enum Error { /// Some request to the runtime failed. /// For example if we prune a block we're requesting info about. #[error("Runtime API error {0}")] - RuntimeRequest(RuntimeApiError), + RuntimeRequest(#[from] RuntimeApiError), /// We tried fetching a session info which was not available. #[error("There was no session with the given index {0}")] NoSuchSession(SessionIndex), + + /// We tried fetching executor params for a session which were not available. + #[error("There was no executor parameters for session with the given index {0}")] + NoExecutorParams(SessionIndex), } pub type Result = std::result::Result; /// Receive a response from a runtime request and convert errors. -pub(crate) async fn recv_runtime( +pub async fn recv_runtime( r: oneshot::Receiver>, ) -> Result { let result = r diff --git a/polkadot/node/subsystem-util/src/runtime/mod.rs b/polkadot/node/subsystem-util/src/runtime/mod.rs index a044a64e93a0d9622f48fc7193b87f476def38f8..fc767faa763c475be46773f27f0be9bf2f39e3e6 100644 --- a/polkadot/node/subsystem-util/src/runtime/mod.rs +++ b/polkadot/node/subsystem-util/src/runtime/mod.rs @@ -24,27 +24,30 @@ use sp_core::crypto::ByteArray; use sp_keystore::{Keystore, KeystorePtr}; use polkadot_node_subsystem::{ - errors::RuntimeApiError, messages::RuntimeApiMessage, overseer, SubsystemSender, + errors::RuntimeApiError, + messages::{RuntimeApiMessage, RuntimeApiRequest}, + overseer, SubsystemSender, }; use polkadot_primitives::{ - vstaging, CandidateEvent, CandidateHash, CoreState, EncodeAs, GroupIndex, GroupRotationInfo, - Hash, IndexedVec, OccupiedCore, ScrapedOnChainVotes, SessionIndex, SessionInfo, Signed, - SigningContext, UncheckedSigned, ValidationCode, ValidationCodeHash, ValidatorId, - ValidatorIndex, + vstaging, CandidateEvent, CandidateHash, CoreState, EncodeAs, ExecutorParams, GroupIndex, + GroupRotationInfo, Hash, IndexedVec, OccupiedCore, ScrapedOnChainVotes, SessionIndex, + SessionInfo, Signed, SigningContext, UncheckedSigned, ValidationCode, ValidationCodeHash, + ValidatorId, ValidatorIndex, LEGACY_MIN_BACKING_VOTES, }; use crate::{ - request_availability_cores, request_candidate_events, request_key_ownership_proof, - request_on_chain_votes, request_session_index_for_child, request_session_info, - request_staging_async_backing_params, request_submit_report_dispute_lost, - request_unapplied_slashes, request_validation_code_by_hash, request_validator_groups, + request_availability_cores, request_candidate_events, request_from_runtime, + request_key_ownership_proof, request_on_chain_votes, request_session_executor_params, + request_session_index_for_child, request_session_info, request_staging_async_backing_params, + request_submit_report_dispute_lost, request_unapplied_slashes, request_validation_code_by_hash, + request_validator_groups, }; /// Errors that can happen on runtime fetches. mod error; -use error::{recv_runtime, Result}; -pub use error::{Error, FatalError, JfyiError}; +use error::Result; +pub use error::{recv_runtime, Error, FatalError, JfyiError}; const LOG_TARGET: &'static str = "parachain::runtime-info"; @@ -82,6 +85,8 @@ pub struct ExtendedSessionInfo { pub session_info: SessionInfo, /// Contains useful information about ourselves, in case this node is a validator. pub validator_info: ValidatorInfo, + /// Session executor parameters + pub executor_params: ExecutorParams, } /// Information about ourselves, in case we are an `Authority`. @@ -172,9 +177,15 @@ impl RuntimeInfo { recv_runtime(request_session_info(parent, session_index, sender).await) .await? .ok_or(JfyiError::NoSuchSession(session_index))?; + + let executor_params = + recv_runtime(request_session_executor_params(parent, session_index, sender).await) + .await? + .ok_or(JfyiError::NoExecutorParams(session_index))?; + let validator_info = self.get_validator_info(&session_info)?; - let full_info = ExtendedSessionInfo { session_info, validator_info }; + let full_info = ExtendedSessionInfo { session_info, validator_info, executor_params }; self.session_info_cache.insert(session_index, full_info); } @@ -451,3 +462,32 @@ where }) } } + +/// Request the min backing votes value. +/// Prior to runtime API version 6, just return a hardcoded constant. +pub async fn request_min_backing_votes( + parent: Hash, + session_index: SessionIndex, + sender: &mut impl overseer::SubsystemSender, +) -> Result { + let min_backing_votes_res = recv_runtime( + request_from_runtime(parent, sender, |tx| { + RuntimeApiRequest::MinimumBackingVotes(session_index, tx) + }) + .await, + ) + .await; + + if let Err(Error::RuntimeRequest(RuntimeApiError::NotSupported { .. })) = min_backing_votes_res + { + gum::trace!( + target: LOG_TARGET, + ?parent, + "Querying the backing threshold from the runtime is not supported by the current Runtime API", + ); + + Ok(LEGACY_MIN_BACKING_VOTES) + } else { + min_backing_votes_res + } +} diff --git a/polkadot/node/test/client/src/block_builder.rs b/polkadot/node/test/client/src/block_builder.rs index 0987cef55c1f1a2a377fdf62a947efb70eab4ef0..b4ff050ff1529f29886f281a1a0f0ebffed2a13a 100644 --- a/polkadot/node/test/client/src/block_builder.rs +++ b/polkadot/node/test/client/src/block_builder.rs @@ -41,7 +41,7 @@ pub trait InitPolkadotBlockBuilder { /// Init a Polkadot specific block builder at a specific block that works for the test runtime. /// /// Same as [`InitPolkadotBlockBuilder::init_polkadot_block_builder`] besides that it takes a - /// [`BlockId`] to say which should be the parent block of the block that is being build. + /// `Hash` to say which should be the parent block of the block that is being build. fn init_polkadot_block_builder_at( &self, hash: ::Hash, diff --git a/polkadot/node/test/performance-test/Cargo.toml b/polkadot/node/test/performance-test/Cargo.toml index 0c5192571b28d58cdbd504991a364e9a0b593c90..98b67615a6f253e69e547568f7a1606fb4678682 100644 --- a/polkadot/node/test/performance-test/Cargo.toml +++ b/polkadot/node/test/performance-test/Cargo.toml @@ -20,7 +20,7 @@ polkadot-primitives = { path = "../../../primitives" } sc-executor-common = { path = "../../../../substrate/client/executor/common" } sp-maybe-compressed-blob = { path = "../../../../substrate/primitives/maybe-compressed-blob" } -kusama-runtime = { path = "../../../runtime/kusama" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../../runtime/kusama" } [[bin]] name = "gen-ref-constants" diff --git a/polkadot/node/test/service/Cargo.toml b/polkadot/node/test/service/Cargo.toml index 2c8f06496697b52c2fbd1fa54f670f8faa81d668..d730a601d5a765c7d9a90c97b5d4fbb1005d727f 100644 --- a/polkadot/node/test/service/Cargo.toml +++ b/polkadot/node/test/service/Cargo.toml @@ -17,7 +17,7 @@ tokio = "1.24.2" # Polkadot dependencies polkadot-overseer = { path = "../../overseer" } polkadot-primitives = { path = "../../../primitives" } -polkadot-parachain = { path = "../../../parachain" } +polkadot-parachain-primitives = { path = "../../../parachain" } polkadot-rpc = { path = "../../../rpc" } polkadot-runtime-common = { path = "../../../runtime/common" } polkadot-service = { path = "../../service" } @@ -68,7 +68,7 @@ runtime-benchmarks= [ "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-staking/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", diff --git a/polkadot/node/test/service/tests/build-blocks.rs b/polkadot/node/test/service/tests/build-blocks.rs index b75fed60297ab902f30453ed8d8cfc5246e95a22..d5c6ab0b5ba66b7a653d7d632bbde6fd07dd0b5c 100644 --- a/polkadot/node/test/service/tests/build-blocks.rs +++ b/polkadot/node/test/service/tests/build-blocks.rs @@ -18,7 +18,7 @@ use futures::{future, pin_mut, select, FutureExt}; use polkadot_test_service::*; use sp_keyring::Sr25519Keyring; -#[substrate_test_utils::test(flavor = "multi_thread")] +#[tokio::test(flavor = "multi_thread")] async fn ensure_test_service_build_blocks() { let mut builder = sc_cli::LoggerBuilder::new(""); builder.with_colors(false); diff --git a/polkadot/node/test/service/tests/call-function.rs b/polkadot/node/test/service/tests/call-function.rs index c3baefdb9c91a4b338ebe266bee51028def80189..39d162eb37697b575f0195fec2b61b934920a4e9 100644 --- a/polkadot/node/test/service/tests/call-function.rs +++ b/polkadot/node/test/service/tests/call-function.rs @@ -17,7 +17,7 @@ use polkadot_test_service::*; use sp_keyring::Sr25519Keyring::{Alice, Bob, Charlie}; -#[substrate_test_utils::test(flavor = "multi_thread")] +#[tokio::test(flavor = "multi_thread")] async fn call_function_actually_work() { let alice_config = node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true); diff --git a/polkadot/parachain/Cargo.toml b/polkadot/parachain/Cargo.toml index b51ed8e9ecfe732acfe6146e88b0b6eabb4a3ec1..c44ba02e3aeb0f7ada07698ab69703e9ff2ecae7 100644 --- a/polkadot/parachain/Cargo.toml +++ b/polkadot/parachain/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-parachain" +name = "polkadot-parachain-primitives" description = "Types and utilities for creating and working with parachains" authors.workspace = true edition.workspace = true @@ -21,7 +21,7 @@ derive_more = "0.99.11" bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] } # all optional crates. -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] } [features] default = [ "std" ] diff --git a/polkadot/parachain/src/lib.rs b/polkadot/parachain/src/lib.rs index 7bead2314839f4974494297952293e62f6fba061..913d887e4a8a73a4a35aea9dd5b62edc579efce3 100644 --- a/polkadot/parachain/src/lib.rs +++ b/polkadot/parachain/src/lib.rs @@ -27,10 +27,11 @@ //! instance and exports a function `validate_block`. //! //! `validate` accepts as input two `i32` values, representing a pointer/length pair -//! respectively, that encodes [`ValidationParams`]. +//! respectively, that encodes [`ValidationParams`](primitives::ValidationParams). //! //! `validate` returns an `u64` which is a pointer to an `u8` array and its length. -//! The data in the array is expected to be a SCALE encoded [`ValidationResult`]. +//! The data in the array is expected to be a SCALE encoded +//! [`ValidationResult`](primitives::ValidationResult). //! //! ASCII-diagram demonstrating the return data format: //! diff --git a/polkadot/parachain/test-parachains/adder/Cargo.toml b/polkadot/parachain/test-parachains/adder/Cargo.toml index 49e10dbd492786fdcdc70a65c2d6ea9daabce122..f22b5ccfdcc9894bd1e6cd29212648a1cdd58e16 100644 --- a/polkadot/parachain/test-parachains/adder/Cargo.toml +++ b/polkadot/parachain/test-parachains/adder/Cargo.toml @@ -9,7 +9,7 @@ authors.workspace = true publish = false [dependencies] -parachain = { package = "polkadot-parachain", path = "../..", default-features = false, features = [ "wasm-api" ] } +parachain = { package = "polkadot-parachain-primitives", path = "../..", default-features = false, features = [ "wasm-api" ] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } sp-std = { path = "../../../../substrate/primitives/std", default-features = false } tiny-keccak = { version = "2.0.2", features = ["keccak"] } diff --git a/polkadot/parachain/test-parachains/adder/collator/Cargo.toml b/polkadot/parachain/test-parachains/adder/collator/Cargo.toml index f706156d0cd842c5387b08665667ea94722d857d..7079ab73270482ccd053933d5aeb1cf1864db9d0 100644 --- a/polkadot/parachain/test-parachains/adder/collator/Cargo.toml +++ b/polkadot/parachain/test-parachains/adder/collator/Cargo.toml @@ -18,7 +18,7 @@ required-features = ["test-utils"] [dependencies] parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.2" log = "0.4.17" @@ -39,7 +39,7 @@ sc-service = { path = "../../../../../substrate/client/service" } polkadot-node-core-pvf = { path = "../../../../node/core/pvf", features = ["test-utils"], optional = true } [dev-dependencies] -polkadot-parachain = { path = "../../.." } +polkadot-parachain-primitives = { path = "../../.." } polkadot-test-service = { path = "../../../../node/test/service" } substrate-test-utils = { path = "../../../../../substrate/test-utils" } diff --git a/polkadot/parachain/test-parachains/adder/collator/src/lib.rs b/polkadot/parachain/test-parachains/adder/collator/src/lib.rs index 1ac561dda2bad6b889976fa8ab3ce50c34d07ff4..5f62ae34caefa5db97f6481dfc21067e42666b50 100644 --- a/polkadot/parachain/test-parachains/adder/collator/src/lib.rs +++ b/polkadot/parachain/test-parachains/adder/collator/src/lib.rs @@ -249,7 +249,7 @@ mod tests { use super::*; use futures::executor::block_on; - use polkadot_parachain::primitives::{ValidationParams, ValidationResult}; + use polkadot_parachain_primitives::primitives::{ValidationParams, ValidationResult}; use polkadot_primitives::PersistedValidationData; #[test] diff --git a/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs b/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs index b891b29db59c1b82cbc658f583274557329345fd..6b481f961a429c56912848668f3afdd260e56914 100644 --- a/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs +++ b/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs @@ -22,7 +22,7 @@ const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_adder_collator_puppet_worker"); // If this test is failing, make sure to run all tests with the `real-overseer` feature being // enabled. -#[substrate_test_utils::test(flavor = "multi_thread")] +#[tokio::test(flavor = "multi_thread")] async fn collating_using_adder_collator() { use polkadot_primitives::Id as ParaId; use sp_keyring::AccountKeyring::*; diff --git a/polkadot/parachain/test-parachains/undying/Cargo.toml b/polkadot/parachain/test-parachains/undying/Cargo.toml index 2766fb4e8a66369a52aed176a41a6ba28c98caf1..8690da5a4bdd36ffce083032bed0200d2c9960d7 100644 --- a/polkadot/parachain/test-parachains/undying/Cargo.toml +++ b/polkadot/parachain/test-parachains/undying/Cargo.toml @@ -9,7 +9,7 @@ edition.workspace = true license.workspace = true [dependencies] -parachain = { package = "polkadot-parachain", path = "../..", default-features = false, features = [ "wasm-api" ] } +parachain = { package = "polkadot-parachain-primitives", path = "../..", default-features = false, features = [ "wasm-api" ] } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } sp-std = { path = "../../../../substrate/primitives/std", default-features = false } tiny-keccak = { version = "2.0.2", features = ["keccak"] } diff --git a/polkadot/parachain/test-parachains/undying/collator/Cargo.toml b/polkadot/parachain/test-parachains/undying/collator/Cargo.toml index c5eae3802c63e6540086fdf9532c3e18f338daed..0f1fd60a90001f3934f184ea96920c41fcd15bc7 100644 --- a/polkadot/parachain/test-parachains/undying/collator/Cargo.toml +++ b/polkadot/parachain/test-parachains/undying/collator/Cargo.toml @@ -18,7 +18,7 @@ required-features = ["test-utils"] [dependencies] parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } futures = "0.3.19" futures-timer = "3.0.2" log = "0.4.17" @@ -39,7 +39,7 @@ sc-service = { path = "../../../../../substrate/client/service" } polkadot-node-core-pvf = { path = "../../../../node/core/pvf", features = ["test-utils"], optional = true } [dev-dependencies] -polkadot-parachain = { path = "../../.." } +polkadot-parachain-primitives = { path = "../../.." } polkadot-test-service = { path = "../../../../node/test/service" } # For the puppet worker, depend on ourselves with the test-utils feature. test-parachain-undying-collator = { path = "", features = ["test-utils"] } diff --git a/polkadot/parachain/test-parachains/undying/collator/src/lib.rs b/polkadot/parachain/test-parachains/undying/collator/src/lib.rs index e0ecc6b0997d76c39afacc661f05c5be564137e1..3c869233182f8faf98e8855017a0e255d5b43167 100644 --- a/polkadot/parachain/test-parachains/undying/collator/src/lib.rs +++ b/polkadot/parachain/test-parachains/undying/collator/src/lib.rs @@ -338,7 +338,7 @@ use sp_core::traits::SpawnNamed; mod tests { use super::*; use futures::executor::block_on; - use polkadot_parachain::primitives::{ValidationParams, ValidationResult}; + use polkadot_parachain_primitives::primitives::{ValidationParams, ValidationResult}; use polkadot_primitives::{Hash, PersistedValidationData}; #[test] diff --git a/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs b/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs index 21d174fb06c7166cf77a2d494db05c762532fb21..a98a7ff6eefc48f913d5e17f4a0c750a81c8eafd 100644 --- a/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs +++ b/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs @@ -21,7 +21,7 @@ const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_undying_collator_puppet_worker"); // If this test is failing, make sure to run all tests with the `real-overseer` feature being // enabled. -#[substrate_test_utils::test(flavor = "multi_thread")] +#[tokio::test(flavor = "multi_thread")] async fn collating_using_undying_collator() { use polkadot_primitives::Id as ParaId; use sp_keyring::AccountKeyring::*; diff --git a/polkadot/primitives/Cargo.toml b/polkadot/primitives/Cargo.toml index 520d10261be1c23e5492acece473d3a30b08ced5..9d17b70b817432fae385d5b96a30105d87a77e68 100644 --- a/polkadot/primitives/Cargo.toml +++ b/polkadot/primitives/Cargo.toml @@ -10,7 +10,7 @@ bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } hex-literal = "0.4.1" parity-scale-codec = { version = "3.6.1", default-features = false, features = ["bit-vec", "derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["bit-vec", "derive", "serde"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] } application-crypto = { package = "sp-application-crypto", path = "../../substrate/primitives/application-crypto", default-features = false, features = ["serde"] } inherents = { package = "sp-inherents", path = "../../substrate/primitives/inherents", default-features = false } @@ -26,7 +26,7 @@ sp-staking = { path = "../../substrate/primitives/staking", default-features = f sp-std = { package = "sp-std", path = "../../substrate/primitives/std", default-features = false } polkadot-core-primitives = { path = "../core-primitives", default-features = false } -polkadot-parachain = { path = "../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../parachain", default-features = false } [features] default = [ "std" ] @@ -36,7 +36,7 @@ std = [ "inherents/std", "parity-scale-codec/std", "polkadot-core-primitives/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "primitives/std", "runtime_primitives/std", "scale-info/std", @@ -51,7 +51,7 @@ std = [ "sp-std/std", ] runtime-benchmarks = [ - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "runtime_primitives/runtime-benchmarks", "sp-staking/runtime-benchmarks", ] diff --git a/polkadot/primitives/src/lib.rs b/polkadot/primitives/src/lib.rs index 3680cb857e66e441823422e5c7cb079d8f1279bb..729908cc12ba0d471a2f0fbc93f972e575f1f220 100644 --- a/polkadot/primitives/src/lib.rs +++ b/polkadot/primitives/src/lib.rs @@ -34,19 +34,19 @@ pub mod runtime_api; // Current primitives not requiring versioning are exported here. // Primitives requiring versioning must not be exported and must be referred by an exact version. pub use v5::{ - byzantine_threshold, check_candidate_backing, collator_signature_payload, metric_definitions, - slashing, supermajority_threshold, well_known_keys, AbridgedHostConfiguration, - AbridgedHrmpChannel, AccountId, AccountIndex, AccountPublic, ApprovalVote, AssignmentId, - AuthorityDiscoveryId, AvailabilityBitfield, BackedCandidate, Balance, BlakeTwo256, Block, - BlockId, BlockNumber, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, - CandidateIndex, CandidateReceipt, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, - CollatorId, CollatorSignature, CommittedCandidateReceipt, CompactStatement, ConsensusLog, - CoreIndex, CoreOccupied, CoreState, DisputeState, DisputeStatement, DisputeStatementSet, - DownwardMessage, EncodeAs, ExecutorParam, ExecutorParams, ExecutorParamsHash, - ExplicitDisputeStatement, GroupIndex, GroupRotationInfo, Hash, HashT, HeadData, Header, - HrmpChannelId, Id, InboundDownwardMessage, InboundHrmpMessage, IndexedVec, InherentData, - InvalidDisputeStatementKind, Moment, MultiDisputeStatementSet, Nonce, OccupiedCore, - OccupiedCoreAssumption, OutboundHrmpMessage, ParathreadClaim, ParathreadEntry, + byzantine_threshold, check_candidate_backing, collator_signature_payload, + effective_minimum_backing_votes, metric_definitions, slashing, supermajority_threshold, + well_known_keys, AbridgedHostConfiguration, AbridgedHrmpChannel, AccountId, AccountIndex, + AccountPublic, ApprovalVote, AssignmentId, AuthorityDiscoveryId, AvailabilityBitfield, + BackedCandidate, Balance, BlakeTwo256, Block, BlockId, BlockNumber, CandidateCommitments, + CandidateDescriptor, CandidateEvent, CandidateHash, CandidateIndex, CandidateReceipt, + CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, CollatorId, CollatorSignature, + CommittedCandidateReceipt, CompactStatement, ConsensusLog, CoreIndex, CoreOccupied, CoreState, + DisputeState, DisputeStatement, DisputeStatementSet, DownwardMessage, EncodeAs, ExecutorParam, + ExecutorParams, ExecutorParamsHash, ExplicitDisputeStatement, GroupIndex, GroupRotationInfo, + Hash, HashT, HeadData, Header, HrmpChannelId, Id, InboundDownwardMessage, InboundHrmpMessage, + IndexedVec, InherentData, InvalidDisputeStatementKind, Moment, MultiDisputeStatementSet, Nonce, + OccupiedCore, OccupiedCoreAssumption, OutboundHrmpMessage, ParathreadClaim, ParathreadEntry, PersistedValidationData, PvfCheckStatement, PvfExecTimeoutKind, PvfPrepTimeoutKind, RuntimeMetricLabel, RuntimeMetricLabelValue, RuntimeMetricLabelValues, RuntimeMetricLabels, RuntimeMetricOp, RuntimeMetricUpdate, ScheduledCore, ScrapedOnChainVotes, SessionIndex, @@ -55,9 +55,9 @@ pub use v5::{ UncheckedSignedAvailabilityBitfields, UncheckedSignedStatement, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature, ValidityAttestation, - ValidityError, ASSIGNMENT_KEY_TYPE_ID, LOWEST_PUBLIC_ID, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, - MAX_POV_SIZE, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, PARACHAINS_INHERENT_IDENTIFIER, - PARACHAIN_KEY_TYPE_ID, + ValidityError, ASSIGNMENT_KEY_TYPE_ID, LEGACY_MIN_BACKING_VOTES, LOWEST_PUBLIC_ID, + MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, MAX_POV_SIZE, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, + PARACHAINS_INHERENT_IDENTIFIER, PARACHAIN_KEY_TYPE_ID, }; #[cfg(feature = "std")] diff --git a/polkadot/primitives/src/runtime_api.rs b/polkadot/primitives/src/runtime_api.rs index 483256fe20f3689639844fcbeade405ba21650eb..e5f1aa4276ef5ab993daf02cf778ecf652f4c712 100644 --- a/polkadot/primitives/src/runtime_api.rs +++ b/polkadot/primitives/src/runtime_api.rs @@ -121,7 +121,7 @@ use crate::{ }; use parity_scale_codec::{Decode, Encode}; use polkadot_core_primitives as pcp; -use polkadot_parachain::primitives as ppp; +use polkadot_parachain_primitives::primitives as ppp; use sp_std::{collections::btree_map::BTreeMap, prelude::*}; sp_api::decl_runtime_apis! { @@ -240,6 +240,13 @@ sp_api::decl_runtime_apis! { key_ownership_proof: vstaging::slashing::OpaqueKeyOwnershipProof, ) -> Option<()>; + /***** Staging *****/ + + /// Get the minimum number of backing votes for a parachain candidate. + /// This is a staging method! Do not use on production runtimes! + #[api_version(6)] + fn minimum_backing_votes() -> u32; + /***** Asynchronous backing *****/ /// Returns the state of parachain backing for a given para. diff --git a/polkadot/primitives/src/v5/mod.rs b/polkadot/primitives/src/v5/mod.rs index 59fb6c927b2df588cca6e442c00b977941597d76..eed4cc2b36ba6b4214a3fcfc048edcc0120fc998 100644 --- a/polkadot/primitives/src/v5/mod.rs +++ b/polkadot/primitives/src/v5/mod.rs @@ -42,7 +42,7 @@ pub use polkadot_core_primitives::v2::{ }; // Export some polkadot-parachain primitives -pub use polkadot_parachain::primitives::{ +pub use polkadot_parachain_primitives::primitives::{ HeadData, HorizontalMessages, HrmpChannelId, Id, UpwardMessage, UpwardMessages, ValidationCode, ValidationCodeHash, LOWEST_PUBLIC_ID, LOWEST_USER_ID, }; @@ -390,6 +390,10 @@ pub const MAX_POV_SIZE: u32 = 5 * 1024 * 1024; /// Can be adjusted in configuration. pub const ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE: u32 = 10_000; +/// Backing votes threshold used from the host prior to runtime API version 6 and from the runtime +/// prior to v9 configuration migration. +pub const LEGACY_MIN_BACKING_VOTES: u32 = 2; + // The public key of a keypair used by a validator for determining assignments /// to approve included parachain candidates. mod assignment_app { @@ -1009,7 +1013,7 @@ impl OccupiedCore { pub struct ScheduledCore { /// The ID of a para scheduled. pub para_id: Id, - /// DEPRECATED: see: https://github.com/paritytech/polkadot/issues/7575 + /// DEPRECATED: see: /// /// Will be removed in a future version. pub collator: Option, @@ -1695,6 +1699,14 @@ pub const fn supermajority_threshold(n: usize) -> usize { n - byzantine_threshold(n) } +/// Adjust the configured needed backing votes with the size of the backing group. +pub fn effective_minimum_backing_votes( + group_len: usize, + configured_minimum_backing_votes: u32, +) -> usize { + sp_std::cmp::min(group_len, configured_minimum_backing_votes as usize) +} + /// Information about validator sets of a session. /// /// NOTE: `SessionInfo` is frozen. Do not include new fields, consider creating a separate runtime @@ -1735,8 +1747,8 @@ pub struct SessionInfo { /// /// Therefore: /// ```ignore - /// assignment_keys.len() == validators.len() && validators.len() <= discovery_keys.len() - /// ``` + /// assignment_keys.len() == validators.len() && validators.len() <= discovery_keys.len() + /// ``` pub assignment_keys: Vec, /// Validators in shuffled ordering - these are the validator groups as produced /// by the `Scheduler` module for the session and are typically referred to by diff --git a/polkadot/primitives/src/v5/slashing.rs b/polkadot/primitives/src/v5/slashing.rs index 34424a00d23c8b5bd965beb970b6e98cf49056ee..efffb932cdc0d997e08f9d195e2c42b857a7c8f5 100644 --- a/polkadot/primitives/src/v5/slashing.rs +++ b/polkadot/primitives/src/v5/slashing.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/roadmap/implementers-guide/src/types/README.md b/polkadot/roadmap/implementers-guide/src/types/README.md index 807130a5e66b25c441f4945fc2dfb3b63de4f354..87092bf3a005353b09d375b89f599c2918295ef5 100644 --- a/polkadot/roadmap/implementers-guide/src/types/README.md +++ b/polkadot/roadmap/implementers-guide/src/types/README.md @@ -31,7 +31,7 @@ digraph { CandidateDescriptor:collator -> CollatorId:w CandidateDescriptor:persisted_validation_data_hash -> PersistedValidationDataHash - Id [label="polkadot_parachain::primitives::Id"] + Id [label="polkadot_parachain_primitives::primitives::Id"] CollatorId [label="polkadot_primitives::v2::CollatorId"] PoVHash [label = "Hash", shape="doublecircle", fill="gray90"] @@ -128,11 +128,11 @@ digraph { >] - CandidateCommitments:upward_messages -> "polkadot_parachain::primitives::UpwardMessage":w + CandidateCommitments:upward_messages -> "polkadot_parachain_primitives::primitives::UpwardMessage":w CandidateCommitments:horizontal_messages -> "polkadot_core_primitives::v2::OutboundHrmpMessage":w CandidateCommitments:head_data -> HeadData:w - CandidateCommitments:horizontal_messages -> "polkadot_parachain::primitives::Id":w - CandidateCommitments:new_validation_code -> "polkadot_parachain::primitives::ValidationCode":w + CandidateCommitments:horizontal_messages -> "polkadot_parachain_primitives::primitives::Id":w + CandidateCommitments:new_validation_code -> "polkadot_parachain_primitives::primitives::ValidationCode":w PoV [label = < @@ -141,7 +141,7 @@ digraph {
>] - PoV:block_data -> "polkadot_parachain::primitives::BlockData":w + PoV:block_data -> "polkadot_parachain_primitives::primitives::BlockData":w BackedCandidate [label = < @@ -155,7 +155,7 @@ digraph { BackedCandidate:candidate -> CommittedCandidateReceipt:name BackedCandidate:validity_votes -> "polkadot_primitives:v0:ValidityAttestation":w - HeadData [label = "polkadot_parachain::primitives::HeadData"] + HeadData [label = "polkadot_parachain_primitives::primitives::HeadData"] CoreIndex [label = <
diff --git a/polkadot/runtime/common/Cargo.toml b/polkadot/runtime/common/Cargo.toml index 484eb826f29cd374aea7617532a24439400828ef..83aa70cd308a0576a628486dc9bd8f6a839912bc 100644 --- a/polkadot/runtime/common/Cargo.toml +++ b/polkadot/runtime/common/Cargo.toml @@ -12,7 +12,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["alloc"] } +serde = { version = "1.0.188", default-features = false, features = ["alloc"] } serde_derive = { version = "1.0.117" } static_assertions = "1.1.0" @@ -49,7 +49,7 @@ libsecp256k1 = { version = "0.7.0", default-features = false } runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } slot-range-helper = { path = "slot_range_helper", default-features = false } -xcm = { path = "../../xcm", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } [dev-dependencies] hex-literal = "0.4.1" diff --git a/polkadot/runtime/common/src/assigned_slots/migration.rs b/polkadot/runtime/common/src/assigned_slots/migration.rs index 884d67222d281afb1c8c5b302dc6d466af141c8f..656e0836bba3fa34572e45812f9e2a24b165e568 100644 --- a/polkadot/runtime/common/src/assigned_slots/migration.rs +++ b/polkadot/runtime/common/src/assigned_slots/migration.rs @@ -15,10 +15,7 @@ // along with Polkadot. If not, see . use super::{Config, MaxPermanentSlots, MaxTemporarySlots, Pallet, LOG_TARGET}; -use frame_support::{ - dispatch::GetStorageVersion, - traits::{Get, OnRuntimeUpgrade}, -}; +use frame_support::traits::{Get, GetStorageVersion, OnRuntimeUpgrade}; #[cfg(feature = "try-runtime")] use frame_support::ensure; @@ -63,11 +60,11 @@ pub mod v1 { } } - /// [`VersionUncheckedMigrateToV1`] wrapped in a - /// [`frame_support::migrations::VersionedRuntimeUpgrade`], ensuring the migration is only - /// performed when on-chain version is 0. + /// [`MigrateToV1`] wrapped in a + /// [`VersionedMigration`](frame_support::migrations::VersionedMigration), ensuring the + /// migration is only performed when on-chain version is 0. #[cfg(feature = "experimental")] - pub type VersionCheckedMigrateToV1 = frame_support::migrations::VersionedRuntimeUpgrade< + pub type VersionCheckedMigrateToV1 = frame_support::migrations::VersionedMigration< 0, 1, MigrateToV1, diff --git a/polkadot/runtime/common/src/auctions.rs b/polkadot/runtime/common/src/auctions.rs index 9c2bb04b9c8ea6f5917738583887b108e0847de5..e35303912fa1dca33d175646dfe75ace3f719d19 100644 --- a/polkadot/runtime/common/src/auctions.rs +++ b/polkadot/runtime/common/src/auctions.rs @@ -677,9 +677,7 @@ mod tests { use crate::{auctions, mock::TestRegistrar}; use ::test_helpers::{dummy_hash, dummy_head_data, dummy_validation_code}; use frame_support::{ - assert_noop, assert_ok, assert_storage_noop, - dispatch::DispatchError::BadOrigin, - ord_parameter_types, parameter_types, + assert_noop, assert_ok, assert_storage_noop, ord_parameter_types, parameter_types, traits::{ConstU32, EitherOfDiverse, OnFinalize, OnInitialize}, }; use frame_system::{EnsureRoot, EnsureSignedBy}; @@ -689,6 +687,7 @@ mod tests { use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, BuildStorage, + DispatchError::BadOrigin, }; use std::{cell::RefCell, collections::BTreeMap}; diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index 9cc06b2bede29808e984230d4c2355073eacaebb..0c736a632842336e30d12381697e4d638a65d74a 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -711,7 +711,7 @@ mod tests { use claims::Call as ClaimsCall; use frame_support::{ assert_err, assert_noop, assert_ok, - dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays}, + dispatch::{GetDispatchInfo, Pays}, ord_parameter_types, parameter_types, traits::{ConstU32, ExistenceRequirement, WithdrawReasons}, }; @@ -719,7 +719,9 @@ mod tests { use sp_runtime::{ traits::{BlakeTwo256, Identity, IdentityLookup}, transaction_validity::TransactionLongevity, - BuildStorage, TokenError, + BuildStorage, + DispatchError::BadOrigin, + TokenError, }; type Block = frame_system::mocking::MockBlock; @@ -1470,7 +1472,7 @@ mod benchmarking { use super::*; use crate::claims::Call; use frame_benchmarking::{account, benchmarks}; - use frame_support::dispatch::UnfilteredDispatchable; + use frame_support::traits::UnfilteredDispatchable; use frame_system::RawOrigin; use secp_utils::*; use sp_runtime::{traits::ValidateUnsigned, DispatchResult}; diff --git a/polkadot/runtime/common/src/crowdloan/migration.rs b/polkadot/runtime/common/src/crowdloan/migration.rs index 03c4ab6c31193478b5c0cc9cb45b9f3437d8254c..5133c14ada9276a56ae91f38e8a67b4846979866 100644 --- a/polkadot/runtime/common/src/crowdloan/migration.rs +++ b/polkadot/runtime/common/src/crowdloan/migration.rs @@ -16,9 +16,8 @@ use super::*; use frame_support::{ - dispatch::GetStorageVersion, storage_alias, - traits::{OnRuntimeUpgrade, StorageVersion}, + traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion}, Twox64Concat, }; diff --git a/polkadot/runtime/common/src/elections.rs b/polkadot/runtime/common/src/elections.rs index 5fd3971180f6a82c50ba2b9797a4fcf1334e2b7f..340e5c6e4acf69fa0d433d975a05c6f72117130a 100644 --- a/polkadot/runtime/common/src/elections.rs +++ b/polkadot/runtime/common/src/elections.rs @@ -18,7 +18,8 @@ /// Implements the weight types for the elections module and a specific /// runtime. -/// This macro should not be called directly; use [`impl_runtime_weights`] instead. +/// This macro should not be called directly; use +/// [`impl_runtime_weights`](crate::impl_runtime_weights!) instead. #[macro_export] macro_rules! impl_elections_weights { ($runtime:ident) => { diff --git a/polkadot/runtime/common/src/lib.rs b/polkadot/runtime/common/src/lib.rs index 61968e48832c24edde0fb96ee02fc6044400cae5..46a9f7d12cd4149839547df0f3d98d42f60af9e1 100644 --- a/polkadot/runtime/common/src/lib.rs +++ b/polkadot/runtime/common/src/lib.rs @@ -100,7 +100,7 @@ parameter_types! { } /// Parameterized slow adjusting fee updated based on -/// https://research.web3.foundation/Polkadot/overview/token-economics#2-slow-adjusting-mechanism +/// pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< R, TargetBlockFullness, diff --git a/polkadot/runtime/common/src/mock.rs b/polkadot/runtime/common/src/mock.rs index ed25072e246e0c1acc8ae71335b7409e34e6edb3..c9e3a8c39f12d3424bd3fb47077812661b6202ba 100644 --- a/polkadot/runtime/common/src/mock.rs +++ b/polkadot/runtime/common/src/mock.rs @@ -17,16 +17,13 @@ //! Mocking utilities for testing. use crate::traits::Registrar; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - weights::Weight, -}; +use frame_support::{dispatch::DispatchResult, weights::Weight}; use frame_system::pallet_prelude::BlockNumberFor; use parity_scale_codec::{Decode, Encode}; use primitives::{HeadData, Id as ParaId, PvfCheckStatement, SessionIndex, ValidationCode}; use runtime_parachains::paras; use sp_keyring::Sr25519Keyring; -use sp_runtime::{traits::SaturatedConversion, Permill}; +use sp_runtime::{traits::SaturatedConversion, DispatchError, Permill}; use std::{cell::RefCell, collections::HashMap}; thread_local! { diff --git a/polkadot/runtime/common/src/purchase.rs b/polkadot/runtime/common/src/purchase.rs index 72795a733ea9e5dc98d76baa1e2d1f69c1bf7580..58ca19d0288c4973fc3e7d7f325df31b785d5be6 100644 --- a/polkadot/runtime/common/src/purchase.rs +++ b/polkadot/runtime/common/src/purchase.rs @@ -132,7 +132,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// A [new] account was created. + /// A new account was created. AccountCreated { who: T::AccountId }, /// Someone's account validity was updated. ValidityUpdated { who: T::AccountId, validity: AccountValidity }, @@ -484,14 +484,14 @@ mod tests { // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::purchase; use frame_support::{ - assert_noop, assert_ok, - dispatch::DispatchError::BadOrigin, - ord_parameter_types, parameter_types, + assert_noop, assert_ok, ord_parameter_types, parameter_types, traits::{Currency, WithdrawReasons}, }; use sp_runtime::{ traits::{BlakeTwo256, Dispatchable, IdentifyAccount, Identity, IdentityLookup, Verify}, - ArithmeticError, BuildStorage, MultiSignature, + ArithmeticError, BuildStorage, + DispatchError::BadOrigin, + MultiSignature, }; type Block = frame_system::mocking::MockBlock; diff --git a/polkadot/runtime/kusama/Cargo.toml b/polkadot/runtime/kusama/Cargo.toml index 3d7d1c9c5cb8824e84d32c337361fb47f1035f4d..8b0f59516c6df385762b56349f340f0a004d5bca 100644 --- a/polkadot/runtime/kusama/Cargo.toml +++ b/polkadot/runtime/kusama/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "kusama-runtime" +name = "staging-kusama-runtime" build = "build.rs" version = "1.0.0" authors.workspace = true @@ -12,7 +12,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } -serde = { version = "1.0.163", default-features = false } +serde = { version = "1.0.188", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" smallvec = "1.8.0" @@ -107,9 +107,9 @@ runtime-common = { package = "polkadot-runtime-common", path = "../common", defa runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } -xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm/xcm-builder", default-features = false } [dev-dependencies] tiny-keccak = { version = "2.0.2", features = ["keccak"] } @@ -338,12 +338,6 @@ try-runtime = [ "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] -# When enabled, the runtime API will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime API exported functions -# in WASM. -disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index e9e3fb2d2026f194ac00da9692ad2b6a9bece2d4..4b5f03b38c6c61956582c091ec41b18d5bec2d11 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -139,10 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 2, spec_version: 9430, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, - #[cfg(feature = "disable-runtime-api")] - apis: sp_version::create_apis_vec![[]], transaction_version: 23, state_version: 1, }; @@ -1741,6 +1738,8 @@ pub mod migrations { // Upgrade SessionKeys to include BEEFY key UpgradeSessionKeys, + + parachains_configuration::migration::v9::MigrateToV9, ); } @@ -1820,7 +1819,6 @@ mod benches { ); } -#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { diff --git a/polkadot/runtime/metrics/Cargo.toml b/polkadot/runtime/metrics/Cargo.toml index 567a06556613e84f1458423fb225f0e1e93f7aa0..cfa6bf3dafb2aa02e29d3ee5865aa314d0e7436b 100644 --- a/polkadot/runtime/metrics/Cargo.toml +++ b/polkadot/runtime/metrics/Cargo.toml @@ -12,7 +12,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true } -bs58 = { version = "0.4.0", default-features = false, features = ["alloc"] } +bs58 = { version = "0.5.0", default-features = false, features = ["alloc"] } [features] default = [ "std" ] diff --git a/polkadot/runtime/parachains/Cargo.toml b/polkadot/runtime/parachains/Cargo.toml index 73f95c09292e2d595d953e3e60148a15a0055686..9a8bd5017e074f6827799824beb38d2c0b8a5c59 100644 --- a/polkadot/runtime/parachains/Cargo.toml +++ b/polkadot/runtime/parachains/Cargo.toml @@ -11,7 +11,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] } derive_more = "0.99.17" bitflags = "1.3.2" @@ -40,14 +40,14 @@ frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-f frame-support = { path = "../../../substrate/frame/support", default-features = false } frame-system = { path = "../../../substrate/frame/system", default-features = false } -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } rand = { version = "0.8.5", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } static_assertions = { version = "1.1.0", optional = true } -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } polkadot-runtime-metrics = { path = "../metrics", default-features = false} [dev-dependencies] @@ -82,7 +82,7 @@ std = [ "pallet-timestamp/std", "pallet-vesting/std", "parity-scale-codec/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-metrics/std", "primitives/std", "rustc-hex/std", @@ -110,7 +110,7 @@ runtime-benchmarks = [ "pallet-staking/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "primitives/runtime-benchmarks", "sp-application-crypto", "sp-runtime/runtime-benchmarks", diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs b/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs index 5a60201e4fa8a4501c185324e8e72099c505bbc3..0c9813d144f34611d28536c2ed93f1b6a98ad088 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs +++ b/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs @@ -263,8 +263,8 @@ pub mod pallet { Pallet::::do_place_order(sender, max_amount, para_id, AllowDeath) } - /// Same as the [`place_order_allow_death`] call , but with a check that placing the order - /// will not reap the account. + /// Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a + /// check that placing the order will not reap the account. /// /// Parameters: /// - `origin`: The sender of the call, funds will be withdrawn from this account. diff --git a/polkadot/runtime/parachains/src/configuration.rs b/polkadot/runtime/parachains/src/configuration.rs index accc01a2b18015856a67860fb32c299953aafd21..0c66bb5bdf961c21898a3d2e9bb220f7a56ae6c4 100644 --- a/polkadot/runtime/parachains/src/configuration.rs +++ b/polkadot/runtime/parachains/src/configuration.rs @@ -22,10 +22,12 @@ use crate::{inclusion::MAX_UPWARD_MESSAGE_SIZE_BOUND, shared}; use frame_support::{pallet_prelude::*, DefaultNoBound}; use frame_system::pallet_prelude::*; use parity_scale_codec::{Decode, Encode}; -use polkadot_parachain::primitives::{MAX_HORIZONTAL_MESSAGE_NUM, MAX_UPWARD_MESSAGE_NUM}; +use polkadot_parachain_primitives::primitives::{ + MAX_HORIZONTAL_MESSAGE_NUM, MAX_UPWARD_MESSAGE_NUM, +}; use primitives::{ - vstaging::AsyncBackingParams, Balance, ExecutorParams, SessionIndex, MAX_CODE_SIZE, - MAX_HEAD_DATA_SIZE, MAX_POV_SIZE, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, + vstaging::AsyncBackingParams, Balance, ExecutorParams, SessionIndex, LEGACY_MIN_BACKING_VOTES, + MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, MAX_POV_SIZE, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, }; use sp_runtime::{traits::Zero, Perbill}; use sp_std::prelude::*; @@ -94,8 +96,8 @@ pub struct HostConfiguration { /// /// If PVF pre-checking is enabled this should be greater than the maximum number of blocks /// PVF pre-checking can take. Intuitively, this number should be greater than the duration - /// specified by [`pvf_voting_ttl`]. Unlike, [`pvf_voting_ttl`], this parameter uses blocks - /// as a unit. + /// specified by [`pvf_voting_ttl`](Self::pvf_voting_ttl). Unlike, + /// [`pvf_voting_ttl`](Self::pvf_voting_ttl), this parameter uses blocks as a unit. #[cfg_attr(feature = "std", serde(alias = "validation_upgrade_frequency"))] pub validation_upgrade_cooldown: BlockNumber, /// The delay, in blocks, after which an upgrade of the validation code is applied. @@ -113,14 +115,15 @@ pub struct HostConfiguration { /// been completed. /// /// Note, there are situations in which `expected_at` in the past. For example, if - /// [`paras_availability_period`] is less than the delay set by - /// this field or if PVF pre-check took more time than the delay. In such cases, the upgrade is - /// further at the earliest possible time determined by [`minimum_validation_upgrade_delay`]. + /// [`paras_availability_period`](Self::paras_availability_period) is less than the delay set + /// by this field or if PVF pre-check took more time than the delay. In such cases, the upgrade + /// is further at the earliest possible time determined by + /// [`minimum_validation_upgrade_delay`](Self::minimum_validation_upgrade_delay). /// /// The rationale for this delay has to do with relay-chain reversions. In case there is an /// invalid candidate produced with the new version of the code, then the relay-chain can - /// revert [`validation_upgrade_delay`] many blocks back and still find the new code in the - /// storage by hash. + /// revert [`validation_upgrade_delay`](Self::validation_upgrade_delay) many blocks back and + /// still find the new code in the storage by hash. /// /// [#4601]: https://github.com/paritytech/polkadot/issues/4601 pub validation_upgrade_delay: BlockNumber, @@ -229,7 +232,8 @@ pub struct HostConfiguration { pub pvf_voting_ttl: SessionIndex, /// The lower bound number of blocks an upgrade can be scheduled. /// - /// Typically, upgrade gets scheduled [`validation_upgrade_delay`] relay-chain blocks after + /// Typically, upgrade gets scheduled + /// [`validation_upgrade_delay`](Self::validation_upgrade_delay) relay-chain blocks after /// the relay-parent of the parablock that signalled the validation code upgrade. However, /// in the case a pre-checking voting was concluded in a longer duration the upgrade will be /// scheduled to the next block. @@ -240,8 +244,12 @@ pub struct HostConfiguration { /// To prevent that, we introduce the minimum number of blocks after which the upgrade can be /// scheduled. This number is controlled by this field. /// - /// This value should be greater than [`paras_availability_period`]. + /// This value should be greater than + /// [`paras_availability_period`](Self::paras_availability_period). pub minimum_validation_upgrade_delay: BlockNumber, + /// The minimum number of valid backing statements required to consider a parachain candidate + /// backable. + pub minimum_backing_votes: u32, } impl> Default for HostConfiguration { @@ -292,6 +300,7 @@ impl> Default for HostConfiguration { MaxHrmpOutboundChannelsExceeded, /// Maximum number of HRMP inbound channels exceeded. MaxHrmpInboundChannelsExceeded, + /// `minimum_backing_votes` is set to zero. + ZeroMinimumBackingVotes, } impl HostConfiguration @@ -408,6 +419,10 @@ where return Err(MaxHrmpInboundChannelsExceeded) } + if self.minimum_backing_votes.is_zero() { + return Err(ZeroMinimumBackingVotes) + } + Ok(()) } @@ -474,7 +489,8 @@ pub mod pallet { /// v5-v6: (remove UMP dispatch queue) /// v6-v7: /// v7-v8: - const STORAGE_VERSION: StorageVersion = StorageVersion::new(8); + /// v8-v9: + const STORAGE_VERSION: StorageVersion = StorageVersion::new(9); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -1150,6 +1166,18 @@ pub mod pallet { config.on_demand_ttl = new; }) } + /// Set the minimum backing votes threshold. + #[pallet::call_index(52)] + #[pallet::weight(( + T::WeightInfo::set_config_with_u32(), + DispatchClass::Operational + ))] + pub fn set_minimum_backing_votes(origin: OriginFor, new: u32) -> DispatchResult { + ensure_root(origin)?; + Self::schedule_config_update(|config| { + config.minimum_backing_votes = new; + }) + } } #[pallet::hooks] diff --git a/polkadot/runtime/parachains/src/configuration/migration.rs b/polkadot/runtime/parachains/src/configuration/migration.rs index 4499b116462b8af97c53275a4e0eea3ce0c902a6..26f8a85b496d5a76385c6c85b52f66d719d88c82 100644 --- a/polkadot/runtime/parachains/src/configuration/migration.rs +++ b/polkadot/runtime/parachains/src/configuration/migration.rs @@ -19,3 +19,4 @@ pub mod v6; pub mod v7; pub mod v8; +pub mod v9; diff --git a/polkadot/runtime/parachains/src/configuration/migration/v8.rs b/polkadot/runtime/parachains/src/configuration/migration/v8.rs index 7f7cc1cdefcd974cbb6923ed1ed9de2fac56983d..5c5b34821835ed2a3295b272ee0987f57584a480 100644 --- a/polkadot/runtime/parachains/src/configuration/migration/v8.rs +++ b/polkadot/runtime/parachains/src/configuration/migration/v8.rs @@ -23,14 +23,114 @@ use frame_support::{ weights::Weight, }; use frame_system::pallet_prelude::BlockNumberFor; -use primitives::SessionIndex; +use primitives::{ + vstaging::AsyncBackingParams, Balance, ExecutorParams, SessionIndex, + ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, +}; use sp_runtime::Perbill; use sp_std::vec::Vec; use frame_support::traits::OnRuntimeUpgrade; use super::v7::V7HostConfiguration; -type V8HostConfiguration = configuration::HostConfiguration; +/// All configuration of the runtime with respect to paras. +#[derive(Clone, Encode, Decode, Debug)] +pub struct V8HostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub async_backing_params: AsyncBackingParams, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub executor_params: ExecutorParams, + pub code_retention_period: BlockNumber, + pub on_demand_cores: u32, + pub on_demand_retries: u32, + pub on_demand_queue_max_size: u32, + pub on_demand_target_queue_utilization: Perbill, + pub on_demand_fee_variability: Perbill, + pub on_demand_base_fee: Balance, + pub on_demand_ttl: BlockNumber, + pub group_rotation_frequency: BlockNumber, + pub paras_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, +} + +impl> Default for V8HostConfiguration { + fn default() -> Self { + Self { + async_backing_params: AsyncBackingParams { + max_candidate_depth: 0, + allowed_ancestry_len: 0, + }, + group_rotation_frequency: 1u32.into(), + paras_availability_period: 1u32.into(), + no_show_slots: 1u32.into(), + validation_upgrade_cooldown: Default::default(), + validation_upgrade_delay: 2u32.into(), + code_retention_period: Default::default(), + max_code_size: Default::default(), + max_pov_size: Default::default(), + max_head_data_size: Default::default(), + on_demand_cores: Default::default(), + on_demand_retries: Default::default(), + scheduling_lookahead: 1, + max_validators_per_core: Default::default(), + max_validators: None, + dispute_period: 6, + dispute_post_conclusion_acceptance_period: 100.into(), + n_delay_tranches: Default::default(), + zeroth_delay_tranche_width: Default::default(), + needed_approvals: Default::default(), + relay_vrf_modulo_samples: Default::default(), + max_upward_queue_count: Default::default(), + max_upward_queue_size: Default::default(), + max_downward_message_size: Default::default(), + max_upward_message_size: Default::default(), + max_upward_message_num_per_candidate: Default::default(), + hrmp_sender_deposit: Default::default(), + hrmp_recipient_deposit: Default::default(), + hrmp_channel_max_capacity: Default::default(), + hrmp_channel_max_total_size: Default::default(), + hrmp_max_parachain_inbound_channels: Default::default(), + hrmp_channel_max_message_size: Default::default(), + hrmp_max_parachain_outbound_channels: Default::default(), + hrmp_max_message_num_per_candidate: Default::default(), + pvf_voting_ttl: 2u32.into(), + minimum_validation_upgrade_delay: 2.into(), + executor_params: Default::default(), + on_demand_queue_max_size: ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE, + on_demand_base_fee: 10_000_000u128, + on_demand_fee_variability: Perbill::from_percent(3), + on_demand_target_queue_utilization: Perbill::from_percent(25), + on_demand_ttl: 5u32.into(), + } + } +} mod v7 { use super::*; diff --git a/polkadot/runtime/parachains/src/configuration/migration/v9.rs b/polkadot/runtime/parachains/src/configuration/migration/v9.rs new file mode 100644 index 0000000000000000000000000000000000000000..64d71e628f4ead4ee207c6f74b24dd42684e0fca --- /dev/null +++ b/polkadot/runtime/parachains/src/configuration/migration/v9.rs @@ -0,0 +1,321 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A module that is responsible for migration of storage. + +use crate::configuration::{self, Config, Pallet}; +use frame_support::{ + pallet_prelude::*, + traits::{Defensive, StorageVersion}, + weights::Weight, +}; +use frame_system::pallet_prelude::BlockNumberFor; +use primitives::{SessionIndex, LEGACY_MIN_BACKING_VOTES}; +use sp_runtime::Perbill; +use sp_std::vec::Vec; + +use frame_support::traits::OnRuntimeUpgrade; + +use super::v8::V8HostConfiguration; +type V9HostConfiguration = configuration::HostConfiguration; + +mod v8 { + use super::*; + + #[frame_support::storage_alias] + pub(crate) type ActiveConfig = + StorageValue, V8HostConfiguration>, OptionQuery>; + + #[frame_support::storage_alias] + pub(crate) type PendingConfigs = StorageValue< + Pallet, + Vec<(SessionIndex, V8HostConfiguration>)>, + OptionQuery, + >; +} + +mod v9 { + use super::*; + + #[frame_support::storage_alias] + pub(crate) type ActiveConfig = + StorageValue, V9HostConfiguration>, OptionQuery>; + + #[frame_support::storage_alias] + pub(crate) type PendingConfigs = StorageValue< + Pallet, + Vec<(SessionIndex, V9HostConfiguration>)>, + OptionQuery, + >; +} + +pub struct MigrateToV9(sp_std::marker::PhantomData); +impl OnRuntimeUpgrade for MigrateToV9 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::trace!(target: crate::configuration::LOG_TARGET, "Running pre_upgrade() for HostConfiguration MigrateToV9"); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + log::info!(target: configuration::LOG_TARGET, "HostConfiguration MigrateToV9 started"); + if StorageVersion::get::>() == 8 { + let weight_consumed = migrate_to_v9::(); + + log::info!(target: configuration::LOG_TARGET, "HostConfiguration MigrateToV9 executed successfully"); + StorageVersion::new(9).put::>(); + + weight_consumed + } else { + log::warn!(target: configuration::LOG_TARGET, "HostConfiguration MigrateToV9 should be removed."); + T::DbWeight::get().reads(1) + } + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::trace!(target: crate::configuration::LOG_TARGET, "Running post_upgrade() for HostConfiguration MigrateToV9"); + ensure!( + StorageVersion::get::>() >= 9, + "Storage version should be >= 9 after the migration" + ); + + Ok(()) + } +} + +fn migrate_to_v9() -> Weight { + // Unusual formatting is justified: + // - make it easier to verify that fields assign what they supposed to assign. + // - this code is transient and will be removed after all migrations are done. + // - this code is important enough to optimize for legibility sacrificing consistency. + #[rustfmt::skip] + let translate = + |pre: V8HostConfiguration>| -> + V9HostConfiguration> + { + V9HostConfiguration { +max_code_size : pre.max_code_size, +max_head_data_size : pre.max_head_data_size, +max_upward_queue_count : pre.max_upward_queue_count, +max_upward_queue_size : pre.max_upward_queue_size, +max_upward_message_size : pre.max_upward_message_size, +max_upward_message_num_per_candidate : pre.max_upward_message_num_per_candidate, +hrmp_max_message_num_per_candidate : pre.hrmp_max_message_num_per_candidate, +validation_upgrade_cooldown : pre.validation_upgrade_cooldown, +validation_upgrade_delay : pre.validation_upgrade_delay, +max_pov_size : pre.max_pov_size, +max_downward_message_size : pre.max_downward_message_size, +hrmp_sender_deposit : pre.hrmp_sender_deposit, +hrmp_recipient_deposit : pre.hrmp_recipient_deposit, +hrmp_channel_max_capacity : pre.hrmp_channel_max_capacity, +hrmp_channel_max_total_size : pre.hrmp_channel_max_total_size, +hrmp_max_parachain_inbound_channels : pre.hrmp_max_parachain_inbound_channels, +hrmp_max_parachain_outbound_channels : pre.hrmp_max_parachain_outbound_channels, +hrmp_channel_max_message_size : pre.hrmp_channel_max_message_size, +code_retention_period : pre.code_retention_period, +on_demand_cores : pre.on_demand_cores, +on_demand_retries : pre.on_demand_retries, +group_rotation_frequency : pre.group_rotation_frequency, +paras_availability_period : pre.paras_availability_period, +scheduling_lookahead : pre.scheduling_lookahead, +max_validators_per_core : pre.max_validators_per_core, +max_validators : pre.max_validators, +dispute_period : pre.dispute_period, +dispute_post_conclusion_acceptance_period: pre.dispute_post_conclusion_acceptance_period, +no_show_slots : pre.no_show_slots, +n_delay_tranches : pre.n_delay_tranches, +zeroth_delay_tranche_width : pre.zeroth_delay_tranche_width, +needed_approvals : pre.needed_approvals, +relay_vrf_modulo_samples : pre.relay_vrf_modulo_samples, +pvf_voting_ttl : pre.pvf_voting_ttl, +minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay, +async_backing_params : pre.async_backing_params, +executor_params : pre.executor_params, +on_demand_queue_max_size : 10_000u32, +on_demand_base_fee : 10_000_000u128, +on_demand_fee_variability : Perbill::from_percent(3), +on_demand_target_queue_utilization : Perbill::from_percent(25), +on_demand_ttl : 5u32.into(), +minimum_backing_votes : LEGACY_MIN_BACKING_VOTES + } + }; + + let v8 = v8::ActiveConfig::::get() + .defensive_proof("Could not decode old config") + .unwrap_or_default(); + let v9 = translate(v8); + v9::ActiveConfig::::set(Some(v9)); + + // Allowed to be empty. + let pending_v8 = v8::PendingConfigs::::get().unwrap_or_default(); + let mut pending_v9 = Vec::new(); + + for (session, v8) in pending_v8.into_iter() { + let v9 = translate(v8); + pending_v9.push((session, v9)); + } + v9::PendingConfigs::::set(Some(pending_v9.clone())); + + let num_configs = (pending_v9.len() + 1) as u64; + T::DbWeight::get().reads_writes(num_configs, num_configs) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::mock::{new_test_ext, Test}; + + #[test] + fn v9_deserialized_from_actual_data() { + // Example how to get new `raw_config`: + // We'll obtain the raw_config at a specified a block + // Steps: + // 1. Go to Polkadot.js -> Developer -> Chain state -> Storage: https://polkadot.js.org/apps/#/chainstate + // 2. Set these parameters: + // 2.1. selected state query: configuration; activeConfig(): + // PolkadotRuntimeParachainsConfigurationHostConfiguration + // 2.2. blockhash to query at: + // 0xf89d3ab5312c5f70d396dc59612f0aa65806c798346f9db4b35278baed2e0e53 (the hash of + // the block) + // 2.3. Note the value of encoded storage key -> + // 0x06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385 for the + // referenced block. + // 2.4. You'll also need the decoded values to update the test. + // 3. Go to Polkadot.js -> Developer -> Chain state -> Raw storage + // 3.1 Enter the encoded storage key and you get the raw config. + + // This exceeds the maximal line width length, but that's fine, since this is not code and + // doesn't need to be read and also leaving it as one line allows to easily copy it. + let raw_config = + hex_literal::hex![" + 0000300000800000080000000000100000c8000005000000050000000200000002000000000000000000000000005000000010000400000000000000000000000000000000000000000000000000000000000000000000000800000000200000040000000000100000b004000000000000000000001027000080b2e60e80c3c901809698000000000000000000000000000500000014000000040000000100000001010000000006000000640000000200000019000000000000000300000002000000020000000500000002000000" + ]; + + let v9 = + V9HostConfiguration::::decode(&mut &raw_config[..]).unwrap(); + + // We check only a sample of the values here. If we missed any fields or messed up data + // types that would skew all the fields coming after. + assert_eq!(v9.max_code_size, 3_145_728); + assert_eq!(v9.validation_upgrade_cooldown, 2); + assert_eq!(v9.max_pov_size, 5_242_880); + assert_eq!(v9.hrmp_channel_max_message_size, 1_048_576); + assert_eq!(v9.n_delay_tranches, 25); + assert_eq!(v9.minimum_validation_upgrade_delay, 5); + assert_eq!(v9.group_rotation_frequency, 20); + assert_eq!(v9.on_demand_cores, 0); + assert_eq!(v9.on_demand_base_fee, 10_000_000); + assert_eq!(v9.minimum_backing_votes, LEGACY_MIN_BACKING_VOTES); + } + + #[test] + fn test_migrate_to_v9() { + // Host configuration has lots of fields. However, in this migration we only add one + // field. The most important part to check are a couple of the last fields. We also pick + // extra fields to check arbitrarily, e.g. depending on their position (i.e. the middle) and + // also their type. + // + // We specify only the picked fields and the rest should be provided by the `Default` + // implementation. That implementation is copied over between the two types and should work + // fine. + let v8 = V8HostConfiguration:: { + needed_approvals: 69, + paras_availability_period: 55, + hrmp_recipient_deposit: 1337, + max_pov_size: 1111, + minimum_validation_upgrade_delay: 20, + ..Default::default() + }; + + let mut pending_configs = Vec::new(); + pending_configs.push((100, v8.clone())); + pending_configs.push((300, v8.clone())); + + new_test_ext(Default::default()).execute_with(|| { + // Implant the v8 version in the state. + v8::ActiveConfig::::set(Some(v8)); + v8::PendingConfigs::::set(Some(pending_configs)); + + migrate_to_v9::(); + + let v9 = v9::ActiveConfig::::get().unwrap(); + let mut configs_to_check = v9::PendingConfigs::::get().unwrap(); + configs_to_check.push((0, v9.clone())); + + for (_, v8) in configs_to_check { + #[rustfmt::skip] + { + assert_eq!(v8.max_code_size , v9.max_code_size); + assert_eq!(v8.max_head_data_size , v9.max_head_data_size); + assert_eq!(v8.max_upward_queue_count , v9.max_upward_queue_count); + assert_eq!(v8.max_upward_queue_size , v9.max_upward_queue_size); + assert_eq!(v8.max_upward_message_size , v9.max_upward_message_size); + assert_eq!(v8.max_upward_message_num_per_candidate , v9.max_upward_message_num_per_candidate); + assert_eq!(v8.hrmp_max_message_num_per_candidate , v9.hrmp_max_message_num_per_candidate); + assert_eq!(v8.validation_upgrade_cooldown , v9.validation_upgrade_cooldown); + assert_eq!(v8.validation_upgrade_delay , v9.validation_upgrade_delay); + assert_eq!(v8.max_pov_size , v9.max_pov_size); + assert_eq!(v8.max_downward_message_size , v9.max_downward_message_size); + assert_eq!(v8.hrmp_max_parachain_outbound_channels , v9.hrmp_max_parachain_outbound_channels); + assert_eq!(v8.hrmp_sender_deposit , v9.hrmp_sender_deposit); + assert_eq!(v8.hrmp_recipient_deposit , v9.hrmp_recipient_deposit); + assert_eq!(v8.hrmp_channel_max_capacity , v9.hrmp_channel_max_capacity); + assert_eq!(v8.hrmp_channel_max_total_size , v9.hrmp_channel_max_total_size); + assert_eq!(v8.hrmp_max_parachain_inbound_channels , v9.hrmp_max_parachain_inbound_channels); + assert_eq!(v8.hrmp_channel_max_message_size , v9.hrmp_channel_max_message_size); + assert_eq!(v8.code_retention_period , v9.code_retention_period); + assert_eq!(v8.on_demand_cores , v9.on_demand_cores); + assert_eq!(v8.on_demand_retries , v9.on_demand_retries); + assert_eq!(v8.group_rotation_frequency , v9.group_rotation_frequency); + assert_eq!(v8.paras_availability_period , v9.paras_availability_period); + assert_eq!(v8.scheduling_lookahead , v9.scheduling_lookahead); + assert_eq!(v8.max_validators_per_core , v9.max_validators_per_core); + assert_eq!(v8.max_validators , v9.max_validators); + assert_eq!(v8.dispute_period , v9.dispute_period); + assert_eq!(v8.no_show_slots , v9.no_show_slots); + assert_eq!(v8.n_delay_tranches , v9.n_delay_tranches); + assert_eq!(v8.zeroth_delay_tranche_width , v9.zeroth_delay_tranche_width); + assert_eq!(v8.needed_approvals , v9.needed_approvals); + assert_eq!(v8.relay_vrf_modulo_samples , v9.relay_vrf_modulo_samples); + assert_eq!(v8.pvf_voting_ttl , v9.pvf_voting_ttl); + assert_eq!(v8.minimum_validation_upgrade_delay , v9.minimum_validation_upgrade_delay); + assert_eq!(v8.async_backing_params.allowed_ancestry_len, v9.async_backing_params.allowed_ancestry_len); + assert_eq!(v8.async_backing_params.max_candidate_depth , v9.async_backing_params.max_candidate_depth); + assert_eq!(v8.executor_params , v9.executor_params); + assert_eq!(v8.minimum_backing_votes , v9.minimum_backing_votes); + }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. + } + }); + } + + // Test that migration doesn't panic in case there're no pending configurations upgrades in + // pallet's storage. + #[test] + fn test_migrate_to_v9_no_pending() { + let v8 = V8HostConfiguration::::default(); + + new_test_ext(Default::default()).execute_with(|| { + // Implant the v8 version in the state. + v8::ActiveConfig::::set(Some(v8)); + // Ensure there're no pending configs. + v8::PendingConfigs::::set(None); + + // Shouldn't fail. + migrate_to_v9::(); + }); + } +} diff --git a/polkadot/runtime/parachains/src/configuration/tests.rs b/polkadot/runtime/parachains/src/configuration/tests.rs index 43c03067a9a745e92f7f645c8d49f193fc7cfebe..ea39628c95876a92b9072bd5adc18584e48df0b5 100644 --- a/polkadot/runtime/parachains/src/configuration/tests.rs +++ b/polkadot/runtime/parachains/src/configuration/tests.rs @@ -317,6 +317,7 @@ fn setting_pending_config_members() { on_demand_fee_variability: Perbill::from_percent(3), on_demand_target_queue_utilization: Perbill::from_percent(25), on_demand_ttl: 5u32, + minimum_backing_votes: 5, }; Configuration::set_validation_upgrade_cooldown( @@ -467,6 +468,11 @@ fn setting_pending_config_members() { .unwrap(); Configuration::set_pvf_voting_ttl(RuntimeOrigin::root(), new_config.pvf_voting_ttl) .unwrap(); + Configuration::set_minimum_backing_votes( + RuntimeOrigin::root(), + new_config.minimum_backing_votes, + ) + .unwrap(); assert_eq!(PendingConfigs::::get(), vec![(shared::SESSION_DELAY, new_config)],); }) diff --git a/polkadot/runtime/parachains/src/dmp.rs b/polkadot/runtime/parachains/src/dmp.rs index 490c2fa1cd09c607022663d49f1705bb45a0d0df..bc7491a2c61a9c14804061acbca9702aebb3da29 100644 --- a/polkadot/runtime/parachains/src/dmp.rs +++ b/polkadot/runtime/parachains/src/dmp.rs @@ -81,9 +81,9 @@ impl From for SendError { } } -/// An error returned by [`check_processed_downward_messages`] that indicates an acceptance check -/// didn't pass. -pub enum ProcessedDownwardMessagesAcceptanceErr { +/// An error returned by [`Pallet::check_processed_downward_messages`] that indicates an acceptance +/// check didn't pass. +pub(crate) enum ProcessedDownwardMessagesAcceptanceErr { /// If there are pending messages then `processed_downward_messages` should be at least 1, AdvancementRule, /// `processed_downward_messages` should not be greater than the number of pending messages. diff --git a/polkadot/runtime/parachains/src/hrmp.rs b/polkadot/runtime/parachains/src/hrmp.rs index a3ce6e2d8a3503d73a9a4453378ce67c24597c08..cdb38ba6a8eaf855a6977d01c0c2fa9183cb6396 100644 --- a/polkadot/runtime/parachains/src/hrmp.rs +++ b/polkadot/runtime/parachains/src/hrmp.rs @@ -21,7 +21,7 @@ use crate::{ use frame_support::{pallet_prelude::*, traits::ReservableCurrency, DefaultNoBound}; use frame_system::pallet_prelude::*; use parity_scale_codec::{Decode, Encode}; -use polkadot_parachain::primitives::HorizontalMessages; +use polkadot_parachain_primitives::primitives::HorizontalMessages; use primitives::{ Balance, Hash, HrmpChannelId, Id as ParaId, InboundHrmpMessage, OutboundHrmpMessage, SessionIndex, @@ -149,17 +149,17 @@ pub struct HrmpChannel { pub recipient_deposit: Balance, } -/// An error returned by [`check_hrmp_watermark`] that indicates an acceptance criteria check -/// didn't pass. -pub enum HrmpWatermarkAcceptanceErr { +/// An error returned by [`Pallet::check_hrmp_watermark`] that indicates an acceptance criteria +/// check didn't pass. +pub(crate) enum HrmpWatermarkAcceptanceErr { AdvancementRule { new_watermark: BlockNumber, last_watermark: BlockNumber }, AheadRelayParent { new_watermark: BlockNumber, relay_chain_parent_number: BlockNumber }, LandsOnBlockWithNoMessages { new_watermark: BlockNumber }, } -/// An error returned by [`check_outbound_hrmp`] that indicates an acceptance criteria check +/// An error returned by [`Pallet::check_outbound_hrmp`] that indicates an acceptance criteria check /// didn't pass. -pub enum OutboundHrmpAcceptanceErr { +pub(crate) enum OutboundHrmpAcceptanceErr { MoreMessagesThanPermitted { sent: u32, permitted: u32 }, NotSorted { idx: u32 }, NoSuchChannel { idx: u32, channel_id: HrmpChannelId }, diff --git a/polkadot/runtime/parachains/src/inclusion/benchmarking.rs b/polkadot/runtime/parachains/src/inclusion/benchmarking.rs index 0471c0c3b2bf8795e19ce5c522a961361f4d38b8..169e858deda8aea05751450a65065550b881142b 100644 --- a/polkadot/runtime/parachains/src/inclusion/benchmarking.rs +++ b/polkadot/runtime/parachains/src/inclusion/benchmarking.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/runtime/parachains/src/inclusion/mod.rs b/polkadot/runtime/parachains/src/inclusion/mod.rs index e60aac0080cfca6d53000441958d1f15bada1265..a9ee2d1b961281a7de4ab342c9cb150b120185db 100644 --- a/polkadot/runtime/parachains/src/inclusion/mod.rs +++ b/polkadot/runtime/parachains/src/inclusion/mod.rs @@ -36,11 +36,11 @@ use frame_system::pallet_prelude::*; use pallet_message_queue::OnQueueChanged; use parity_scale_codec::{Decode, Encode}; use primitives::{ - supermajority_threshold, well_known_keys, AvailabilityBitfield, BackedCandidate, - CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateReceipt, - CommittedCandidateReceipt, CoreIndex, GroupIndex, Hash, HeadData, Id as ParaId, - SignedAvailabilityBitfields, SigningContext, UpwardMessage, ValidatorId, ValidatorIndex, - ValidityAttestation, + effective_minimum_backing_votes, supermajority_threshold, well_known_keys, + AvailabilityBitfield, BackedCandidate, CandidateCommitments, CandidateDescriptor, + CandidateHash, CandidateReceipt, CommittedCandidateReceipt, CoreIndex, GroupIndex, Hash, + HeadData, Id as ParaId, SignedAvailabilityBitfields, SigningContext, UpwardMessage, + ValidatorId, ValidatorIndex, ValidityAttestation, }; use scale_info::TypeInfo; use sp_runtime::{traits::One, DispatchError, SaturatedConversion, Saturating}; @@ -199,17 +199,6 @@ impl Default for ProcessedCandidates { } } -/// Number of backing votes we need for a valid backing. -/// -/// WARNING: This check has to be kept in sync with the node side checks. -pub fn minimum_backing_votes(n_validators: usize) -> usize { - // For considerations on this value see: - // https://github.com/paritytech/polkadot/pull/1656#issuecomment-999734650 - // and - // https://github.com/paritytech/polkadot/issues/4386 - sp_std::cmp::min(n_validators, 2) -} - /// Reads the footprint of queues for a specific origin type. pub trait QueueFootprinter { type Origin; @@ -416,10 +405,10 @@ enum AcceptanceCheckErr { OutboundHrmp(hrmp::OutboundHrmpAcceptanceErr), } -/// An error returned by [`check_upward_messages`] that indicates a violation of one of acceptance -/// criteria rules. +/// An error returned by [`Pallet::check_upward_messages`] that indicates a violation of one of +/// acceptance criteria rules. #[cfg_attr(test, derive(PartialEq))] -pub enum UmpAcceptanceCheckErr { +pub(crate) enum UmpAcceptanceCheckErr { /// The maximal number of messages that can be submitted in one batch was exceeded. MoreMessagesThanPermitted { sent: u32, permitted: u32 }, /// The maximal size of a single message was exceeded. @@ -622,6 +611,7 @@ impl Pallet { return Ok(ProcessedCandidates::default()) } + let minimum_backing_votes = configuration::Pallet::::config().minimum_backing_votes; let validators = shared::Pallet::::active_validator_keys(); // Collect candidate receipts with backers. @@ -738,7 +728,11 @@ impl Pallet { match maybe_amount_validated { Ok(amount_validated) => ensure!( - amount_validated >= minimum_backing_votes(group_vals.len()), + amount_validated >= + effective_minimum_backing_votes( + group_vals.len(), + minimum_backing_votes + ), Error::::InsufficientBacking, ), Err(()) => { diff --git a/polkadot/runtime/parachains/src/inclusion/tests.rs b/polkadot/runtime/parachains/src/inclusion/tests.rs index 7c22ac36a802fac04041fc5f97811e100dd4f81a..70c5e959038ab3e083367f02023fb5990f301627 100644 --- a/polkadot/runtime/parachains/src/inclusion/tests.rs +++ b/polkadot/runtime/parachains/src/inclusion/tests.rs @@ -26,7 +26,10 @@ use crate::{ paras_inherent::DisputedBitfield, shared::AllowedRelayParentsTracker, }; -use primitives::{SignedAvailabilityBitfields, UncheckedSignedAvailabilityBitfields}; +use primitives::{ + effective_minimum_backing_votes, SignedAvailabilityBitfields, + UncheckedSignedAvailabilityBitfields, +}; use assert_matches::assert_matches; use frame_support::assert_noop; @@ -120,11 +123,14 @@ pub(crate) fn back_candidate( kind: BackingKind, ) -> BackedCandidate { let mut validator_indices = bitvec::bitvec![u8, BitOrderLsb0; 0; group.len()]; - let threshold = minimum_backing_votes(group.len()); + let threshold = effective_minimum_backing_votes( + group.len(), + configuration::Pallet::::config().minimum_backing_votes, + ); let signing = match kind { BackingKind::Unanimous => group.len(), - BackingKind::Threshold => threshold, + BackingKind::Threshold => threshold as usize, BackingKind::Lacking => threshold.saturating_sub(1), }; @@ -1609,7 +1615,10 @@ fn backing_works() { ); let backers = { - let num_backers = minimum_backing_votes(group_validators(GroupIndex(0)).unwrap().len()); + let num_backers = effective_minimum_backing_votes( + group_validators(GroupIndex(0)).unwrap().len(), + configuration::Pallet::::config().minimum_backing_votes, + ); backing_bitfield(&(0..num_backers).collect::>()) }; assert_eq!( @@ -1631,7 +1640,10 @@ fn backing_works() { ); let backers = { - let num_backers = minimum_backing_votes(group_validators(GroupIndex(0)).unwrap().len()); + let num_backers = effective_minimum_backing_votes( + group_validators(GroupIndex(0)).unwrap().len(), + configuration::Pallet::::config().minimum_backing_votes, + ); backing_bitfield(&(0..num_backers).map(|v| v + 2).collect::>()) }; assert_eq!( @@ -1765,7 +1777,10 @@ fn can_include_candidate_with_ok_code_upgrade() { assert_eq!(occupied_cores, vec![(CoreIndex::from(0), chain_a)]); let backers = { - let num_backers = minimum_backing_votes(group_validators(GroupIndex(0)).unwrap().len()); + let num_backers = effective_minimum_backing_votes( + group_validators(GroupIndex(0)).unwrap().len(), + configuration::Pallet::::config().minimum_backing_votes, + ); backing_bitfield(&(0..num_backers).collect::>()) }; assert_eq!( diff --git a/polkadot/runtime/parachains/src/lib.rs b/polkadot/runtime/parachains/src/lib.rs index 056eef35426098532663ee0f3e727fac3a3e5d16..64365f17b7e8b83ce0aef13c00ccdbd1a8b5f744 100644 --- a/polkadot/runtime/parachains/src/lib.rs +++ b/polkadot/runtime/parachains/src/lib.rs @@ -63,8 +63,6 @@ pub trait FeeTracker { } /// Schedule a para to be initialized at the start of the next session with the given genesis data. -/// -/// See [`paras::Pallet::schedule_para_initialize`] for more details. pub fn schedule_para_initialize( id: ParaId, genesis: paras::ParaGenesisArgs, @@ -73,8 +71,6 @@ pub fn schedule_para_initialize( } /// Schedule a para to be cleaned up at the start of the next session. -/// -/// See [`paras::Pallet::schedule_para_cleanup`] for more details. pub fn schedule_para_cleanup(id: primitives::Id) -> Result<(), ()> { >::schedule_para_cleanup(id).map_err(|_| ()) } @@ -90,8 +86,6 @@ pub fn schedule_parachain_downgrade(id: ParaId) -> Result<(), } /// Schedules a validation code upgrade to a parachain with the given id. -/// -/// This simply calls [`crate::paras::Pallet::schedule_code_upgrade_external`]. pub fn schedule_code_upgrade( id: ParaId, new_code: ValidationCode, @@ -100,8 +94,6 @@ pub fn schedule_code_upgrade( } /// Sets the current parachain head with the given id. -/// -/// This simply calls [`crate::paras::Pallet::set_current_head`]. pub fn set_current_head(id: ParaId, new_head: HeadData) { paras::Pallet::::set_current_head(id, new_head) } diff --git a/polkadot/runtime/parachains/src/paras_inherent/misc.rs b/polkadot/runtime/parachains/src/paras_inherent/misc.rs index e77b26b9e12f5fa34ab80967496f50ab07b3d6bf..dac9e6e256d0ef60c6b18b51d48f44c65e1cae8f 100644 --- a/polkadot/runtime/parachains/src/paras_inherent/misc.rs +++ b/polkadot/runtime/parachains/src/paras_inherent/misc.rs @@ -40,7 +40,7 @@ impl IndexedRetain for Vec { } /// Helper trait until `is_sorted_by` is stabilized. -/// TODO: https://github.com/rust-lang/rust/issues/53485 +/// TODO: pub trait IsSortedBy { fn is_sorted_by(self, cmp: F) -> bool where diff --git a/polkadot/runtime/parachains/src/paras_inherent/tests.rs b/polkadot/runtime/parachains/src/paras_inherent/tests.rs index 1e5271909664d2bb98752b102cfef57532444bce..ab515cb37565bbef2e22a436a5150d9559df26d0 100644 --- a/polkadot/runtime/parachains/src/paras_inherent/tests.rs +++ b/polkadot/runtime/parachains/src/paras_inherent/tests.rs @@ -948,8 +948,11 @@ fn default_header() -> primitives::Header { mod sanitizers { use super::*; - use crate::inclusion::tests::{ - back_candidate, collator_sign_candidate, BackingKind, TestCandidateBuilder, + use crate::{ + inclusion::tests::{ + back_candidate, collator_sign_candidate, BackingKind, TestCandidateBuilder, + }, + mock::{new_test_ext, MockGenesisConfig}, }; use bitvec::order::Lsb0; use primitives::{ @@ -1207,131 +1210,133 @@ mod sanitizers { #[test] fn candidates() { - const RELAY_PARENT_NUM: u32 = 3; - - let header = default_header(); - let relay_parent = header.hash(); - let session_index = SessionIndex::from(0_u32); - - let keystore = LocalKeystore::in_memory(); - let keystore = Arc::new(keystore) as KeystorePtr; - let signing_context = SigningContext { parent_hash: relay_parent, session_index }; - - let validators = vec![ - keyring::Sr25519Keyring::Alice, - keyring::Sr25519Keyring::Bob, - keyring::Sr25519Keyring::Charlie, - keyring::Sr25519Keyring::Dave, - ]; - for validator in validators.iter() { - Keystore::sr25519_generate_new( - &*keystore, - PARACHAIN_KEY_TYPE_ID, - Some(&validator.to_seed()), - ) - .unwrap(); - } - - let has_concluded_invalid = - |_idx: usize, _backed_candidate: &BackedCandidate| -> bool { false }; - - let entry_ttl = 10_000; - let scheduled = (0_usize..2) - .into_iter() - .map(|idx| { - let core_idx = CoreIndex::from(idx as u32); - let ca = CoreAssignment { - paras_entry: ParasEntry::new( - Assignment::new(ParaId::from(1_u32 + idx as u32)), - entry_ttl, - ), - core: core_idx, - }; - ca - }) - .collect::>(); - - let group_validators = |group_index: GroupIndex| { - match group_index { - group_index if group_index == GroupIndex::from(0) => Some(vec![0, 1]), - group_index if group_index == GroupIndex::from(1) => Some(vec![2, 3]), - _ => panic!("Group index out of bounds for 2 parachains and 1 parathread core"), + new_test_ext(MockGenesisConfig::default()).execute_with(|| { + const RELAY_PARENT_NUM: u32 = 3; + + let header = default_header(); + let relay_parent = header.hash(); + let session_index = SessionIndex::from(0_u32); + + let keystore = LocalKeystore::in_memory(); + let keystore = Arc::new(keystore) as KeystorePtr; + let signing_context = SigningContext { parent_hash: relay_parent, session_index }; + + let validators = vec![ + keyring::Sr25519Keyring::Alice, + keyring::Sr25519Keyring::Bob, + keyring::Sr25519Keyring::Charlie, + keyring::Sr25519Keyring::Dave, + ]; + for validator in validators.iter() { + Keystore::sr25519_generate_new( + &*keystore, + PARACHAIN_KEY_TYPE_ID, + Some(&validator.to_seed()), + ) + .unwrap(); } - .map(|m| m.into_iter().map(ValidatorIndex).collect::>()) - }; - - let backed_candidates = (0_usize..2) - .into_iter() - .map(|idx0| { - let idx1 = idx0 + 1; - let mut candidate = TestCandidateBuilder { - para_id: ParaId::from(idx1), - relay_parent, - pov_hash: Hash::repeat_byte(idx1 as u8), - persisted_validation_data_hash: [42u8; 32].into(), - hrmp_watermark: RELAY_PARENT_NUM, - ..Default::default() - } - .build(); - - collator_sign_candidate(Sr25519Keyring::One, &mut candidate); - let backed = back_candidate( - candidate, - &validators, - group_validators(GroupIndex::from(idx0 as u32)).unwrap().as_ref(), - &keystore, - &signing_context, - BackingKind::Threshold, - ); - backed - }) - .collect::>(); - - // happy path - assert_eq!( - sanitize_backed_candidates::( - backed_candidates.clone(), - has_concluded_invalid, - &scheduled - ), - backed_candidates - ); - - // nothing is scheduled, so no paraids match, thus all backed candidates are skipped - { - let scheduled = &Vec::new(); - assert!(sanitize_backed_candidates::( - backed_candidates.clone(), - has_concluded_invalid, - &scheduled - ) - .is_empty()); - } + let has_concluded_invalid = + |_idx: usize, _backed_candidate: &BackedCandidate| -> bool { false }; - // candidates that have concluded as invalid are filtered out - { - // mark every second one as concluded invalid - let set = { - let mut set = std::collections::HashSet::new(); - for (idx, backed_candidate) in backed_candidates.iter().enumerate() { - if idx & 0x01 == 0 { - set.insert(backed_candidate.hash()); - } + let entry_ttl = 10_000; + let scheduled = (0_usize..2) + .into_iter() + .map(|idx| { + let core_idx = CoreIndex::from(idx as u32); + let ca = CoreAssignment { + paras_entry: ParasEntry::new( + Assignment::new(ParaId::from(1_u32 + idx as u32)), + entry_ttl, + ), + core: core_idx, + }; + ca + }) + .collect::>(); + + let group_validators = |group_index: GroupIndex| { + match group_index { + group_index if group_index == GroupIndex::from(0) => Some(vec![0, 1]), + group_index if group_index == GroupIndex::from(1) => Some(vec![2, 3]), + _ => panic!("Group index out of bounds for 2 parachains and 1 parathread core"), } - set + .map(|m| m.into_iter().map(ValidatorIndex).collect::>()) }; - let has_concluded_invalid = - |_idx: usize, candidate: &BackedCandidate| set.contains(&candidate.hash()); + + let backed_candidates = (0_usize..2) + .into_iter() + .map(|idx0| { + let idx1 = idx0 + 1; + let mut candidate = TestCandidateBuilder { + para_id: ParaId::from(idx1), + relay_parent, + pov_hash: Hash::repeat_byte(idx1 as u8), + persisted_validation_data_hash: [42u8; 32].into(), + hrmp_watermark: RELAY_PARENT_NUM, + ..Default::default() + } + .build(); + + collator_sign_candidate(Sr25519Keyring::One, &mut candidate); + + let backed = back_candidate( + candidate, + &validators, + group_validators(GroupIndex::from(idx0 as u32)).unwrap().as_ref(), + &keystore, + &signing_context, + BackingKind::Threshold, + ); + backed + }) + .collect::>(); + + // happy path assert_eq!( sanitize_backed_candidates::( backed_candidates.clone(), has_concluded_invalid, &scheduled - ) - .len(), - backed_candidates.len() / 2 + ), + backed_candidates ); - } + + // nothing is scheduled, so no paraids match, thus all backed candidates are skipped + { + let scheduled = &Vec::new(); + assert!(sanitize_backed_candidates::( + backed_candidates.clone(), + has_concluded_invalid, + &scheduled + ) + .is_empty()); + } + + // candidates that have concluded as invalid are filtered out + { + // mark every second one as concluded invalid + let set = { + let mut set = std::collections::HashSet::new(); + for (idx, backed_candidate) in backed_candidates.iter().enumerate() { + if idx & 0x01 == 0 { + set.insert(backed_candidate.hash()); + } + } + set + }; + let has_concluded_invalid = + |_idx: usize, candidate: &BackedCandidate| set.contains(&candidate.hash()); + assert_eq!( + sanitize_backed_candidates::( + backed_candidates.clone(), + has_concluded_invalid, + &scheduled + ) + .len(), + backed_candidates.len() / 2 + ); + } + }); } } diff --git a/polkadot/runtime/parachains/src/runtime_api_impl/v5.rs b/polkadot/runtime/parachains/src/runtime_api_impl/v5.rs index cd15796897334a477ee19e33aa9cc4a92c68605e..bac1268f53bd34af67fa0ab98cd583114b4c64f9 100644 --- a/polkadot/runtime/parachains/src/runtime_api_impl/v5.rs +++ b/polkadot/runtime/parachains/src/runtime_api_impl/v5.rs @@ -345,7 +345,7 @@ pub fn on_chain_votes() -> Option>::on_chain_votes() } -/// Submits an PVF pre-checking vote. See [`paras::Pallet::submit_pvf_check_statement`]. +/// Submits an PVF pre-checking vote. pub fn submit_pvf_check_statement( stmt: PvfCheckStatement, signature: ValidatorSignature, @@ -353,8 +353,7 @@ pub fn submit_pvf_check_statement( >::submit_pvf_check_statement(stmt, signature) } -/// Returns the list of all PVF code hashes that require pre-checking. See -/// [`paras::Pallet::pvfs_require_precheck`]. +/// Returns the list of all PVF code hashes that require pre-checking. pub fn pvfs_require_precheck() -> Vec { >::pvfs_require_precheck() } diff --git a/polkadot/runtime/parachains/src/runtime_api_impl/vstaging.rs b/polkadot/runtime/parachains/src/runtime_api_impl/vstaging.rs index 5406428377d0dd0a0991f3f6edab35ada25bda13..deef19d9071071fa86ec7a79341191a8d6737a70 100644 --- a/polkadot/runtime/parachains/src/runtime_api_impl/vstaging.rs +++ b/polkadot/runtime/parachains/src/runtime_api_impl/vstaging.rs @@ -118,3 +118,8 @@ pub fn backing_state( pub fn async_backing_params() -> AsyncBackingParams { >::config().async_backing_params } + +/// Return the min backing votes threshold from the configuration. +pub fn minimum_backing_votes() -> u32 { + >::config().minimum_backing_votes +} diff --git a/polkadot/runtime/parachains/src/ump_tests.rs b/polkadot/runtime/parachains/src/ump_tests.rs index 22aee31043a28714051a8b76a7d077120982951f..e96b5e9689272a40d7977a43b5d3ed961a3926f1 100644 --- a/polkadot/runtime/parachains/src/ump_tests.rs +++ b/polkadot/runtime/parachains/src/ump_tests.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/polkadot/runtime/polkadot/Cargo.toml b/polkadot/runtime/polkadot/Cargo.toml index 1cd5abfdd6d489e708821b63fc431233faad257c..d185677ab8d27f142834cad31ef21d6f8fb73e9c 100644 --- a/polkadot/runtime/polkadot/Cargo.toml +++ b/polkadot/runtime/polkadot/Cargo.toml @@ -12,7 +12,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } -serde = { version = "1.0.163", default-features = false } +serde = { version = "1.0.188", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" smallvec = "1.8.0" @@ -98,9 +98,9 @@ runtime-common = { package = "polkadot-runtime-common", path = "../common", defa runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } -xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm/xcm-builder", default-features = false } [dev-dependencies] hex-literal = "0.4.1" @@ -307,12 +307,6 @@ try-runtime = [ "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] -# When enabled, the runtime API will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime API exported functions -# in WASM. -disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index c4458076cb3d9e6516d53fd61b7da08dcf9b1bcc..2efd329eea0ccc4d3c27b48df4246357c316f8e4 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -130,10 +130,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 0, spec_version: 9430, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, - #[cfg(feature = "disable-runtime-api")] - apis: sp_version::create_apis_vec![[]], transaction_version: 24, state_version: 0, }; @@ -1525,6 +1522,8 @@ pub mod migrations { frame_support::migrations::RemovePallet::DbWeight>, frame_support::migrations::RemovePallet::DbWeight>, frame_support::migrations::RemovePallet::DbWeight>, + + parachains_configuration::migration::v9::MigrateToV9, ); } @@ -1599,7 +1598,6 @@ mod benches { ); } -#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index e552920243d7fe09639f9d7fa7468bad71ee18c5..6af9407a5879b3e7e091f0425b38b7ffc030663f 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -10,7 +10,7 @@ license.workspace = true parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -serde = { version = "1.0.163", default-features = false } +serde = { version = "1.0.188", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" smallvec = "1.8.0" @@ -87,11 +87,11 @@ hex-literal = { version = "0.4.1" } runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false, features=["experimental"] } runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } -xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm/xcm-builder", default-features = false } [dev-dependencies] tiny-keccak = { version = "2.0.2", features = ["keccak"] } @@ -165,7 +165,7 @@ std = [ "pallet-xcm-benchmarks?/std", "pallet-xcm/std", "parity-scale-codec/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "primitives/std", "rococo-runtime-constants/std", "runtime-common/std", @@ -226,7 +226,7 @@ runtime-benchmarks = [ "pallet-vesting/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "primitives/runtime-benchmarks", "runtime-common/runtime-benchmarks", "runtime-parachains/runtime-benchmarks", @@ -282,12 +282,6 @@ try-runtime = [ "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] -# When enabled, the runtime API will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime API exported functions -# in WASM. -disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 6894bd7bbf4422c2f9e3f81ad27c8f0a51f19891..a80f45c340d97b16472f5394c51fe279a2d9960b 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -116,10 +116,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 0, spec_version: 9430, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, - #[cfg(feature = "disable-runtime-api")] - apis: sp_version::create_apis_vec![[]], transaction_version: 22, state_version: 1, }; @@ -1552,6 +1549,7 @@ pub mod migrations { assigned_slots::migration::v1::VersionCheckedMigrateToV1, parachains_scheduler::migration::v1::MigrateToV1, parachains_configuration::migration::v8::MigrateToV8, + parachains_configuration::migration::v9::MigrateToV9, ); } @@ -1647,7 +1645,6 @@ mod benches { ); } -#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { diff --git a/polkadot/runtime/test-runtime/Cargo.toml b/polkadot/runtime/test-runtime/Cargo.toml index 8e212673a39333a985ec3ad68be5da42266f74e7..1e411bc901ced86810745eef2e19357e1b5091b5 100644 --- a/polkadot/runtime/test-runtime/Cargo.toml +++ b/polkadot/runtime/test-runtime/Cargo.toml @@ -13,7 +13,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false } +serde = { version = "1.0.188", default-features = false } serde_derive = { version = "1.0.117", optional = true } smallvec = "1.8.0" @@ -59,11 +59,11 @@ pallet-vesting = { path = "../../../substrate/frame/vesting", default-features = runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false } -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } polkadot-runtime-parachains = { path = "../parachains", default-features = false } -xcm-builder = { path = "../../xcm/xcm-builder", default-features = false } -xcm-executor = { path = "../../xcm/xcm-executor", default-features = false } -xcm = { path = "../../xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } [dev-dependencies] hex-literal = "0.4.1" @@ -114,7 +114,7 @@ std = [ "pallet-vesting/std", "pallet-xcm/std", "parity-scale-codec/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "polkadot-runtime-parachains/std", "primitives/std", "runtime-common/std", @@ -152,7 +152,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "primitives/runtime-benchmarks", "runtime-common/runtime-benchmarks", diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index a0410dc7d3c602ecf888234f770d5cd99b7b0a95..5a47288297befb78d58c53c6ca239440bc14223a 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -12,7 +12,7 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } -serde = { version = "1.0.163", default-features = false } +serde = { version = "1.0.188", default-features = false } serde_derive = { version = "1.0.117", optional = true } smallvec = "1.8.0" @@ -97,12 +97,12 @@ hex-literal = { version = "0.4.1", optional = true } runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false, features=["experimental"] } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } -xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "../../xcm", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm/xcm-executor", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm/xcm-builder", default-features = false } [dev-dependencies] hex-literal = "0.4.1" @@ -184,7 +184,7 @@ std = [ "pallet-xcm-benchmarks?/std", "pallet-xcm/std", "parity-scale-codec/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "primitives/std", "runtime-common/std", "runtime-parachains/std", @@ -254,7 +254,7 @@ runtime-benchmarks = [ "pallet-vesting/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "primitives/runtime-benchmarks", "runtime-common/runtime-benchmarks", "runtime-parachains/runtime-benchmarks", @@ -311,12 +311,6 @@ try-runtime = [ "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] -# When enabled, the runtime API will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime API exported functions -# in WASM. -disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 9ae30c376010ed2af96b58eae556fc5ac3d3c7a5..73aa4980151eaaf528067aad7d8e70e9a6b4c92b 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -62,7 +62,9 @@ use runtime_parachains::{ inclusion::{AggregateMessageOrigin, UmpQueueId}, initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras, paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points, - runtime_api_impl::v5 as parachains_runtime_api_impl, + runtime_api_impl::{ + v5 as parachains_runtime_api_impl, vstaging as parachains_staging_runtime_api_impl, + }, scheduler as parachains_scheduler, session_info as parachains_session_info, shared as parachains_shared, }; @@ -121,10 +123,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 2, spec_version: 9430, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, - #[cfg(feature = "disable-runtime-api")] - apis: sp_version::create_apis_vec![[]], transaction_version: 22, state_version: 1, }; @@ -1425,6 +1424,7 @@ pub mod migrations { parachains_scheduler::migration::v1::MigrateToV1, parachains_configuration::migration::v8::MigrateToV8, UpgradeSessionKeys, + parachains_configuration::migration::v9::MigrateToV9, ); } @@ -1494,7 +1494,6 @@ mod benches { ); } -#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1561,6 +1560,7 @@ sp_api::impl_runtime_apis! { } } + #[api_version(6)] impl primitives::runtime_api::ParachainHost for Runtime { fn validators() -> Vec { parachains_runtime_api_impl::validators::() @@ -1691,6 +1691,10 @@ sp_api::impl_runtime_apis! { key_ownership_proof, ) } + + fn minimum_backing_votes() -> u32 { + parachains_staging_runtime_api_impl::minimum_backing_votes::() + } } impl beefy_primitives::BeefyApi for Runtime { diff --git a/polkadot/scripts/ci/changelog/.gitignore b/polkadot/scripts/ci/changelog/.gitignore deleted file mode 100644 index 4fbcc523b04cf0aba6c866a38250a83c16deb8d8..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -changelog.md -*.json -release*.md -.env diff --git a/polkadot/scripts/ci/changelog/Gemfile b/polkadot/scripts/ci/changelog/Gemfile deleted file mode 100644 index 46b058e3c5004c85f4ef79b867d2a6638a7e8cd4..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/Gemfile +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -gem 'octokit', '~> 4' - -gem 'git_diff_parser', '~> 3' - -gem 'toml', '~> 0.3.0' - -gem 'rake', group: :dev - -gem 'optparse', '~> 0.1.1' - -gem 'logger', '~> 1.4' - -gem 'changelogerator', '0.10.1' - -gem 'test-unit', group: :dev - -gem 'rubocop', group: :dev, require: false diff --git a/polkadot/scripts/ci/changelog/Gemfile.lock b/polkadot/scripts/ci/changelog/Gemfile.lock deleted file mode 100644 index 422aa3a8844bbc48f4f23ce2f96e5dce609a626e..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/Gemfile.lock +++ /dev/null @@ -1,84 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - ast (2.4.2) - changelogerator (0.10.1) - git_diff_parser (~> 3) - octokit (~> 4) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - git_diff_parser (3.2.0) - logger (1.4.4) - multipart-post (2.1.1) - octokit (4.21.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - optparse (0.1.1) - parallel (1.21.0) - parser (3.0.2.0) - ast (~> 2.4.1) - parslet (2.0.0) - power_assert (2.0.1) - public_suffix (4.0.6) - rainbow (3.0.0) - rake (13.0.6) - regexp_parser (2.1.1) - rexml (3.2.5) - rubocop (1.23.0) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.13.0) - parser (>= 3.0.1.1) - ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - test-unit (3.5.1) - power_assert - toml (0.3.0) - parslet (>= 1.8.0, < 3.0.0) - unicode-display_width (2.1.0) - -PLATFORMS - x86_64-darwin-20 - x86_64-darwin-22 - -DEPENDENCIES - changelogerator (= 0.10.1) - git_diff_parser (~> 3) - logger (~> 1.4) - octokit (~> 4) - optparse (~> 0.1.1) - rake - rubocop - test-unit - toml (~> 0.3.0) - -BUNDLED WITH - 2.4.6 diff --git a/polkadot/scripts/ci/changelog/README.md b/polkadot/scripts/ci/changelog/README.md deleted file mode 100644 index ab3c1fd214ee72529c663220c847476c8b8e3a82..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Changelog - -Currently, the changelog is built locally. It will be moved to CI once labels stabilize. - -For now, a bit of preparation is required before you can run the script: -- fetch the srtool digests -- store them under the `digests` folder as `-srtool-digest.json` -- ensure the `.env` file is up to date with correct information. See below for an example - -The content of the release notes is generated from the template files under the `scripts/ci/changelog/templates` folder. For readability and maintenance, the template is split into several small snippets. - -Run: -``` -./bin/changelog [] -``` - -For instance: -``` -./bin/changelog v0.9.18 -``` - -A file called `release-notes.md` will be generated and can be used for the release. - -## ENV - -You may use the following ENV for testing: - -``` -RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" -RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" -PRE_RELEASE=true -HIDE_SRTOOL_SHELL=true -DEBUG=1 -NO_CACHE=1 -``` -## Considered labels - -The following list will likely evolve over time and it will be hard to keep it in sync. -In any case, if you want to find all the labels that are used, search for `meta` in the templates. -Currently, the considered labels are: - -- Priority: C labels -- Audit: D labels -- E4 => new host function -- E2 => database migration -- B0 => silent, not showing up -- B1 => noteworthy -- T0 => node -- T1 => runtime - -Note that labels with the same letter are mutually exclusive. -A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will -decide which label will be considered. - -## Dev and debuggin - -### Hot Reload - -The following command allows **Hot Reload**: -``` -fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./bin/changelog v0.9.18 -``` -### Caching - -By default, if the changelog data from Github is already present, the calls to the Github API will be skipped -and the local version of the data will be used. This is much faster. -If you know that some labels have changed in Github, you will want to refresh the data. -You can then either delete manually the `.json` file or `export NO_CACHE=1` to force refreshing the data. - -## Full PR list - -At times, it may be useful to get a raw full PR list. -In order to produce this list, you first need to fetch the the latest `context.json` from the `release-notes-context` artifacts you can find [here](https://github.com/paritytech/polkadot/actions/workflows/release-30_publish-draft-release.yml). You may store this `context.json` under `scripts/ci/changelog`. - -Using the `full_pr_list.md.tera` template, you can generate the `raw` list of changes: - -``` -cd scripts/ci/changelog -tera --env --env-key env --template templates/full_pr_list.md.tera context.json -``` diff --git a/polkadot/scripts/ci/changelog/bin/changelog b/polkadot/scripts/ci/changelog/bin/changelog deleted file mode 100755 index e642a44890433f01314490253b508a5d8641488a..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/bin/changelog +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env ruby - -# frozen_string_literal: true - -# call for instance as: -# ./bin/changelog [] [] -# for instance, for the release notes of v1.2.3: -# ./bin/changelog v1.2.3 -# or -# ./bin/changelog v1.2.3 v1.2.2 -# -# You may set the ENV NO_CACHE to force fetching from Github -# You should also ensure you set the ENV: GITHUB_TOKEN - -require_relative '../lib/changelog' -require 'logger' - -logger = Logger.new($stdout) -logger.level = Logger::DEBUG -logger.debug('Starting') - -changelogerator_version = `changelogerator --version` -logger.debug(changelogerator_version) - -owner = 'paritytech' -repo = 'polkadot' - -gh_polkadot = SubRef.new(format('%s/%s', { owner: owner, repo: repo })) -last_release_ref = gh_polkadot.get_last_ref() - -polkadot_ref2 = ARGV[0] || 'HEAD' -polkadot_ref1 = ARGV[1] || last_release_ref - -output = ARGV[2] || 'release-notes.md' - -ENV['REF1'] = polkadot_ref1 -ENV['REF2'] = polkadot_ref2 - -substrate_ref1 = gh_polkadot.get_dependency_reference(polkadot_ref1, 'sp-io') -substrate_ref2 = gh_polkadot.get_dependency_reference(polkadot_ref2, 'sp-io') - -logger.debug("Polkadot from: #{polkadot_ref1}") -logger.debug("Polkadot to: #{polkadot_ref2}") - -logger.debug("Substrate from: #{substrate_ref1}") -logger.debug("Substrate to: #{substrate_ref2}") - -substrate_data = 'substrate.json' -polkadot_data = 'polkadot.json' - -logger.debug("Using SUBSTRATE: #{substrate_data}") -logger.debug("Using POLKADOT: #{polkadot_data}") - -logger.warn('NO_CACHE set') if ENV['NO_CACHE'] - -if ENV['NO_CACHE'] || !File.file?(polkadot_data) - logger.debug(format('Fetching data for Polkadot into %s', polkadot_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', - { owner: owner, repo: 'polkadot', from: polkadot_ref1, to: polkadot_ref2, output: polkadot_data }) - system(cmd) -else - logger.debug("Re-using:#{polkadot_data}") -end - -if ENV['NO_CACHE'] || !File.file?(substrate_data) - logger.debug(format('Fetching data for Substrate into %s', substrate_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', - { owner: owner, repo: 'substrate', from: substrate_ref1, to: substrate_ref2, output: substrate_data }) - system(cmd) -else - logger.debug("Re-using:#{substrate_data}") -end - -KUSAMA_DIGEST = ENV['KUSAMA_DIGEST'] || 'digests/kusama_srtool_output.json' -WESTEND_DIGEST = ENV['WESTEND_DIGEST'] || 'digests/westend_srtool_output.json' -ROCOCO_DIGEST = ENV['ROCOCO_DIGEST'] || 'digests/rococo_srtool_output.json' -POLKADOT_DIGEST = ENV['POLKADOT_DIGEST'] || 'digests/polkadot_srtool_output.json' - -# Here we compose all the pieces together into one -# single big json file. -cmd = format('jq \ - --slurpfile substrate %s \ - --slurpfile polkadot %s \ - --slurpfile srtool_kusama %s \ - --slurpfile srtool_westend %s \ - --slurpfile srtool_rococo %s \ - --slurpfile srtool_polkadot %s \ - -n \'{ - substrate: $substrate[0], - polkadot: $polkadot[0], - srtool: [ - { name: "kusama", data: $srtool_kusama[0] }, - { name: "westend", data: $srtool_westend[0] }, - { name: "rococo", data: $srtool_rococo[0] }, - { name: "polkadot", data: $srtool_polkadot[0] } - ] }\' > context.json', substrate_data, polkadot_data, - KUSAMA_DIGEST, - WESTEND_DIGEST, - ROCOCO_DIGEST, - POLKADOT_DIGEST) -system(cmd) - -cmd = format('tera --env --env-key env --include-path templates \ - --template templates/template.md.tera context.json > %s', output) -system(cmd) diff --git a/polkadot/scripts/ci/changelog/digests/.gitignore b/polkadot/scripts/ci/changelog/digests/.gitignore deleted file mode 100644 index a6c57f5fb2ffba0a6af4278619c2983394d237cc..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/digests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.json diff --git a/polkadot/scripts/ci/changelog/digests/.gitkeep b/polkadot/scripts/ci/changelog/digests/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/polkadot/scripts/ci/changelog/lib/changelog.rb b/polkadot/scripts/ci/changelog/lib/changelog.rb deleted file mode 100644 index e98baf82f01f8ecbc5b3e2424387576b1afc4ae7..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/lib/changelog.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# A Class to find Substrate references -class SubRef - require 'octokit' - require 'toml' - - attr_reader :client, :repository - - def initialize(github_repo) - @client = Octokit::Client.new( - access_token: ENV['GITHUB_TOKEN'] - ) - @repository = @client.repository(github_repo) - end - - # This function checks the Cargo.lock of a given - # Rust project, for a given package, and fetches - # the dependency git ref. - def get_dependency_reference(ref, package) - cargo = TOML::Parser.new( - Base64.decode64( - @client.contents( - @repository.full_name, - path: 'Cargo.lock', - query: { ref: ref.to_s } - ).content - ) - ).parsed - cargo['package'].find { |p| p['name'] == package }['source'].split('#').last - end - - # Get the git ref of the last release for the repo. - # repo is given in the form paritytech/polkadot - def get_last_ref() - 'refs/tags/' + @client.latest_release(@repository.full_name).tag_name - end -end diff --git a/polkadot/scripts/ci/changelog/templates/_free_notes.md.tera b/polkadot/scripts/ci/changelog/templates/_free_notes.md.tera deleted file mode 100644 index c4a841a992515a0016f8aec99cc0038e7428cafb..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/_free_notes.md.tera +++ /dev/null @@ -1,10 +0,0 @@ - -{# This file uses the Markdown format with additional templating such as this comment. -#} -{# Such a comment will not show up in the rendered release notes. -#} -{# The content of this file (if any) will be inserted at the top of the release notes -#} -{# and generated for each new release candidate. -#} -{# Ensure you leave an empty line at both top and bottom of this file. -#} - - - - diff --git a/polkadot/scripts/ci/changelog/templates/change.md.tera b/polkadot/scripts/ci/changelog/templates/change.md.tera deleted file mode 100644 index cfde3be6e85f1f400d3894063d1ffaf9c7870e6c..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/change.md.tera +++ /dev/null @@ -1,43 +0,0 @@ -{# This macro shows ONE change #} -{%- macro change(c, cml="[C]", dot="[P]", sub="[S]") -%} - -{%- if c.meta.C and c.meta.C.agg.max >= 7 -%} -{%- set prio = " ‼️ HIGH" -%} -{%- elif c.meta.C and c.meta.C.agg.max >= 3 -%} -{%- set prio = " ❗️ Medium" -%} -{%- elif c.meta.C and c.meta.C.agg.max < 3 -%} -{%- set prio = " Low" -%} -{%- else -%} -{%- set prio = "" -%} -{%- endif -%} - -{%- set audit = "" -%} - -{%- if c.meta.D and c.meta.D.D1 -%} -{%- set audit = "✅ audited " -%} -{%- elif c.meta.D and c.meta.D.D2 -%} -{%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.D3 -%} -{%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.D5 -%} -{%- set audit = "⏳ pending non-critical audit " -%} -{%- else -%} -{%- set audit = "" -%} -{%- endif -%} - -{%- if c.html_url is containing("polkadot") -%} -{%- set repo = dot -%} -{%- elif c.html_url is containing("substrate") -%} -{%- set repo = sub -%} -{%- else -%} -{%- set repo = " " -%} -{%- endif -%} - -{%- if c.meta.T and c.meta.T.T6 -%} -{%- set xcm = " [✉️ XCM]" -%} -{%- else -%} -{%- set xcm = "" -%} -{%- endif -%} - -{{- repo }} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=120, end="…") }}{{xcm }} -{%- endmacro change -%} diff --git a/polkadot/scripts/ci/changelog/templates/changes.md.tera b/polkadot/scripts/ci/changelog/templates/changes.md.tera deleted file mode 100644 index f598b2fe83f78bf22b97d832afb61e44c11eba53..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/changes.md.tera +++ /dev/null @@ -1,15 +0,0 @@ -{# This include generates the section showing the changes #} -## Changes - -### Legend - -- {{ DOT }} Polkadot -- {{ SUB }} Substrate - -{% include "changes_client.md.tera" %} - -{% include "changes_runtime.md.tera" %} - -{% include "changes_api.md.tera" %} - -{% include "changes_misc.md.tera" %} diff --git a/polkadot/scripts/ci/changelog/templates/changes_api.md.tera b/polkadot/scripts/ci/changelog/templates/changes_api.md.tera deleted file mode 100644 index 29e08b8cd38254cc975d34ef449ab8f8e0a8d42b..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/changes_api.md.tera +++ /dev/null @@ -1,17 +0,0 @@ -{% import "change.md.tera" as m_c -%} -### API - -{#- The changes are sorted by merge date #} -{%- for pr in changes | sort(attribute="merged_at") %} - -{%- if pr.meta.B %} - {%- if pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- else -%} - - {%- if pr.meta.T and pr.meta.T.T2 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/changes_client.md.tera b/polkadot/scripts/ci/changelog/templates/changes_client.md.tera deleted file mode 100644 index 6d31961c3650193137cea14e975febad07199510..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/changes_client.md.tera +++ /dev/null @@ -1,17 +0,0 @@ -{% import "change.md.tera" as m_c -%} -### Client - -{#- The changes are sorted by merge date #} -{%- for pr in changes | sort(attribute="merged_at") %} - -{%- if pr.meta.B %} - {%- if pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- else -%} - - {%- if pr.meta.T and pr.meta.T.T0 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera b/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera deleted file mode 100644 index 725b03081eb36d34dc0435deb2c4f3d1ef0f8da9..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera +++ /dev/null @@ -1,42 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{%- set_global misc_count = 0 -%} -{#- First pass to count #} -{%- for pr in changes -%} - {%- if pr.meta.B %} - {%- if pr.meta.B.B0 -%} - {#- We skip silent ones -#} - {%- else -%} - {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} -{%- set_global misc_count = misc_count + 1 -%} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor -%} - - -{%- if misc_count > 0 %} -### Misc - -{% if misc_count > 10 %} -There are other misc. changes. You can expand the list below to view them all. -
Other misc. changes -{% endif -%} - -{#- The changes are sorted by merge date #} -{%- for pr in changes | sort(attribute="merged_at") %} - {%- if pr.meta.B and not pr.title is containing("ompanion") %} - {%- if pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- else -%} - {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} - {% endif -%} -{% endfor %} - -{% if misc_count > 10 %} -
-{% endif -%} -{% endif -%} diff --git a/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera b/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera deleted file mode 100644 index bd126c0628c4089ddc8eee8cde345b4234c2ef0d..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera +++ /dev/null @@ -1,19 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -### Runtime - -{#- The changes are sorted by merge date -#} -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B -%} -{%- if pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - -{%- if pr.meta.T and pr.meta.T.T1 and not pr.title is containing("ompanion") %} -- {{ m_c::change(c=pr) }} -{%- endif -%} -{%- endif -%} - -{%- endif -%} -{%- endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/compiler.md.tera b/polkadot/scripts/ci/changelog/templates/compiler.md.tera deleted file mode 100644 index 6fa1baa6506197768fb1ac82b1961daa8ac5f9fa..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/compiler.md.tera +++ /dev/null @@ -1,7 +0,0 @@ -## Rust compiler versions - -This release was built and tested against the following versions of `rustc`. -Other versions may work. - -- Rust Stable: `{{ env.RUSTC_STABLE }}` -- Rust Nightly: `{{ env.RUSTC_NIGHTLY }}` diff --git a/polkadot/scripts/ci/changelog/templates/debug.md.tera b/polkadot/scripts/ci/changelog/templates/debug.md.tera deleted file mode 100644 index 8c829b09ffe2b1d7ba91d6e6ba43f80701efe558..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/debug.md.tera +++ /dev/null @@ -1,8 +0,0 @@ -{%- set to_ignore = changes | filter(attribute="meta.B.B0") %} - - diff --git a/polkadot/scripts/ci/changelog/templates/docker_image.md.tera b/polkadot/scripts/ci/changelog/templates/docker_image.md.tera deleted file mode 100644 index 4a3793a86ad2450fd16096b08ba39097cd5dfb63..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/docker_image.md.tera +++ /dev/null @@ -1,11 +0,0 @@ - -## Docker image - -The docker image for this release can be found at [Docker hub](https://hub.docker.com/r/parity/polkadot/tags?page=1&ordering=last_updated) -(It will be available a few minutes after the release has been published). - -You may pull it using: - -``` -docker pull parity/polkadot:latest -``` diff --git a/polkadot/scripts/ci/changelog/templates/full_pr_list.md.tera b/polkadot/scripts/ci/changelog/templates/full_pr_list.md.tera deleted file mode 100644 index 1cdab310652fc9bd42ce08d51c94ce7286c3b2f8..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/full_pr_list.md.tera +++ /dev/null @@ -1,16 +0,0 @@ -{# This is a helper template to get the FULL PR list #} -{# It is not used in the release notes #} - -# PR list - -## substrate - -{%- for change in substrate.changes %} - - [S] [`{{ change.number }}`]({{ change.html_url }}) - {{ change.title }} -{%- endfor %} - -## polkadot - -{%- for change in polkadot.changes %} - - [P] [`{{ change.number }}`]({{ change.html_url }}) - {{ change.title }} -{%- endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/global_priority.md.tera b/polkadot/scripts/ci/changelog/templates/global_priority.md.tera deleted file mode 100644 index fe3d634f19dd1393e32ee8ad9f97f3f5419d688a..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/global_priority.md.tera +++ /dev/null @@ -1,22 +0,0 @@ -{% import "high_priority.md.tera" as m_p -%} -## Upgrade Priority - -{%- set polkadot_prio = 0 -%} -{%- set substrate_prio = 0 -%} - -{# We fetch the various priorities #} -{%- if polkadot.meta.C -%} - {%- set polkadot_prio = polkadot.meta.C.max -%} -{%- endif -%} -{%- if substrate.meta.C -%} - {%- set substrate_prio = substrate.meta.C.max -%} -{%- endif -%} - -{# We compute the global priority #} -{%- set global_prio = polkadot_prio -%} -{%- if substrate_prio > global_prio -%} - {%- set global_prio = substrate_prio -%} -{%- endif -%} - -{#- We show the result #} -{{ m_p::high_priority(p=global_prio, changes=changes) }} diff --git a/polkadot/scripts/ci/changelog/templates/high_priority.md.tera b/polkadot/scripts/ci/changelog/templates/high_priority.md.tera deleted file mode 100644 index 39938da44d172e4755cf9dde57ec2cfdf8ebc618..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/high_priority.md.tera +++ /dev/null @@ -1,38 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{# This macro convert a priority level into readable output #} -{%- macro high_priority(p, changes) -%} - -{%- if p >= 7 -%} - {%- set prio = "‼️ HIGH" -%} - {%- set text = "This is a **high priority** release and you must upgrade as as soon as possible." -%} -{%- elif p >= 3 -%} - {%- set prio = "❗️ Medium" -%} - {%- set text = "This is a medium priority release and you should upgrade in a timely manner." -%} -{%- else -%} - {%- set prio = "Low" -%} - {%- set text = "This is a low priority release and you may upgrade at your convenience." -%} -{%- endif %} - - - -{%- if prio %} -{{prio}}: {{text}} - -{% if p >= 3 %} -The changes motivating this priority level are: -{% for pr in changes | sort(attribute="merged_at") -%} - {%- if pr.meta.C -%} - {%- if pr.meta.C.agg.max >= p %} -- {{ m_c::change(c=pr) }} -{%- if pr.meta.T and pr.meta.T.T1 %} (RUNTIME) -{% endif %} - {%- endif -%} - {%- endif -%} -{%- endfor -%} -{%- else -%} - -{%- endif -%} -{%- endif -%} - -{%- endmacro priority -%} diff --git a/polkadot/scripts/ci/changelog/templates/host_functions-list.md.tera b/polkadot/scripts/ci/changelog/templates/host_functions-list.md.tera deleted file mode 100644 index 954d41e40d3b6f962432495aecd0917dcffc8ad3..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/host_functions-list.md.tera +++ /dev/null @@ -1,12 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - {%- if pr.meta.E and pr.meta.E.E3 -%} -- {{ m_c::change(c=pr) }} - {% endif -%} -{% endif -%} -{%- endfor -%} diff --git a/polkadot/scripts/ci/changelog/templates/host_functions.md.tera b/polkadot/scripts/ci/changelog/templates/host_functions.md.tera deleted file mode 100644 index e38bc5d71828d066e1f4b2efd96f588cf46606bf..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/host_functions.md.tera +++ /dev/null @@ -1,44 +0,0 @@ -{%- import "change.md.tera" as m_c -%} - -{%- set_global host_fn_count = 0 -%} -{%- set_global upgrade_first = 0 -%} - -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 -%} -{#- We skip silent ones -#} -{%- else -%} - {%- if pr.meta.E and pr.meta.E.E3 -%} - {%- set_global host_fn_count = host_fn_count + 1 -%} - - {{ m_c::change(c=pr) }} - {% endif -%} - {%- if pr.meta.E and pr.meta.E.E4 -%} - {%- set_global upgrade_first = upgrade_first + 1 -%} - - {{ m_c::change(c=pr) }} - {% endif -%} -{% endif -%} -{%- endfor -%} - - - -{%- if upgrade_first != 0 %} -## Node upgrade required -⚠️ There is a runtime change that will require nodes to be upgraded BEFORE the runtime upgrade. - -⚠️ It is critical that you update your client before the chain switches to the new runtime. -{%- endif %} - - - -## Host functions - -{% if host_fn_count == 0 %} -ℹ️ This release does not contain any change related to host functions. -{% elif host_fn_count == 1 -%} -{# ---- #} -ℹ️ The runtimes in this release contain one change related to **host function**s: -{% include "host_functions-list.md.tera" -%} -{%- else -%} -ℹ️ The runtimes in this release contain {{ host_fn_count }} changes related to **host function**s: -{% include "host_functions-list.md.tera" -%} -{%- endif %} diff --git a/polkadot/scripts/ci/changelog/templates/migrations-db.md.tera b/polkadot/scripts/ci/changelog/templates/migrations-db.md.tera deleted file mode 100644 index 130a61a12cb2a2fb35bec99fd395609612a10b3e..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/migrations-db.md.tera +++ /dev/null @@ -1,30 +0,0 @@ -{% import "change.md.tera" as m_c %} -{%- set_global db_migration_count = 0 -%} -{%- for pr in changes -%} - {%- if pr.meta.B and pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- elif pr.meta.E and pr.meta.E.E1 -%} - {%- set_global db_migration_count = db_migration_count + 1 -%} - {%- endif -%} -{%- endfor %} - -## Database Migrations - -Database migrations are operations upgrading the database to the latest stand. -Some migrations may break compatibility, making a backup of your database is highly recommended. - -{% if db_migration_count == 0 -%} -ℹ️ There is no database migration in this release. -{%- elif db_migration_count == 1 -%} -⚠️ There is one database migration in this release: -{%- else -%} -⚠️ There are {{ db_migration_count }} database migrations in this release: -{%- endif %} -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 %} -{#- We skip silent ones -#} -{%- elif pr.meta.E and pr.meta.E.E1 -%} -- {{ m_c::change(c=pr) }} -{% endif -%} -{% endfor -%} diff --git a/polkadot/scripts/ci/changelog/templates/migrations-runtime.md.tera b/polkadot/scripts/ci/changelog/templates/migrations-runtime.md.tera deleted file mode 100644 index 25517a142eb390e9aab19f34a2b3781ed994056c..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/migrations-runtime.md.tera +++ /dev/null @@ -1,29 +0,0 @@ -{%- import "change.md.tera" as m_c %} -{%- set_global runtime_migration_count = 0 -%} -{%- for pr in changes -%} - {%- if pr.meta.B and pr.meta.B.B0 %} - {#- We skip silent ones -#} - {%- elif pr.meta.E and pr.meta.E.E0 -%} - {%- set_global runtime_migration_count = runtime_migration_count + 1 -%} - {%- endif -%} -{%- endfor %} - -## Runtime Migrations - -Runtime migrations are operations running once during a runtime upgrade. - -{% if runtime_migration_count == 0 -%} -ℹ️ There is no runtime migration in this release. -{%- elif runtime_migration_count == 1 -%} -⚠️ There is one runtime migration in this release: -{%- else -%} -⚠️ There are {{ runtime_migration_count }} runtime migrations in this release: -{%- endif %} -{% for pr in changes | sort(attribute="merged_at") -%} - -{%- if pr.meta.B and pr.meta.B.B0 %} -{#- We skip silent ones -#} -{%- elif pr.meta.E and pr.meta.E.E0 -%} -- {{ m_c::change(c=pr) }} -{% endif -%} -{% endfor -%} diff --git a/polkadot/scripts/ci/changelog/templates/pre_release.md.tera b/polkadot/scripts/ci/changelog/templates/pre_release.md.tera deleted file mode 100644 index 7d4ad42dd8fe9ba42f9d5d1f98ec80d70445b28b..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/pre_release.md.tera +++ /dev/null @@ -1,11 +0,0 @@ -{%- if env.PRE_RELEASE == "true" -%} -
⚠️ This is a pre-release - -**Release candidates** are **pre-releases** and may not be final. -Although they are reasonably tested, there may be additional changes or issues -before an official release is tagged. Use at your own discretion, and consider -only using final releases on critical production infrastructure. -
-{% else -%} - -{%- endif %} diff --git a/polkadot/scripts/ci/changelog/templates/runtime.md.tera b/polkadot/scripts/ci/changelog/templates/runtime.md.tera deleted file mode 100644 index cd7edf28f7a3eabb0767ae54087fb29fa2bc406e..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/runtime.md.tera +++ /dev/null @@ -1,28 +0,0 @@ -{# This macro shows one runtime #} -{%- macro runtime(runtime) -%} - -### {{ runtime.name | capitalize }} - -{%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} -{%- set compressed = "Yes" %} -{%- else %} -{%- set compressed = "No" %} -{%- endif %} - -{%- set comp_ratio = 100 - (runtime.data.runtimes.compressed.subwasm.compression.size_compressed / runtime.data.runtimes.compressed.subwasm.compression.size_decompressed *100) %} - - - - - -``` -🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) -🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version.specName }}-{{ runtime.data.runtimes.compressed.subwasm.core_version.specVersion }} ({{ runtime.data.runtimes.compressed.subwasm.core_version.implName }}-{{ runtime.data.runtimes.compressed.subwasm.core_version.implVersion }}.tx{{ runtime.data.runtimes.compressed.subwasm.core_version.transactionVersion }}.au{{ runtime.data.runtimes.compressed.subwasm.core_version.authoringVersion }}) -🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% -🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} -🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} -🗳️ authorizeUpgrade hash: {{ runtime.data.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }} -🗳️ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} -📦 IPFS: {{ runtime.data.runtimes.compressed.subwasm.ipfs_hash }} -``` -{%- endmacro runtime %} diff --git a/polkadot/scripts/ci/changelog/templates/runtimes.md.tera b/polkadot/scripts/ci/changelog/templates/runtimes.md.tera deleted file mode 100644 index 0847382689fb5336eeedeb1fbb712d317797efcb..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/runtimes.md.tera +++ /dev/null @@ -1,19 +0,0 @@ -{# This include shows the list and details of the runtimes #} -{%- import "runtime.md.tera" as m_r -%} - -{# --- #} - -## Runtimes - -{% set rtm = srtool[0] -%} - -The information about the runtimes included in this release can be found below. -The runtimes have been built using [{{ rtm.data.gen }}](https://github.com/paritytech/srtool) and `{{ rtm.data.rustc }}`. - -{%- for runtime in srtool | sort(attribute="name") %} -{%- set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} -{%- if not env is containing(HIDE_VAR) %} - -{{ m_r::runtime(runtime=runtime) }} -{%- endif %} -{%- endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/template.md.tera b/polkadot/scripts/ci/changelog/templates/template.md.tera deleted file mode 100644 index e04636b4b2277418790376535e39b189c12ce496..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/templates/template.md.tera +++ /dev/null @@ -1,37 +0,0 @@ -{# This is the entry point of the template -#} - -{% include "pre_release.md.tera" -%} - -{% if env.PRE_RELEASE == "true" -%} -This pre-release contains the changes from `{{ env.REF1 | replace(from="refs/tags/", to="") }}` to `{{ env.REF2 | replace(from="refs/tags/", to="") }}`. -{%- else -%} -This release contains the changes from `{{ env.REF1 | replace(from="refs/tags/", to="") }}` to `{{ env.REF2 | replace(from="refs/tags/", to="") }}`. -{% endif -%} - -{%- set changes = polkadot.changes | concat(with=substrate.changes) -%} -{%- include "debug.md.tera" -%} - -{%- set CML = "[C]" -%} -{%- set DOT = "[P]" -%} -{%- set SUB = "[S]" -%} - -{# -- Manual free notes section -- #} -{% include "_free_notes.md.tera" -%} - -{# -- Important automatic section -- #} -{% include "global_priority.md.tera" -%} - -{% include "host_functions.md.tera" -%} - -{% include "migrations-db.md.tera" -%} - -{% include "migrations-runtime.md.tera" -%} -{# --------------------------------- #} - -{% include "compiler.md.tera" -%} - -{% include "runtimes.md.tera" -%} - -{% include "changes.md.tera" -%} - -{% include "docker_image.md.tera" -%} diff --git a/polkadot/scripts/ci/changelog/test/test_basic.rb b/polkadot/scripts/ci/changelog/test/test_basic.rb deleted file mode 100644 index d099fadca43328d034cf753046274414b141888b..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/changelog/test/test_basic.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require_relative '../lib/changelog' -require 'test/unit' - -class TestChangelog < Test::Unit::TestCase - def test_get_dep_ref_polkadot - c = SubRef.new('paritytech/polkadot') - ref = '13c2695' - package = 'sc-cli' - result = c.get_dependency_reference(ref, package) - assert_equal('7db0768a85dc36a3f2a44d042b32f3715c00a90d', result) - end - - def test_get_dep_ref_invalid_ref - c = SubRef.new('paritytech/polkadot') - ref = '9999999' - package = 'sc-cli' - assert_raise do - c.get_dependency_reference(ref, package) - end - end -end diff --git a/polkadot/scripts/ci/common/lib.sh b/polkadot/scripts/ci/common/lib.sh deleted file mode 100755 index e490ec22d5bf4f845c6c662122f8849b0f39d534..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/common/lib.sh +++ /dev/null @@ -1,265 +0,0 @@ -#!/bin/sh - -api_base="https://api.github.com/repos" - -# Function to take 2 git tags/commits and get any lines from commit messages -# that contain something that looks like a PR reference: e.g., (#1234) -sanitised_git_logs(){ - git --no-pager log --pretty=format:"%s" "$1...$2" | - # Only find messages referencing a PR - grep -E '\(#[0-9]+\)' | - # Strip any asterisks - sed 's/^* //g' -} - -# Checks whether a tag on github has been verified -# repo: 'organization/repo' -# tagver: 'v1.2.3' -# Usage: check_tag $repo $tagver -check_tag () { - repo=$1 - tagver=$2 - if [ -n "$GITHUB_RELEASE_TOKEN" ]; then - echo '[+] Fetching tag using privileged token' - tag_out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") - else - echo '[+] Fetching tag using unprivileged token' - tag_out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") - fi - tag_sha=$(echo "$tag_out" | jq -r .object.sha) - object_url=$(echo "$tag_out" | jq -r .object.url) - if [ "$tag_sha" = "null" ]; then - return 2 - fi - echo "[+] Tag object SHA: $tag_sha" - verified_str=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$object_url" | jq -r .verification.verified) - if [ "$verified_str" = "true" ]; then - # Verified, everything is good - return 0 - else - # Not verified. Bad juju. - return 1 - fi -} - -# Checks whether a given PR has a given label. -# repo: 'organization/repo' -# pr_id: 12345 -# label: B1-silent -# Usage: has_label $repo $pr_id $label -has_label(){ - repo="$1" - pr_id="$2" - label="$3" - - # These will exist if the function is called in Gitlab. - # If the function's called in Github, we should have GITHUB_ACCESS_TOKEN set - # already. - if [ -n "$GITHUB_RELEASE_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_RELEASE_TOKEN" - elif [ -n "$GITHUB_PR_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_PR_TOKEN" - fi - - out=$(curl -H "Authorization: token $GITHUB_TOKEN" -s "$api_base/$repo/pulls/$pr_id") - [ -n "$(echo "$out" | tr -d '\r\n' | jq ".labels | .[] | select(.name==\"$label\")")" ] -} - -github_label () { - echo - echo "# run github-api job for labeling it ${1}" - curl -sS -X POST \ - -F "token=${CI_JOB_TOKEN}" \ - -F "ref=master" \ - -F "variables[LABEL]=${1}" \ - -F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \ - -F "variables[PROJECT]=paritytech/polkadot" \ - "${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline" -} - -# Formats a message into a JSON string for posting to Matrix -# message: 'any plaintext message' -# formatted_message: 'optional message formatted in html' -# Usage: structure_message $content $formatted_content (optional) -structure_message() { - if [ -z "$2" ]; then - body=$(jq -Rs --arg body "$1" '{"msgtype": "m.text", $body}' < /dev/null) - else - body=$(jq -Rs --arg body "$1" --arg formatted_body "$2" '{"msgtype": "m.text", $body, "format": "org.matrix.custom.html", $formatted_body}' < /dev/null) - fi - echo "$body" -} - -# Post a message to a matrix room -# body: '{body: "JSON string produced by structure_message"}' -# room_id: !fsfSRjgjBWEWffws:matrix.parity.io -# access_token: see https://matrix.org/docs/guides/client-server-api/ -# Usage: send_message $body (json formatted) $room_id $access_token -send_message() { - curl -XPOST -d "$1" "https://m.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3" -} - -# Pretty-printing functions -boldprint () { printf "|\n| \033[1m%s\033[0m\n|\n" "${@}"; } -boldcat () { printf "|\n"; while read -r l; do printf "| \033[1m%s\033[0m\n" "${l}"; done; printf "|\n" ; } - -skip_if_companion_pr() { - url="https://api.github.com/repos/paritytech/polkadot/pulls/${CI_COMMIT_REF_NAME}" - echo "[+] API URL: $url" - - pr_title=$(curl -sSL -H "Authorization: token ${GITHUB_PR_TOKEN}" "$url" | jq -r .title) - echo "[+] PR title: $pr_title" - - if echo "$pr_title" | grep -qi '^companion'; then - echo "[!] PR is a companion PR. Build is already done in substrate" - exit 0 - else - echo "[+] PR is not a companion PR. Proceeding test" - fi -} - -# Fetches the tag name of the latest release from a repository -# repo: 'organisation/repo' -# Usage: latest_release 'paritytech/polkadot' -latest_release() { - curl -s "$api_base/$1/releases/latest" | jq -r '.tag_name' -} - -# Check for runtime changes between two commits. This is defined as any changes -# to /primitives/src/* and any *production* chains under /runtime -has_runtime_changes() { - from=$1 - to=$2 - - if git diff --name-only "${from}...${to}" \ - | grep -q -e '^runtime/polkadot' -e '^runtime/kusama' -e '^primitives/src/' -e '^runtime/common' - then - return 0 - else - return 1 - fi -} - -# given a bootnode and the path to a chainspec file, this function will create a new chainspec file -# with only the bootnode specified and test whether that bootnode provides peers -# The optional third argument is the index of the bootnode in the list of bootnodes, this is just used to pick an ephemeral -# port for the node to run on. If you're only testing one, it'll just use the first ephemeral port -# BOOTNODE: /dns/polkadot-connect-0.parity.io/tcp/443/wss/p2p/12D3KooWEPmjoRpDSUuiTjvyNDd8fejZ9eNWH5bE965nyBMDrB4o -# CHAINSPEC_FILE: /path/to/polkadot.json -check_bootnode(){ - BOOTNODE=$1 - BASE_CHAINSPEC=$2 - RUNTIME=$(basename "$BASE_CHAINSPEC" | cut -d '.' -f 1) - MIN_PEERS=1 - - # Generate a temporary chainspec file containing only the bootnode we care about - TMP_CHAINSPEC_FILE="$RUNTIME.$(echo "$BOOTNODE" | tr '/' '_').tmp.json" - jq ".bootNodes = [\"$BOOTNODE\"] " < "$CHAINSPEC_FILE" > "$TMP_CHAINSPEC_FILE" - - # Grab an unused port by binding to port 0 and then immediately closing the socket - # This is a bit of a hack, but it's the only way to do it in the shell - RPC_PORT=$(python -c "import socket; s=socket.socket(); s.bind(('', 0)); print(s.getsockname()[1]); s.close()") - - echo "[+] Checking bootnode $BOOTNODE" - polkadot --chain "$TMP_CHAINSPEC_FILE" --no-mdns --rpc-port="$RPC_PORT" --tmp > /dev/null 2>&1 & - # Wait a few seconds for the node to start up - sleep 5 - POLKADOT_PID=$! - - MAX_POLLS=10 - TIME_BETWEEN_POLLS=3 - for _ in $(seq 1 "$MAX_POLLS"); do - # Check the health endpoint of the RPC node - PEERS="$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"system_health","params":[],"id":1}' http://localhost:"$RPC_PORT" | jq -r '.result.peers')" - # Sometimes due to machine load or other reasons, we don't get a response from the RPC node - # If $PEERS is an empty variable, make it 0 so we can still do the comparison - if [ -z "$PEERS" ]; then - PEERS=0 - fi - if [ "$PEERS" -ge $MIN_PEERS ]; then - echo "[+] $PEERS peers found for $BOOTNODE" - echo " Bootnode appears contactable" - kill $POLKADOT_PID - # Delete the temporary chainspec file now we're done running the node - rm "$TMP_CHAINSPEC_FILE" - return 0 - fi - sleep "$TIME_BETWEEN_POLLS" - done - kill $POLKADOT_PID - # Delete the temporary chainspec file now we're done running the node - rm "$TMP_CHAINSPEC_FILE" - echo "[!] No peers found for $BOOTNODE" - echo " Bootnode appears unreachable" - return 1 -} - -# Assumes the ENV are set: -# - RELEASE_ID -# - GITHUB_TOKEN -# - REPO in the form paritytech/polkadot -fetch_release_artifacts() { - echo "Release ID : $RELEASE_ID" - echo "Repo : $REPO" - - curl -L -s \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${GITHUB_TOKEN}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${REPO}/releases/${RELEASE_ID} > release.json - - # Get Asset ids - ids=($(jq -r '.assets[].id' < release.json )) - count=$(jq '.assets|length' < release.json ) - - # Fetch artifacts - mkdir -p "./release-artifacts" - pushd "./release-artifacts" > /dev/null - - iter=1 - for id in "${ids[@]}" - do - echo " - $iter/$count: downloading asset id: $id..." - curl -s -OJ -L -H "Accept: application/octet-stream" \ - -H "Authorization: Token ${GITHUB_TOKEN}" \ - "https://api.github.com/repos/${REPO}/releases/assets/$id" - iter=$((iter + 1)) - done - - pwd - ls -al --color - popd > /dev/null -} - -# Check the checksum for a given binary -function check_sha256() { - echo "Checking SHA256 for $1" - shasum -qc $1.sha256 -} - -# Import GPG keys of the release team members -# This is done in parallel as it can take a while sometimes -function import_gpg_keys() { - GPG_KEYSERVER=${GPG_KEYSERVER:-"keyserver.ubuntu.com"} - SEC="9D4B2B6EB8F97156D19669A9FF0812D491B96798" - WILL="2835EAF92072BC01D188AF2C4A092B93E97CE1E2" - EGOR="E6FC4D4782EB0FA64A4903CCDB7D3555DD3932D3" - MARA="533C920F40E73A21EEB7E9EBF27AEA7E7594C9CF" - MORGAN="2E92A9D8B15D7891363D1AE8AF9E6C43F7F8C4CF" - - echo "Importing GPG keys from $GPG_KEYSERVER in parallel" - for key in $SEC $WILL $EGOR $MARA $MORGAN; do - ( - echo "Importing GPG key $key" - gpg --no-tty --quiet --keyserver $GPG_KEYSERVER --recv-keys $key - echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key $key trust; - ) & - done - wait -} - -# Check the GPG signature for a given binary -function check_gpg() { - echo "Checking GPG Signature for $1" - gpg --no-tty --verify -q $1.asc $1 -} diff --git a/polkadot/scripts/ci/dockerfiles/adder-collator/build-injected.sh b/polkadot/scripts/ci/dockerfiles/adder-collator/build-injected.sh deleted file mode 100755 index 9a1857bc7ab4714d01d5cc337d5444bf85916449..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/adder-collator/build-injected.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Sample call: -# $0 /path/to/folder_with_binary -# This script replace the former dedicated Dockerfile -# and shows how to use the generic binary_injected.dockerfile - -PROJECT_ROOT=`git rev-parse --show-toplevel` - -export BINARY=adder-collator,undying-collator -export BIN_FOLDER=$1 - -$PROJECT_ROOT/scripts/ci/dockerfiles/build-injected.sh diff --git a/polkadot/scripts/ci/dockerfiles/adder-collator/test-build.sh b/polkadot/scripts/ci/dockerfiles/adder-collator/test-build.sh deleted file mode 100755 index 171e0309f807971eaa79133f3de3b8d125787cbe..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/adder-collator/test-build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -TMP=$(mktemp -d) -ENGINE=${ENGINE:-podman} - -# TODO: Switch to /bin/bash when the image is built from parity/base-bin - -# Fetch some binaries -$ENGINE run --user root --rm -i \ - --pull always \ - -v "$TMP:/export" \ - --entrypoint /usr/bin/bash \ - paritypr/colander:master -c \ - 'cp "$(which adder-collator)" /export' - -$ENGINE run --user root --rm -i \ - --pull always \ - -v "$TMP:/export" \ - --entrypoint /usr/bin/bash \ - paritypr/colander:master -c \ - 'cp "$(which undying-collator)" /export' - -./build-injected.sh $TMP diff --git a/polkadot/scripts/ci/dockerfiles/binary_injected.Dockerfile b/polkadot/scripts/ci/dockerfiles/binary_injected.Dockerfile deleted file mode 100644 index cee81a2eb8ae06412109d942b5ca3d322c0cdf1e..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/binary_injected.Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM docker.io/parity/base-bin - -# This file allows building a Generic container image -# based on one or multiple pre-built Linux binaries. -# Some defaults are set to polkadot but all can be overriden. - -SHELL ["/bin/bash", "-c"] - -# metadata -ARG VCS_REF -ARG BUILD_DATE -ARG IMAGE_NAME - -# That can be a single one or a comma separated list -ARG BINARY=polkadot - -ARG BIN_FOLDER=. -ARG DOC_URL=https://github.com/paritytech/polkadot -ARG DESCRIPTION="Polkadot: a platform for web3" -ARG AUTHORS="devops-team@parity.io" -ARG VENDOR="Parity Technologies" - -LABEL io.parity.image.authors=${AUTHORS} \ - io.parity.image.vendor="${VENDOR}" \ - io.parity.image.revision="${VCS_REF}" \ - io.parity.image.title="${IMAGE_NAME}" \ - io.parity.image.created="${BUILD_DATE}" \ - io.parity.image.documentation="${DOC_URL}" \ - io.parity.image.description="${DESCRIPTION}" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/binary_injected.Dockerfile" - -USER root -WORKDIR /app - -# add polkadot binary to docker image -# sample for polkadot: COPY ./polkadot ./polkadot-*-worker /usr/local/bin/ -COPY entrypoint.sh . -COPY "bin/*" "/usr/local/bin/" -RUN chmod -R a+rx "/usr/local/bin" - -USER parity -ENV BINARY=${BINARY} - -# ENTRYPOINT -ENTRYPOINT ["/app/entrypoint.sh"] - -# We call the help by default -CMD ["--help"] diff --git a/polkadot/scripts/ci/dockerfiles/build-injected.sh b/polkadot/scripts/ci/dockerfiles/build-injected.sh deleted file mode 100755 index d0e7fee3646e439343767b8d5ee4645f0061412f..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/build-injected.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -set -e - -# This script allows building a Container Image from a Linux -# binary that is injected into a base-image. - -ENGINE=${ENGINE:-podman} - -if [ "$ENGINE" == "podman" ]; then - PODMAN_FLAGS="--format docker" -else - PODMAN_FLAGS="" -fi - -CONTEXT=$(mktemp -d) -REGISTRY=${REGISTRY:-docker.io} - -# The following line ensure we know the project root -PROJECT_ROOT=${PROJECT_ROOT:-$(git rev-parse --show-toplevel)} -DOCKERFILE=${DOCKERFILE:-$PROJECT_ROOT/scripts/ci/dockerfiles/binary_injected.Dockerfile} -VERSION_TOML=$(grep "^version " $PROJECT_ROOT/Cargo.toml | grep -oE "([0-9\.]+-?[0-9]+)") - -#n The following VAR have default that can be overriden -DOCKER_OWNER=${DOCKER_OWNER:-parity} - -# We may get 1..n binaries, comma separated -BINARY=${BINARY:-polkadot} -IFS=',' read -r -a BINARIES <<< "$BINARY" - -VERSION=${VERSION:-$VERSION_TOML} -BIN_FOLDER=${BIN_FOLDER:-.} - -IMAGE=${IMAGE:-${REGISTRY}/${DOCKER_OWNER}/${BINARIES[0]}} -DESCRIPTION_DEFAULT="Injected Container image built for ${BINARY}" -DESCRIPTION=${DESCRIPTION:-$DESCRIPTION_DEFAULT} - -VCS_REF=${VCS_REF:-01234567} - -# Build the image -echo "Using engine: $ENGINE" -echo "Using Dockerfile: $DOCKERFILE" -echo "Using context: $CONTEXT" -echo "Building ${IMAGE}:latest container image for ${BINARY} v${VERSION} from ${BIN_FOLDER} hang on!" -echo "BIN_FOLDER=$BIN_FOLDER" -echo "CONTEXT=$CONTEXT" - -# We need all binaries and resources available in the Container build "CONTEXT" -mkdir -p $CONTEXT/bin -for bin in "${BINARIES[@]}" -do - echo "Copying $BIN_FOLDER/$bin to context: $CONTEXT/bin" - cp "$BIN_FOLDER/$bin" "$CONTEXT/bin" -done - -cp "$PROJECT_ROOT/scripts/ci/dockerfiles/entrypoint.sh" "$CONTEXT" - -echo "Building image: ${IMAGE}" - -TAGS=${TAGS[@]:-latest} -IFS=',' read -r -a TAG_ARRAY <<< "$TAGS" -TAG_ARGS=" " - -echo "The image ${IMAGE} will be tagged with ${TAG_ARRAY[*]}" -for tag in "${TAG_ARRAY[@]}"; do - TAG_ARGS+="--tag ${IMAGE}:${tag} " -done - -echo "$TAG_ARGS" - -# time \ -$ENGINE build \ - ${PODMAN_FLAGS} \ - --build-arg VCS_REF="${VCS_REF}" \ - --build-arg BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ') \ - --build-arg IMAGE_NAME="${IMAGE}" \ - --build-arg BINARY="${BINARY}" \ - --build-arg BIN_FOLDER="${BIN_FOLDER}" \ - --build-arg DESCRIPTION="${DESCRIPTION}" \ - ${TAG_ARGS} \ - -f "${DOCKERFILE}" \ - ${CONTEXT} - -echo "Your Container image for ${IMAGE} is ready" -$ENGINE images - -if [[ -z "${SKIP_IMAGE_VALIDATION}" ]]; then - echo "Check the image ${IMAGE}:${TAG_ARRAY[0]}" - $ENGINE run --rm -i "${IMAGE}:${TAG_ARRAY[0]}" --version - - echo "Query binaries" - $ENGINE run --rm -i --entrypoint /bin/bash "${IMAGE}:${TAG_ARRAY[0]}" -c 'echo BINARY: $BINARY' -fi diff --git a/polkadot/scripts/ci/dockerfiles/entrypoint.sh b/polkadot/scripts/ci/dockerfiles/entrypoint.sh deleted file mode 100755 index eaa815faf6a45307047f07768826aa44f71afac0..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/entrypoint.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -# Sanity check -if [ -z "$BINARY" ] -then - echo "BINARY ENV not defined, this should never be the case. Aborting..." - exit 1 -fi - -# If the user built the image with multiple binaries, -# we consider the first one to be the canonical one -# To start with another binary, the user can either: -# - use the --entrypoint option -# - pass the ENV BINARY with a single binary -IFS=',' read -r -a BINARIES <<< "$BINARY" -BIN0=${BINARIES[0]} -echo "Starting binary $BIN0" -$BIN0 $@ diff --git a/polkadot/scripts/ci/dockerfiles/malus/build-injected.sh b/polkadot/scripts/ci/dockerfiles/malus/build-injected.sh deleted file mode 100755 index 99bd5fde1d5a87dec433a9662575eaf31f1ccf54..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/malus/build-injected.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Sample call: -# $0 /path/to/folder_with_binary -# This script replace the former dedicated Dockerfile -# and shows how to use the generic binary_injected.dockerfile - -PROJECT_ROOT=`git rev-parse --show-toplevel` - -export BINARY=malus,polkadot-execute-worker,polkadot-prepare-worker -export BIN_FOLDER=$1 -# export TAGS=... - -$PROJECT_ROOT/scripts/ci/dockerfiles/build-injected.sh diff --git a/polkadot/scripts/ci/dockerfiles/malus/test-build.sh b/polkadot/scripts/ci/dockerfiles/malus/test-build.sh deleted file mode 100755 index 3114e9e2adf12c84663568f5fddf91e690621287..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/malus/test-build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -TMP=$(mktemp -d) -ENGINE=${ENGINE:-podman} - -export TAGS=latest,beta,7777,1.0.2-rc23 - -# Fetch some binaries -$ENGINE run --user root --rm -i \ - --pull always \ - -v "$TMP:/export" \ - --entrypoint /bin/bash \ - paritypr/malus:7217 -c \ - 'cp "$(which malus)" /export' - -echo "Checking binaries we got:" -ls -al $TMP - -./build-injected.sh $TMP diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/README.md b/polkadot/scripts/ci/dockerfiles/polkadot/README.md deleted file mode 100644 index e331d8984c2cee5e4b79a851809e303751e3bb57..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Self built Docker image - -The Polkadot repo contains several options to build Docker images for Polkadot. - -This folder contains a self-contained image that does not require a Linux pre-built binary. - -Instead, building the image is possible on any host having docker installed and will -build Polkadot inside Docker. That also means that no Rust toolchain is required on the host -machine for the build to succeed. diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/build-injected.sh b/polkadot/scripts/ci/dockerfiles/polkadot/build-injected.sh deleted file mode 100755 index 22774c7b712244a79503ae96ae87a5fffb7315fd..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/build-injected.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Sample call: -# $0 /path/to/folder_with_binary -# This script replace the former dedicated Dockerfile -# and shows how to use the generic binary_injected.dockerfile - -PROJECT_ROOT=`git rev-parse --show-toplevel` - -export BINARY=polkadot,polkadot-execute-worker,polkadot-prepare-worker -export BIN_FOLDER=$1 - -$PROJECT_ROOT/scripts/ci/dockerfiles/build-injected.sh diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose-local.yml b/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose-local.yml deleted file mode 100644 index 1ff3a1ccaac252b5c8e5230b4584329ce6448865..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose-local.yml +++ /dev/null @@ -1,50 +0,0 @@ -version: '3' -services: - node_alice: - ports: - - "30333:30333" - - "9933:9933" - - "9944:9944" - - "9615:9615" - image: parity/polkadot:latest - volumes: - - "polkadot-data-alice:/data" - command: | - --chain=polkadot-local - --alice - -d /data - --node-key 0000000000000000000000000000000000000000000000000000000000000001 - networks: - testing_net: - ipv4_address: 172.28.1.1 - - node_bob: - ports: - - "30344:30333" - - "9935:9933" - - "9945:9944" - - "29615:9615" - image: parity/polkadot:latest - volumes: - - "polkadot-data-bob:/data" - links: - - "node_alice:alice" - command: | - --chain=polkadot-local - --bob - -d /data - --bootnodes '/ip4/172.28.1.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR' - networks: - testing_net: - ipv4_address: 172.28.1.2 - -volumes: - polkadot-data-alice: - polkadot-data-bob: - -networks: - testing_net: - ipam: - driver: default - config: - - subnet: 172.28.0.0/16 diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose.yml b/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose.yml deleted file mode 100644 index 524b1164796ac3f11f4fe30ec48a98e50e23c90f..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' -services: - polkadot: - image: parity/polkadot:latest - - ports: - - "127.0.0.1:30333:30333/tcp" - - "127.0.0.1:9933:9933/tcp" - - "127.0.0.1:9944:9944/tcp" - - "127.0.0.1:9615:9615/tcp" - - volumes: - - "polkadot-data:/data" - - command: | - --unsafe-rpc-external - --unsafe-ws-external - --rpc-cors all - --prometheus-external - -volumes: - polkadot-data: diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md b/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md deleted file mode 100644 index 7e89cb55f3de5e016362cb50b5a5e5d0cc3e5713..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Polkadot official Docker image - -## [Polkadot](https://polkadot.network/) - -## [GitHub](https://github.com/paritytech/polkadot) - -## [Polkadot Wiki](https://wiki.polkadot.network/) diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile b/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile deleted file mode 100644 index f263c836bbfe780820b0da1a0387f1b6e72be46f..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# This is the build stage for Polkadot. Here we create the binary in a temporary image. -FROM docker.io/paritytech/ci-linux:production as builder - -WORKDIR /polkadot -COPY . /polkadot - -RUN cargo build --locked --release - -# This is the 2nd stage: a very small image where we copy the Polkadot binary." -FROM docker.io/parity/base-bin:latest - -LABEL description="Multistage Docker image for Polkadot: a platform for web3" \ - io.parity.image.type="builder" \ - io.parity.image.authors="chevdor@gmail.com, devops-team@parity.io" \ - io.parity.image.vendor="Parity Technologies" \ - io.parity.image.description="Polkadot: a platform for web3" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile" \ - io.parity.image.documentation="https://github.com/paritytech/polkadot/" - -COPY --from=builder /polkadot/target/release/polkadot /usr/local/bin - -RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ - mkdir -p /data /polkadot/.local/share && \ - chown -R polkadot:polkadot /data && \ - ln -s /data /polkadot/.local/share/polkadot && \ -# unclutter and minimize the attack surface - rm -rf /usr/bin /usr/sbin && \ -# check if executable works in this container - /usr/local/bin/polkadot --version - -USER polkadot - -EXPOSE 30333 9933 9944 9615 -VOLUME ["/data"] - -ENTRYPOINT ["/usr/local/bin/polkadot"] diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile b/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile deleted file mode 100644 index e2c72dcfe2e92411317ce86c0fb965b6246f52ea..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM docker.io/library/ubuntu:20.04 - -# metadata -ARG VCS_REF -ARG BUILD_DATE -ARG POLKADOT_VERSION -ARG POLKADOT_GPGKEY=9D4B2B6EB8F97156D19669A9FF0812D491B96798 -ARG GPG_KEYSERVER="keyserver.ubuntu.com" - -LABEL io.parity.image.authors="devops-team@parity.io" \ - io.parity.image.vendor="Parity Technologies" \ - io.parity.image.title="parity/polkadot" \ - io.parity.image.description="Polkadot: a platform for web3. This is the official Parity image with an injected binary." \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile" \ - io.parity.image.revision="${VCS_REF}" \ - io.parity.image.created="${BUILD_DATE}" \ - io.parity.image.documentation="https://github.com/paritytech/polkadot/" - -# show backtraces -ENV RUST_BACKTRACE 1 - -# install tools and dependencies -RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - libssl1.1 \ - ca-certificates \ - gnupg && \ - useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ -# add repo's gpg keys and install the published polkadot binary - gpg --keyserver ${GPG_KEYSERVER} --recv-keys ${POLKADOT_GPGKEY} && \ - gpg --export ${POLKADOT_GPGKEY} > /usr/share/keyrings/parity.gpg && \ - echo 'deb [signed-by=/usr/share/keyrings/parity.gpg] https://releases.parity.io/deb release main' > /etc/apt/sources.list.d/parity.list && \ - apt-get update && \ - apt-get install -y --no-install-recommends polkadot=${POLKADOT_VERSION#?} && \ -# apt cleanup - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* ; \ - mkdir -p /data /polkadot/.local/share && \ - chown -R polkadot:polkadot /data && \ - ln -s /data /polkadot/.local/share/polkadot - -USER polkadot - -# check if executable works in this container -RUN /usr/bin/polkadot --version -RUN /usr/bin/polkadot-execute-worker --version -RUN /usr/bin/polkadot-prepare-worker --version - -EXPOSE 30333 9933 9944 -VOLUME ["/polkadot"] - -ENTRYPOINT ["/usr/bin/polkadot"] diff --git a/polkadot/scripts/ci/dockerfiles/polkadot/test-build.sh b/polkadot/scripts/ci/dockerfiles/polkadot/test-build.sh deleted file mode 100755 index d2d904561cb559d0dbb6d62e94cefa8d01213a06..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/polkadot/test-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -TMP=$(mktemp -d) -ENGINE=${ENGINE:-podman} - -# You need to build an injected image first - -# Fetch some binaries -$ENGINE run --user root --rm -i \ - -v "$TMP:/export" \ - --entrypoint /bin/bash \ - parity/polkadot -c \ - 'cp "$(which polkadot)" /export' - -echo "Checking binaries we got:" -tree $TMP - -./build-injected.sh $TMP diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/README.md b/polkadot/scripts/ci/dockerfiles/staking-miner/README.md deleted file mode 100644 index 3610e11303167b1b3b8deb4ef2a9c37a60c77a1f..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# staking-miner container image - -## Build using the Builder - -``` -./build.sh -``` - -## Build the injected Image - -You first need a valid Linux binary to inject. Let's assume this binary is located in `BIN_FOLDER`. - -``` -./build-injected.sh "$BIN_FOLDER" -``` - -## Test - -Here is how to test the image. We can generate a valid seed but the staking-miner will quickly notice that our -account is not funded and "does not exist". - -You may pass any ENV supported by the binary and must provide at least a few such as `SEED` and `URI`: -``` -ENV SEED="" -ENV URI="wss://rpc.polkadot.io:443" -ENV RUST_LOG="info" -``` - -``` -export SEED=$(subkey generate -n polkadot --output-type json | jq -r .secretSeed) -podman run --rm -it \ - -e URI="wss://rpc.polkadot.io:443" \ - -e RUST_LOG="info" \ - -e SEED \ - localhost/parity/staking-miner \ - dry-run seq-phragmen -``` diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/build-injected.sh b/polkadot/scripts/ci/dockerfiles/staking-miner/build-injected.sh deleted file mode 100755 index 536636df6a918d252af9db49bed0fed8b493d473..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/build-injected.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Sample call: -# $0 /path/to/folder_with_staking-miner_binary -# This script replace the former dedicated staking-miner "injected" Dockerfile -# and shows how to use the generic binary_injected.dockerfile - -PROJECT_ROOT=`git rev-parse --show-toplevel` - -export BINARY=staking-miner -export BIN_FOLDER=$1 - -$PROJECT_ROOT/scripts/ci/dockerfiles/build-injected.sh diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/build.sh b/polkadot/scripts/ci/dockerfiles/staking-miner/build.sh deleted file mode 100755 index 67c82afcd2ce52ea002ef4df8761e471f5d9d10b..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Sample call: -# $0 /path/to/folder_with_staking-miner_binary -# This script replace the former dedicated staking-miner "injected" Dockerfile -# and shows how to use the generic binary_injected.dockerfile - -PROJECT_ROOT=`git rev-parse --show-toplevel` -ENGINE=podman - -echo "Building the staking-miner using the Builder image" -echo "PROJECT_ROOT=$PROJECT_ROOT" -$ENGINE build -t staking-miner -f staking-miner_builder.Dockerfile "$PROJECT_ROOT" diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_Dockerfile.README.md b/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_Dockerfile.README.md deleted file mode 100644 index ce424c42f479a657191fb412a476fa04e1430b03..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_Dockerfile.README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Staking-miner Docker image - -## [GitHub](https://github.com/paritytech/polkadot/tree/master/utils/staking-miner) diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_builder.Dockerfile b/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_builder.Dockerfile deleted file mode 100644 index 0ae77f36c79d0888c29c2f8211b21fc120db6037..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/staking-miner_builder.Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM paritytech/ci-linux:production as builder - -# metadata -ARG VCS_REF -ARG BUILD_DATE -ARG IMAGE_NAME="staking-miner" -ARG PROFILE=production - -LABEL description="This is the build stage. Here we create the binary." - -WORKDIR /app -COPY . /app -RUN cargo build --locked --profile $PROFILE --package staking-miner - -# ===== SECOND STAGE ====== - -FROM docker.io/parity/base-bin:latest -LABEL description="This is the 2nd stage: a very small image where we copy the binary." -LABEL io.parity.image.authors="devops-team@parity.io" \ - io.parity.image.vendor="Parity Technologies" \ - io.parity.image.title="${IMAGE_NAME}" \ - io.parity.image.description="${IMAGE_NAME} for substrate based chains" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/${IMAGE_NAME}/${IMAGE_NAME}_builder.Dockerfile" \ - io.parity.image.revision="${VCS_REF}" \ - io.parity.image.created="${BUILD_DATE}" \ - io.parity.image.documentation="https://github.com/paritytech/polkadot/" - -ARG PROFILE=release -COPY --from=builder /app/target/$PROFILE/staking-miner /usr/local/bin - -# show backtraces -ENV RUST_BACKTRACE 1 - -USER parity - -ENV SEED="" -ENV URI="wss://rpc.polkadot.io" -ENV RUST_LOG="info" - -# check if the binary works in this container -RUN /usr/local/bin/staking-miner --version - -ENTRYPOINT [ "/usr/local/bin/staking-miner" ] diff --git a/polkadot/scripts/ci/dockerfiles/staking-miner/test-build.sh b/polkadot/scripts/ci/dockerfiles/staking-miner/test-build.sh deleted file mode 100755 index 0ce74e2df296d267bdc1f4daba701ca57acdbaa1..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/dockerfiles/staking-miner/test-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -TMP=$(mktemp -d) -ENGINE=${ENGINE:-podman} - -# You need to build an injected image first - -# Fetch some binaries -$ENGINE run --user root --rm -i \ - -v "$TMP:/export" \ - --entrypoint /bin/bash \ - parity/staking-miner -c \ - 'cp "$(which staking-miner)" /export' - -echo "Checking binaries we got:" -tree $TMP - -./build-injected.sh $TMP diff --git a/polkadot/scripts/ci/github/check-rel-br b/polkadot/scripts/ci/github/check-rel-br deleted file mode 100755 index 1b49ae621722a42d9adbb7f018ff66ee0e935762..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/check-rel-br +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env bash - -# This script helps running sanity checks on a release branch -# It is intended to be ran from the repo and from the release branch - -# NOTE: The diener runs do take time and are not really required because -# if we missed the diener runs, the Cargo.lock that we check won't pass -# the tests. See https://github.com/bkchr/diener/issues/17 - -grv=$(git remote --verbose | grep push) -export RUST_LOG=none -REPO=$(echo "$grv" | cut -d ' ' -f1 | cut -d$'\t' -f2 | sed 's/.*github.com\/\(.*\)/\1/g' | cut -d '/' -f2 | cut -d '.' -f1 | sort | uniq) -echo "[+] Detected repo: $REPO" - -BRANCH=$(git branch --show-current) -if ! [[ "$BRANCH" =~ ^release.*$ || "$BRANCH" =~ ^polkadot.*$ ]]; then - echo "This script is meant to run only on a RELEASE branch." - echo "Try one of the following branch:" - git branch -r --format "%(refname:short)" --sort=-committerdate | grep -Ei '/?release' | head - exit 1 -fi -echo "[+] Working on $BRANCH" - -# Tried to get the version of the release from the branch -# input: release-foo-v0.9.22 or release-bar-v9220 or release-foo-v0.9.220 -# output: 0.9.22 -get_version() { - branch=$1 - [[ $branch =~ -v(.*) ]] - version=${BASH_REMATCH[1]} - if [[ $version =~ \. ]]; then - MAJOR=$(($(echo $version | cut -d '.' -f1))) - MINOR=$(($(echo $version | cut -d '.' -f2))) - PATCH=$(($(echo $version | cut -d '.' -f3))) - echo $MAJOR.$MINOR.${PATCH:0:2} - else - MAJOR=$(echo $(($version / 100000))) - remainer=$(($version - $MAJOR * 100000)) - MINOR=$(echo $(($remainer / 1000))) - remainer=$(($remainer - $MINOR * 1000)) - PATCH=$(echo $(($remainer / 10))) - echo $MAJOR.$MINOR.$PATCH - fi -} - -# return the name of the release branch for a given repo and version -get_release_branch() { - repo=$1 - version=$2 - case $repo in - polkadot) - echo "release-v$version" - ;; - - substrate) - echo "polkadot-v$version" - ;; - - *) - echo "Repo $repo is not supported, exiting" - exit 1 - ;; - esac -} - -# repo = substrate / polkadot -check_release_branch_repo() { - repo=$1 - branch=$2 - - echo "[+] Checking deps for $repo=$branch" - - POSTIVE=$(cat Cargo.lock | grep "$repo?branch=$branch" | sort | uniq | wc -l) - NEGATIVE=$(cat Cargo.lock | grep "$repo?branch=" | grep -v $branch | sort | uniq | wc -l) - - if [[ $POSTIVE -eq 1 && $NEGATIVE -eq 0 ]]; then - echo -e "[+] ✅ Looking good" - cat Cargo.lock | grep "$repo?branch=" | sort | uniq | sed 's/^/\t - /' - return 0 - else - echo -e "[+] ❌ Something seems to be wrong, we want 1 unique match and 0 non match (1, 0) and we got ($(($POSTIVE)), $(($NEGATIVE)))" - cat Cargo.lock | grep "$repo?branch=" | sort | uniq | sed 's/^/\t - /' - return 1 - fi -} - -# Check a release branch -check_release_branches() { - SUBSTRATE_BRANCH=$1 - POLKADOT_BRANCH=$2 - - check_release_branch_repo substrate $SUBSTRATE_BRANCH - ret_a1=$? - - ret_b1=0 - if [ $POLKADOT_BRANCH ]; then - check_release_branch_repo polkadot $POLKADOT_BRANCH - ret_b1=$? - fi - - STATUS=$(($ret_a1 + $ret_b1)) - - return $STATUS -} - -VERSION=$(get_version $BRANCH) -echo "[+] Target version: v$VERSION" - -case $REPO in - polkadot) - substrate=$(get_release_branch substrate $VERSION) - - check_release_branches $substrate - ;; - - cumulus) - polkadot=$(get_release_branch polkadot $VERSION) - substrate=$(get_release_branch substrate $VERSION) - - check_release_branches $substrate $polkadot - ;; - - *) - echo "REPO $REPO is not supported, exiting" - exit 1 - ;; -esac diff --git a/polkadot/scripts/ci/github/check_bootnodes.sh b/polkadot/scripts/ci/github/check_bootnodes.sh deleted file mode 100755 index f98a58cda2c846e0538d54c03c8bee998fba1261..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/check_bootnodes.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -# In this script, we check each bootnode for a given chainspec file and ensure they are contactable. -# We do this by removing every bootnode from the chainspec with the exception of the one -# we want to check. Then we spin up a node using this new chainspec, wait a little while -# and then check our local node's RPC endpoint for the number of peers. If the node hasn't -# been able to contact any other nodes, we can reason that the bootnode we used is not well-connected -# or is otherwise uncontactable. - -# shellcheck source=scripts/ci/common/lib.sh -source "$(dirname "${0}")/../common/lib.sh" -CHAINSPEC_FILE="$1" -RUNTIME=$(basename "$CHAINSPEC_FILE" | cut -d '.' -f 1) - -trap cleanup EXIT INT TERM - -cleanup(){ - echo "[+] Script interrupted or ended. Cleaning up..." - # Kill all the polkadot processes - killall polkadot > /dev/null 2>&1 - exit $1 -} - -# count the number of bootnodes -BOOTNODES=$( jq -r '.bootNodes | length' "$CHAINSPEC_FILE" ) -# Make a temporary dir for chainspec files -# Store an array of the bad bootnodes -BAD_BOOTNODES=() -GOOD_BOOTNODES=() -PIDS=() - -echo "[+] Checking $BOOTNODES bootnodes for $RUNTIME" -for i in $(seq 0 $((BOOTNODES-1))); do - BOOTNODE=$( jq -r .bootNodes["$i"] < "$CHAINSPEC_FILE" ) - # Check each bootnode in parallel - check_bootnode "$BOOTNODE" "$CHAINSPEC_FILE" & - PIDS+=($!) - # Hold off 5 seconds between attempting to spawn nodes to stop the machine from getting overloaded - sleep 5 -done -RESPS=() -# Wait for all the nodes to finish -for pid in "${PIDS[@]}"; do - wait "$pid" - RESPS+=($?) -done -echo -# For any bootnodes that failed, add them to the bad bootnodes array -for i in "${!RESPS[@]}"; do - if [ "${RESPS[$i]}" -ne 0 ]; then - BAD_BOOTNODES+=("$( jq -r .bootNodes["$i"] < "$CHAINSPEC_FILE" )") - fi -done -# For any bootnodes that succeeded, add them to the good bootnodes array -for i in "${!RESPS[@]}"; do - if [ "${RESPS[$i]}" -eq 0 ]; then - GOOD_BOOTNODES+=("$( jq -r .bootNodes["$i"] < "$CHAINSPEC_FILE" )") - fi -done - -# If we've got any uncontactable bootnodes for this runtime, print them -if [ ${#BAD_BOOTNODES[@]} -gt 0 ]; then - echo "[!] Bad bootnodes found for $RUNTIME:" - for i in "${BAD_BOOTNODES[@]}"; do - echo " $i" - done - cleanup 1 -else - echo "[+] All bootnodes for $RUNTIME are contactable" - cleanup 0 -fi diff --git a/polkadot/scripts/ci/github/check_labels.sh b/polkadot/scripts/ci/github/check_labels.sh deleted file mode 100755 index 12f07b3495e3bb59fda9142aaa1af6ce38925114..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/check_labels.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -repo="$GITHUB_REPOSITORY" -pr="$GITHUB_PR" - -ensure_labels() { - for label in "$@"; do - if has_label "$repo" "$pr" "$label"; then - return 0 - fi - done - return 1 -} - -# Must have one of the following labels -releasenotes_labels=( - 'B0-silent' - 'B1-releasenotes' - 'B7-runtimenoteworthy' -) - -# Must be an ordered list of priorities, lowest first -priority_labels=( - 'C1-low 📌' - 'C3-medium 📣' - 'C7-high ❗️' - 'C9-critical ‼️' -) - -audit_labels=( - 'D1-audited 👍' - 'D2-notlive 💤' - 'D3-trivial 🧸' - 'D5-nicetohaveaudit ⚠️' - 'D9-needsaudit 👮' -) - -echo "[+] Checking release notes (B) labels for $CI_COMMIT_BRANCH" -if ensure_labels "${releasenotes_labels[@]}"; then - echo "[+] Release notes label detected. All is well." -else - echo "[!] Release notes label not detected. Please add one of: ${releasenotes_labels[*]}" - exit 1 -fi - -echo "[+] Checking release priority (C) labels for $CI_COMMIT_BRANCH" -if ensure_labels "${priority_labels[@]}"; then - echo "[+] Release priority label detected. All is well." -else - echo "[!] Release priority label not detected. Please add one of: ${priority_labels[*]}" - exit 1 -fi - -if has_runtime_changes "${BASE_SHA}" "${HEAD_SHA}"; then - echo "[+] Runtime changes detected. Checking audit (D) labels" - if ensure_labels "${audit_labels[@]}"; then - echo "[+] Release audit label detected. All is well." - else - echo "[!] Release audit label not detected. Please add one of: ${audit_labels[*]}" - exit 1 - fi -fi - -# If the priority is anything other than the lowest, we *must not* have a B0-silent -# label -if has_label "$repo" "$GITHUB_PR" 'B0-silent' && - ! has_label "$repo" "$GITHUB_PR" "${priority_labels[0]}"; then - echo "[!] Changes with a priority higher than C1-low *MUST* have a B- label that is not B0-Silent" - exit 1 -fi - -exit 0 diff --git a/polkadot/scripts/ci/github/check_new_bootnodes.sh b/polkadot/scripts/ci/github/check_new_bootnodes.sh deleted file mode 100755 index 604db6a4e367b6377bf802070c442c38208266af..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/check_new_bootnodes.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -set -e -# shellcheck source=scripts/ci/common/lib.sh -source "$(dirname "${0}")/../common/lib.sh" - -# This script checks any new bootnodes added since the last git commit - -RUNTIMES=( kusama westend polkadot ) - -WAS_ERROR=0 - -for RUNTIME in "${RUNTIMES[@]}"; do - CHAINSPEC_FILE="node/service/chain-specs/$RUNTIME.json" - # Get the bootnodes from master's chainspec - git show origin/master:"$CHAINSPEC_FILE" | jq '{"oldNodes": .bootNodes}' > "$RUNTIME-old-bootnodes.json" - # Get the bootnodes from the current branch's chainspec - git show HEAD:"$CHAINSPEC_FILE" | jq '{"newNodes": .bootNodes}' > "$RUNTIME-new-bootnodes.json" - # Make a chainspec containing only the new bootnodes - jq ".bootNodes = $(jq -rs '.[0] * .[1] | .newNodes-.oldNodes' \ - "$RUNTIME-new-bootnodes.json" "$RUNTIME-old-bootnodes.json")" \ - < "node/service/chain-specs/$RUNTIME.json" \ - > "$RUNTIME-new-chainspec.json" - # exit early if the new chainspec has no bootnodes - if [ "$(jq -r '.bootNodes | length' "$RUNTIME-new-chainspec.json")" -eq 0 ]; then - echo "[+] No new bootnodes for $RUNTIME" - # Clean up the temporary files - rm "$RUNTIME-new-chainspec.json" "$RUNTIME-old-bootnodes.json" "$RUNTIME-new-bootnodes.json" - continue - fi - # Check the new bootnodes - if ! "scripts/ci/github/check_bootnodes.sh" "$RUNTIME-new-chainspec.json"; then - WAS_ERROR=1 - fi - # Clean up the temporary files - rm "$RUNTIME-new-chainspec.json" "$RUNTIME-old-bootnodes.json" "$RUNTIME-new-bootnodes.json" -done - - -if [ $WAS_ERROR -eq 1 ]; then - echo "[!] One of the new bootnodes failed to connect. Please check logs above." - exit 1 -fi diff --git a/polkadot/scripts/ci/github/check_weights_swc.sh b/polkadot/scripts/ci/github/check_weights_swc.sh deleted file mode 100755 index 35652f4fde83690e78f4d1d4e47f4e333b3fc2fe..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/check_weights_swc.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# Need to set globstar for ** magic -shopt -s globstar - -RUNTIME=$1 -VERSION=$2 -echo "
" -echo "Weight changes for $RUNTIME" -echo -swc compare commits \ - --method asymptotic \ - --offline \ - --path-pattern "./runtime/$RUNTIME/src/weights/**/*.rs" \ - --no-color \ - --format markdown \ - --strip-path-prefix "runtime/$RUNTIME/src/weights/" \ - "$VERSION" - #--ignore-errors -echo -echo "
" diff --git a/polkadot/scripts/ci/github/extrinsic-ordering-filter.sh b/polkadot/scripts/ci/github/extrinsic-ordering-filter.sh deleted file mode 100755 index 4fd3337f64a6e9ea93848685cdf2fbac8b0340e7..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/extrinsic-ordering-filter.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -# This script is used in a Github Workflow. It helps filtering out what is interesting -# when comparing metadata and spot what would require a tx version bump. - -# shellcheck disable=SC2002,SC2086 - -FILE=$1 - -# Higlight indexes that were deleted -function find_deletions() { - echo "\n## Deletions\n" - RES=$(cat "$FILE" | grep -n '\[\-\]' | tr -s " ") - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' - else - echo "n/a" - fi -} - -# Highlight indexes that have been deleted -function find_index_changes() { - echo "\n## Index changes\n" - RES=$(cat "$FILE" | grep -E -n -i 'idx:\s*([0-9]+)\s*(->)\s*([0-9]+)' | tr -s " ") - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' - else - echo "n/a" - fi -} - -# Highlight values that decreased -function find_decreases() { - echo "\n## Decreases\n" - OUT=$(cat "$FILE" | grep -E -i -o '([0-9]+)\s*(->)\s*([0-9]+)' | awk '$1 > $3 { printf "%s;", $0 }') - IFS=$';' LIST=("$OUT") - unset RES - for line in "${LIST[@]}"; do - RES="$RES\n$(cat "$FILE" | grep -E -i -n \"$line\" | tr -s " ")" - done - - if [ "$RES" ]; then - echo "$RES" | awk '{ printf "%s\\n", $0 }' | sort -u -g | uniq - else - echo "n/a" - fi -} - -echo "\n------------------------------ SUMMARY -------------------------------" -echo "\n⚠️ This filter is here to help spotting changes that should be reviewed carefully." -echo "\n⚠️ It catches only index changes, deletions and value decreases". - -find_deletions "$FILE" -find_index_changes "$FILE" -find_decreases "$FILE" -echo "\n----------------------------------------------------------------------\n" diff --git a/polkadot/scripts/ci/github/generate_release_text.rb b/polkadot/scripts/ci/github/generate_release_text.rb deleted file mode 100644 index 83b3853a342d1e7a2570276a3b2eb526a79090a5..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/generate_release_text.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -require 'base64' -require 'changelogerator' -require 'erb' -require 'git' -require 'json' -require 'octokit' -require 'toml' -require_relative './lib.rb' - -# A logger only active when NOT running in CI -def logger(s) - puts "▶ DEBUG: %s" % [s] if ENV['CI'] != 'true' -end - -# Check if all the required ENV are set -# This is especially convenient when testing locally -def check_env() - if ENV['CI'] != 'true' then - logger("Running locally") - vars = ['GITHUB_REF', 'GITHUB_TOKEN', 'GITHUB_WORKSPACE', 'GITHUB_REPOSITORY', 'RUSTC_STABLE', 'RUSTC_NIGHTLY'] - vars.each { |x| - env = (ENV[x] || "") - if env.length > 0 then - logger("- %s:\tset: %s, len: %d" % [x, env.length > 0 || false, env.length]) - else - logger("- %s:\tset: %s, len: %d" % [x, env.length > 0 || false, env.length]) - end - } - end -end - -check_env() - -current_ref = ENV['GITHUB_REF'] -token = ENV['GITHUB_TOKEN'] - -logger("Connecting to Github") -github_client = Octokit::Client.new( - access_token: token -) - -polkadot_path = ENV['GITHUB_WORKSPACE'] + '/polkadot/' - -# Generate an ERB renderer based on the template .erb file -renderer = ERB.new( - File.read(File.join(polkadot_path, 'scripts/ci/github/polkadot_release.erb')), - trim_mode: '<>' -) - -# get ref of last polkadot release -last_ref = 'refs/tags/' + github_client.latest_release(ENV['GITHUB_REPOSITORY']).tag_name -logger("Last ref: " + last_ref) - -logger("Generate changelog for Polkadot") -polkadot_cl = Changelog.new( - 'paritytech/polkadot', last_ref, current_ref, token: token -) - -# Gets the substrate commit hash used for a given polkadot ref -def get_substrate_commit(client, ref) - cargo = TOML::Parser.new( - Base64.decode64( - client.contents( - ENV['GITHUB_REPOSITORY'], - path: 'Cargo.lock', - query: { ref: ref.to_s } - ).content - ) - ).parsed - cargo['package'].find { |p| p['name'] == 'sc-cli' }['source'].split('#').last -end - -substrate_prev_sha = get_substrate_commit(github_client, last_ref) -substrate_cur_sha = get_substrate_commit(github_client, current_ref) - -logger("Generate changelog for Substrate") -substrate_cl = Changelog.new( - 'paritytech/substrate', substrate_prev_sha, substrate_cur_sha, - token: token, - prefix: true -) - -# Combine all changes into a single array and filter out companions -all_changes = (polkadot_cl.changes + substrate_cl.changes).reject do |c| - c[:title] =~ /[Cc]ompanion/ -end - -# Set all the variables needed for a release - -misc_changes = Changelog.changes_with_label(all_changes, 'B1-releasenotes') -client_changes = Changelog.changes_with_label(all_changes, 'B5-clientnoteworthy') -runtime_changes = Changelog.changes_with_label(all_changes, 'B7-runtimenoteworthy') - -# Add the audit status for runtime changes -runtime_changes.each do |c| - if c[:labels].any? { |l| l[:name] == 'D1-audited 👍' } - c[:pretty_title] = "✅ `audited` #{c[:pretty_title]}" - next - end - if c[:labels].any? { |l| l[:name] == 'D2-notlive 💤' } - c[:pretty_title] = "✅ `not live` #{c[:pretty_title]}" - next - end - if c[:labels].any? { |l| l[:name] == 'D3-trivial 🧸' } - c[:pretty_title] = "✅ `trivial` #{c[:pretty_title]}" - next - end - if c[:labels].any? { |l| l[:name] == 'D5-nicetohaveaudit ⚠️' } - c[:pretty_title] = "⏳ `pending non-critical audit` #{c[:pretty_title]}" - next - end - if c[:labels].any? { |l| l[:name] == 'D9-needsaudit 👮' } - c[:pretty_title] = "❌ `AWAITING AUDIT` #{c[:pretty_title]}" - next - end - c[:pretty_title] = "⭕️ `unknown audit requirements` #{c[:pretty_title]}" -end - -# The priority of users upgraded is determined by the highest-priority -# *Client* change -release_priority = Changelog.highest_priority_for_changes(client_changes) - -# Pulled from the previous Github step -rustc_stable = ENV['RUSTC_STABLE'] -rustc_nightly = ENV['RUSTC_NIGHTLY'] -polkadot_runtime = get_runtime('polkadot', polkadot_path) -kusama_runtime = get_runtime('kusama', polkadot_path) -westend_runtime = get_runtime('westend', polkadot_path) -rococo_runtime = get_runtime('rococo', polkadot_path) - -# These json files should have been downloaded as part of the build-runtimes -# github action - -polkadot_json = JSON.parse( - File.read( - "#{ENV['GITHUB_WORKSPACE']}/polkadot-srtool-json/polkadot_srtool_output.json" - ) -) - -kusama_json = JSON.parse( - File.read( - "#{ENV['GITHUB_WORKSPACE']}/kusama-srtool-json/kusama_srtool_output.json" - ) -) - -puts renderer.result diff --git a/polkadot/scripts/ci/github/lib.rb b/polkadot/scripts/ci/github/lib.rb deleted file mode 100644 index 14663acaf31a32c739243c445d41a7f3d3774074..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/lib.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -# Gets the runtime version for a given runtime from the filesystem. -# Optionally accepts a path that is the root of the project which defaults to -# the current working directory -def get_runtime(runtime: nil, path: '.', runtime_dir: 'runtime') - File.open(path + "/#{runtime_dir}/#{runtime}/src/lib.rs") do |f| - f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0] - end -end diff --git a/polkadot/scripts/ci/github/polkadot_release.erb b/polkadot/scripts/ci/github/polkadot_release.erb deleted file mode 100644 index 3fcf07dddc5c61dccf22eab54ba4efe9246a4cae..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/polkadot_release.erb +++ /dev/null @@ -1,42 +0,0 @@ -<%= print release_priority[:text] %> <%= puts " due to changes: *#{Changelog.changes_with_label(all_changes, release_priority[:label]).map(&:pretty_title).join(", ")}*" if release_priority[:priority] > 1 %> - -Native runtimes: - -- Polkadot: **<%= polkadot_runtime %>** -- Kusama: **<%= kusama_runtime %>** -- Westend: **<%= westend_runtime %>** - -This release was tested against the following versions of `rustc`. Other versions may work. - -- <%= rustc_stable %> -- <%= rustc_nightly %> - -WASM runtimes built with [<%= polkadot_json['info']['generator']['name'] %> v<%= polkadot_json['info']['generator']['version'] %>](https://github.com/paritytech/srtool) using `<%= polkadot_json['rustc'] %>`. - -Proposal hashes: -* `polkadot_runtime-v<%= polkadot_runtime %>.compact.compressed.wasm`: `<%= polkadot_json['runtimes']['compressed']['prop'] %>` -* `kusama_runtime-v<%= kusama_runtime %>.compact.compressed.wasm`: `<%= kusama_json['runtimes']['compressed']['prop'] %>` - -<% unless misc_changes.empty? %> -## Changes - -<% misc_changes.each do |c| %> -* <%= c[:pretty_title] %> -<% end %> -<% end %> - -<% unless client_changes.empty? %> -## Client - -<% client_changes.each do |c| %> -* <%= c[:pretty_title] %> -<% end %> -<% end %> - -<% unless runtime_changes.empty? %> -## Runtime - -<% runtime_changes.each do |c| %> -* <%= c[:pretty_title] %> -<% end %> -<% end %> diff --git a/polkadot/scripts/ci/github/run_fuzzer.sh b/polkadot/scripts/ci/github/run_fuzzer.sh deleted file mode 100755 index b73a83beab91ff1219c1b82e9aeb7f9b40ebcb2c..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/run_fuzzer.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -timeout --signal INT 5h cargo hfuzz run $1 -status=$? - -if [ $status -ne 124 ]; then - echo "Found a panic!" - # TODO: provide Minimal Reproducible Input - # TODO: message on Matrix - exit 1 -else - echo "Didn't find any problem in 5 hours of fuzzing" -fi diff --git a/polkadot/scripts/ci/github/verify_updated_weights.sh b/polkadot/scripts/ci/github/verify_updated_weights.sh deleted file mode 100755 index 54db1de21ca00af1bff26b9fdb22932578e3f511..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/github/verify_updated_weights.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -ROOT="$(dirname "$0")/../../.." -RUNTIME="$1" - -# If we're on a mac, use gdate for date command (requires coreutils installed via brew) -if [[ "$OSTYPE" == "darwin"* ]]; then - DATE="gdate" -else - DATE="date" -fi - -function check_date() { - # Get the dates as input arguments - LAST_RUN="$1" - TODAY="$($DATE +%Y-%m-%d)" - # Calculate the date two days before today - CUTOFF=$($DATE -d "$TODAY - 2 days" +%Y-%m-%d) - - if [[ "$LAST_RUN" > "$CUTOFF" ]]; then - return 0 - else - return 1 - fi -} - -check_weights(){ - FILE=$1 - CUR_DATE=$2 - DATE_REGEX='[0-9]{4}-[0-9]{2}-[0-9]{2}' - LAST_UPDATE="$(grep -E "//! DATE: $DATE_REGEX" "$FILE" | sed -r "s/.*DATE: ($DATE_REGEX).*/\1/")" - # If the file does not contain a date, flag it as an error. - if [ -z "$LAST_UPDATE" ]; then - echo "Skipping $FILE, no date found." - return 0 - fi - if ! check_date "$LAST_UPDATE" ; then - echo "ERROR: $FILE was not updated for the current date. Last update: $LAST_UPDATE" - return 1 - fi - # echo "OK: $FILE" -} - -echo "Checking weights for $RUNTIME" -CUR_DATE="$(date +%Y-%m-%d)" -HAS_ERROR=0 -for FILE in "$ROOT"/runtime/"$RUNTIME"/src/weights/*.rs; do - if ! check_weights "$FILE" "$CUR_DATE"; then - HAS_ERROR=1 - fi -done - -if [ $HAS_ERROR -eq 1 ]; then - echo "ERROR: One or more weights files were not updated during the last benchmark run. Check the logs above." - exit 1 -fi \ No newline at end of file diff --git a/polkadot/scripts/ci/gitlab/check_extrinsics_ordering.sh b/polkadot/scripts/ci/gitlab/check_extrinsics_ordering.sh deleted file mode 100755 index 8a7385f03f9f2347e4c66f2f12d7803cde0ff184..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/check_extrinsics_ordering.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Include the common functions library -#shellcheck source=../common/lib.sh -. "$(dirname "${0}")/../common/lib.sh" - -HEAD_BIN=./artifacts/polkadot -HEAD_WS=ws://localhost:9944 -RELEASE_WS=ws://localhost:9945 - -runtimes=( - "westend" - "kusama" - "polkadot" -) - -# First we fetch the latest released binary -latest_release=$(latest_release 'paritytech/polkadot') -RELEASE_BIN="./polkadot-$latest_release" -echo "[+] Fetching binary for Polkadot version $latest_release" -curl -L "https://github.com/paritytech/polkadot/releases/download/$latest_release/polkadot" > "$RELEASE_BIN" || exit 1 -chmod +x "$RELEASE_BIN" - - -for RUNTIME in "${runtimes[@]}"; do - echo "[+] Checking runtime: ${RUNTIME}" - - release_transaction_version=$( - git show "origin/release:runtime/${RUNTIME}/src/lib.rs" | \ - grep 'transaction_version' - ) - - current_transaction_version=$( - grep 'transaction_version' "./runtime/${RUNTIME}/src/lib.rs" - ) - - echo "[+] Release: ${release_transaction_version}" - echo "[+] Ours: ${current_transaction_version}" - - if [ ! "$release_transaction_version" = "$current_transaction_version" ]; then - echo "[+] Transaction version for ${RUNTIME} has been bumped since last release." - exit 0 - fi - - # Start running the nodes in the background - $HEAD_BIN --chain="$RUNTIME-local" --tmp & - $RELEASE_BIN --chain="$RUNTIME-local" --ws-port 9945 --tmp & - jobs - - # Sleep a little to allow the nodes to spin up and start listening - TIMEOUT=5 - for i in $(seq $TIMEOUT); do - sleep 1 - if [ "$(lsof -nP -iTCP -sTCP:LISTEN | grep -c '994[45]')" == 2 ]; then - echo "[+] Both nodes listening" - break - fi - if [ "$i" == $TIMEOUT ]; then - echo "[!] Both nodes not listening after $i seconds. Exiting" - exit 1 - fi - done - sleep 5 - - changed_extrinsics=$( - polkadot-js-metadata-cmp "$RELEASE_WS" "$HEAD_WS" \ - | sed 's/^ \+//g' | grep -e 'idx: [0-9]\+ -> [0-9]\+' || true - ) - - if [ -n "$changed_extrinsics" ]; then - echo "[!] Extrinsics indexing/ordering has changed in the ${RUNTIME} runtime! If this change is intentional, please bump transaction_version in lib.rs. Changed extrinsics:" - echo "$changed_extrinsics" - exit 1 - fi - - echo "[+] No change in extrinsics ordering for the ${RUNTIME} runtime" - jobs -p | xargs kill; sleep 5 -done - -# Sleep a little to let the jobs die properly -sleep 5 diff --git a/polkadot/scripts/ci/gitlab/check_runtime.sh b/polkadot/scripts/ci/gitlab/check_runtime.sh deleted file mode 100755 index 9618bbfa1c769a8e56e4bbef50b52f9f917e49a2..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/check_runtime.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/env bash - -# Check for any changes in any runtime directories (e.g., ^runtime/polkadot) as -# well as directories common to all runtimes (e.g., ^runtime/common). If there -# are no changes, check if the Substrate git SHA in Cargo.lock has been -# changed. If so, pull the repo and verify if {spec,impl}_versions have been -# altered since the previous Substrate version used. -# -# If there were changes to any runtimes or common dirs, we iterate over each -# runtime (defined in the $runtimes() array), and check if {spec,impl}_version -# have been changed since the last release. - -set -e # fail on any error - -#Include the common functions library -#shellcheck source=../common/lib.sh -. "$(dirname "${0}")/../common/lib.sh" - -SUBSTRATE_REPO="https://github.com/paritytech/substrate" -SUBSTRATE_REPO_CARGO="git\+${SUBSTRATE_REPO}" -SUBSTRATE_VERSIONS_FILE="bin/node/runtime/src/lib.rs" - -# figure out the latest release tag -boldprint "make sure we have all tags (including those from the release branch)" -git fetch --depth="${GIT_DEPTH:-100}" origin release -git fetch --depth="${GIT_DEPTH:-100}" origin 'refs/tags/*:refs/tags/*' -LATEST_TAG="$(git tag -l | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-?[0-9]*$' | sort -V | tail -n 1)" -boldprint "latest release tag ${LATEST_TAG}" - -boldprint "latest 10 commits of ${CI_COMMIT_REF_NAME}" -git --no-pager log --graph --oneline --decorate=short -n 10 - -boldprint "make sure the master branch is available in shallow clones" -git fetch --depth="${GIT_DEPTH:-100}" origin master - - -runtimes=( - "kusama" - "polkadot" - "westend" - "rococo" -) - -common_dirs=( - "common" -) - -# Helper function to join elements in an array with a multi-char delimiter -# https://stackoverflow.com/questions/1527049/how-can-i-join-elements-of-an-array-in-bash -function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; } - -boldprint "check if the wasm sources changed since ${LATEST_TAG}" -if ! has_runtime_changes "${LATEST_TAG}" "${CI_COMMIT_SHA}"; then - boldprint "no changes to any runtime source code detected" - # continue checking if Cargo.lock was updated with a new substrate reference - # and if that change includes a {spec|impl}_version update. - - SUBSTRATE_REFS_CHANGED="$( - git diff "refs/tags/${LATEST_TAG}...${CI_COMMIT_SHA}" Cargo.lock \ - | sed -n -r "s~^[\+\-]source = \"${SUBSTRATE_REPO_CARGO}#([a-f0-9]+)\".*$~\1~p" | sort -u | wc -l - )" - - # check Cargo.lock for substrate ref change - case "${SUBSTRATE_REFS_CHANGED}" in - (0) - boldprint "substrate refs not changed in Cargo.lock" - exit 0 - ;; - (2) - boldprint "substrate refs updated since ${LATEST_TAG}" - ;; - (*) - boldprint "check unsupported: more than one commit targeted in repo ${SUBSTRATE_REPO_CARGO}" - exit 1 - esac - - - SUBSTRATE_PREV_REF="$( - git diff "refs/tags/${LATEST_TAG}...${CI_COMMIT_SHA}" Cargo.lock \ - | sed -n -r "s~^\-source = \"${SUBSTRATE_REPO_CARGO}#([a-f0-9]+)\".*$~\1~p" | sort -u | head -n 1 - )" - - SUBSTRATE_NEW_REF="$( - git diff "refs/tags/${LATEST_TAG}...${CI_COMMIT_SHA}" Cargo.lock \ - | sed -n -r "s~^\+source = \"${SUBSTRATE_REPO_CARGO}#([a-f0-9]+)\".*$~\1~p" | sort -u | head -n 1 - )" - - - boldcat < ${add_spec_version} - -EOT - continue - - else - # check for impl_version updates: if only the impl versions changed, we assume - # there is no consensus-critical logic that has changed. - - add_impl_version="$( - git diff refs/tags/"${LATEST_TAG}...${CI_COMMIT_SHA}" "runtime/${RUNTIME}/src/lib.rs" \ - | sed -n -r 's/^\+[[:space:]]+impl_version: +([0-9]+),$/\1/p' - )" - sub_impl_version="$( - git diff refs/tags/"${LATEST_TAG}...${CI_COMMIT_SHA}" "runtime/${RUNTIME}/src/lib.rs" \ - | sed -n -r 's/^\-[[:space:]]+impl_version: +([0-9]+),$/\1/p' - )" - - - # see if the impl version changed - if [ "${add_impl_version}" != "${sub_impl_version}" ] - then - boldcat < ${add_impl_version} - -EOT - continue - fi - - failed_runtime_checks+=("$RUNTIME") - fi -done - -if [ ${#failed_runtime_checks} -gt 0 ]; then - boldcat < ./artifacts/VERSION - - echo -n ${EXTRATAG} > ./artifacts/EXTRATAG - - echo -n ${CI_JOB_ID} > ./artifacts/BUILD_LINUX_JOB_ID - - RELEASE_VERSION=$(./artifacts/polkadot -V | awk '{print $2}'| awk -F "-" '{print $1}') - - echo -n "v${RELEASE_VERSION}" > ./artifacts/BUILD_RELEASE_VERSION - -build-test-collators: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .common-refs - - .compiler-info - - .collect-artifacts - script: - - time cargo build --locked --profile testnet --verbose -p test-parachain-adder-collator - - time cargo build --locked --profile testnet --verbose -p test-parachain-undying-collator - # pack artifacts - - mkdir -p ./artifacts - - mv ./target/testnet/adder-collator ./artifacts/. - - mv ./target/testnet/undying-collator ./artifacts/. - - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - - echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - - echo "undying-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - -build-malus: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .common-refs - - .compiler-info - - .collect-artifacts - script: - - time cargo build --locked --profile testnet --verbose -p polkadot-test-malus - # pack artifacts - - mkdir -p ./artifacts - - mv ./target/testnet/malus ./artifacts/. - - mv ./target/testnet/polkadot-execute-worker ./artifacts/. - - mv ./target/testnet/polkadot-prepare-worker ./artifacts/. - - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - - echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - -build-staking-miner: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .common-refs - - .compiler-info - - .collect-artifacts - script: - - time cargo build --locked --release --package staking-miner - # pack artifacts - - mkdir -p ./artifacts - - mv ./target/release/staking-miner ./artifacts/. - - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - - echo "staking-miner = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - -build-rustdoc: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in test.yml - needs: - - job: test-deterministic-wasm - artifacts: false - extends: - - .docker-env - - .test-refs - variables: - SKIP_WASM_BUILD: 1 - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" - when: on_success - expire_in: 1 days - paths: - - ./crate-docs/ - script: - # FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features` - # FIXME: return to stable when https://github.com/rust-lang/rust/issues/96937 gets into stable - - time cargo doc --workspace --verbose --no-deps - - rm -f ./target/doc/.lock - - mv ./target/doc ./crate-docs - # FIXME: remove me after CI image gets nonroot - - chown -R nonroot:nonroot ./crate-docs - - echo "" > ./crate-docs/index.html - -build-implementers-guide: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in test.yml - needs: - - job: test-deterministic-wasm - artifacts: false - extends: - - .kubernetes-env - - .test-refs - - .collect-artifacts-short - # git depth is set on purpose: https://github.com/paritytech/polkadot/issues/6284 - variables: - GIT_STRATEGY: clone - GIT_DEPTH: 0 - CI_IMAGE: paritytech/mdbook-utils:e14aae4a-20221123 - script: - - mdbook build ./roadmap/implementers-guide - - mkdir -p artifacts - - mv roadmap/implementers-guide/book artifacts/ - -build-short-benchmark: - stage: build - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .test-refs - - .collect-artifacts - script: - - cargo build --profile release --locked --features=runtime-benchmarks - - mkdir artifacts - - cp ./target/release/polkadot ./artifacts/ diff --git a/polkadot/scripts/ci/gitlab/pipeline/check.yml b/polkadot/scripts/ci/gitlab/pipeline/check.yml deleted file mode 100644 index 9b2ad5e738332aba11b27b825439fccd9db82bc3..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/check.yml +++ /dev/null @@ -1,136 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "check" stage - -check-runtime: - stage: check - image: paritytech/tools:latest - extends: - - .kubernetes-env - rules: - - if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27 - variables: - GITLAB_API: "https://gitlab.parity.io/api/v4" - GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" - script: - - ./scripts/ci/gitlab/check_runtime.sh - allow_failure: true - -cargo-fmt: - stage: check - extends: - - .docker-env - - .test-refs - script: - - cargo +nightly --version - - cargo +nightly fmt --all -- --check - allow_failure: true - -# Disabled in https://github.com/paritytech/polkadot/pull/7512 -.spellcheck_disabled: - stage: check - extends: - - .docker-env - - .test-refs - script: - - cargo spellcheck --version - # compare with the commit parent to the PR, given it's from a default branch - - git fetch origin +${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH} - - echo "___Spellcheck is going to check your diff___" - - cargo spellcheck list-files -vvv $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges)) - - time cargo spellcheck check -vvv --cfg=scripts/ci/gitlab/spellcheck.toml --checkers hunspell --code 1 - $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges)) - allow_failure: true - -check-try-runtime: - stage: check - extends: - - .docker-env - - .test-refs - - .compiler-info - script: - # Check that everything compiles with `try-runtime` feature flag. - - cargo check --locked --features try-runtime --all - -# More info can be found here: https://github.com/paritytech/polkadot/pull/5865 -.check-runtime-migration: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .compiler-info - script: - - | - export RUST_LOG=remote-ext=debug,runtime=debug - echo "---------- Running try-runtime for ${NETWORK} ----------" - time cargo install --locked --git https://github.com/paritytech/try-runtime-cli --rev a93c9b5abe5d31a4cf1936204f7e5c489184b521 - time cargo build --release --locked -p "$NETWORK"-runtime --features try-runtime - time try-runtime \ - --runtime ./target/release/wbuild/"$NETWORK"-runtime/target/wasm32-unknown-unknown/release/"$NETWORK"_runtime.wasm \ - on-runtime-upgrade --checks=pre-and-post live --uri wss://${NETWORK}-try-runtime-node.parity-chains.parity.io:443 - -check-runtime-migration-polkadot: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .compiler-info - - .check-runtime-migration - variables: - NETWORK: "polkadot" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - -check-runtime-migration-kusama: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .compiler-info - - .check-runtime-migration - variables: - NETWORK: "kusama" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - -check-runtime-migration-westend: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .compiler-info - - .check-runtime-migration - variables: - NETWORK: "westend" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - -check-runtime-migration-rococo: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .compiler-info - - .check-runtime-migration - variables: - NETWORK: "rococo" - allow_failure: true # FIXME https://github.com/paritytech/substrate/issues/13107 - -# is broken, need to fix -check-no-default-features: - stage: check - extends: - - .docker-env - - .test-refs - - .compiler-info - script: - # Check that polkadot-cli will compile no default features. - - pushd ./node/service && cargo check --locked --no-default-features && popd - - pushd ./cli && cargo check --locked --no-default-features --features "service" && popd - - exit 0 - -# this is artificial job to run some build and tests using DAG -job-starter: - stage: check - image: paritytech/tools:latest - extends: - - .kubernetes-env - - .common-refs - script: - - echo ok diff --git a/polkadot/scripts/ci/gitlab/pipeline/publish.yml b/polkadot/scripts/ci/gitlab/pipeline/publish.yml deleted file mode 100644 index c224094125e375e527b11557b4e584a75c2ea44d..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/publish.yml +++ /dev/null @@ -1,276 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "publish" stage - -# This image is used in testnets -# Release image is handled by the Github Action here: -# .github/workflows/publish-docker-release.yml -publish-polkadot-debug-image: - stage: publish - extends: - - .kubernetes-env - - .build-push-image - rules: - # Don't run when triggered from another pipeline - - if: $CI_PIPELINE_SOURCE == "pipeline" - when: never - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - variables: - IMAGE_NAME: "polkadot-debug" - BINARY: "polkadot,polkadot-execute-worker,polkadot-prepare-worker" - needs: - - job: build-linux-stable - artifacts: true - after_script: - - !reference [.build-push-image, after_script] - # pass artifacts to the zombienet-tests job - # https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance - - echo "PARACHAINS_IMAGE_NAME=${IMAGE}" > ./artifacts/parachains.env - - echo "PARACHAINS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/parachains.env - artifacts: - reports: - # this artifact is used in zombienet-tests job - dotenv: ./artifacts/parachains.env - expire_in: 1 days - -publish-test-collators-image: - # service image for Simnet - stage: publish - extends: - - .kubernetes-env - - .build-push-image - - .zombienet-refs - variables: - IMAGE_NAME: "colander" - BINARY: "adder-collator,undying-collator" - needs: - - job: build-test-collators - artifacts: true - after_script: - - !reference [.build-push-image, after_script] - # pass artifacts to the zombienet-tests job - - echo "COLLATOR_IMAGE_NAME=${IMAGE}" > ./artifacts/collator.env - - echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/collator.env - artifacts: - reports: - # this artifact is used in zombienet-tests job - dotenv: ./artifacts/collator.env - -publish-malus-image: - # service image for Simnet - stage: publish - extends: - - .kubernetes-env - - .build-push-image - - .zombienet-refs - variables: - IMAGE_NAME: "malus" - BINARY: "malus,polkadot-execute-worker,polkadot-prepare-worker" - needs: - - job: build-malus - artifacts: true - after_script: - - !reference [.build-push-image, after_script] - # pass artifacts to the zombienet-tests job - - echo "MALUS_IMAGE_NAME=${IMAGE}" > ./artifacts/malus.env - - echo "MALUS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/malus.env - artifacts: - reports: - # this artifact is used in zombienet-tests job - dotenv: ./artifacts/malus.env - -publish-staking-miner-image: - stage: publish - extends: - - .kubernetes-env - - .build-push-image - - .publish-refs - variables: - IMAGE_NAME: "staking-miner" - BINARY: "staking-miner" - DOCKER_OWNER: "paritytech" - DOCKER_USER: "${Docker_Hub_User_Parity}" - DOCKER_PASS: "${Docker_Hub_Pass_Parity}" - needs: - - job: build-staking-miner - artifacts: true - -publish-polkadot-image-description: - stage: publish - image: paritytech/dockerhub-description - variables: - DOCKER_USERNAME: ${Docker_Hub_User_Parity} - DOCKER_PASSWORD: ${Docker_Hub_Pass_Parity} - DOCKERHUB_REPOSITORY: parity/polkadot - SHORT_DESCRIPTION: "Polkadot Official Docker Image" - README_FILEPATH: $CI_PROJECT_DIR/scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md - rules: - - if: $CI_COMMIT_REF_NAME == "master" - changes: - - scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md - - if: $CI_PIPELINE_SOURCE == "schedule" - when: never - script: - - cd / && sh entrypoint.sh - tags: - - kubernetes-parity-build - -publish-staking-miner-image-description: - stage: publish - image: paritytech/dockerhub-description - variables: - DOCKER_USERNAME: ${Docker_Hub_User_Parity} - DOCKER_PASSWORD: ${Docker_Hub_Pass_Parity} - DOCKERHUB_REPOSITORY: paritytech/staking-miner - SHORT_DESCRIPTION: "Staking-miner Docker Image" - README_FILEPATH: $CI_PROJECT_DIR/scripts/ci/dockerfiles/staking-miner/staking-miner_Dockerfile.README.md - rules: - - if: $CI_COMMIT_REF_NAME == "master" - changes: - - scripts/ci/dockerfiles/staking-miner/staking-miner_Dockerfile.README.md - - if: $CI_PIPELINE_SOURCE == "schedule" - when: never - script: - - cd / && sh entrypoint.sh - tags: - - kubernetes-parity-build - -publish-s3-release: - stage: publish - extends: - - .kubernetes-env - needs: - - job: build-linux-stable - artifacts: true - variables: - CI_IMAGE: paritytech/awscli:latest - GIT_STRATEGY: none - PREFIX: "builds/polkadot/${ARCH}-${DOCKER_OS}" - rules: - - if: $CI_PIPELINE_SOURCE == "pipeline" - when: never - # publishing binaries nightly - - if: $CI_PIPELINE_SOURCE == "schedule" - before_script: - - !reference [.build-push-image, before_script] - script: - - echo "uploading objects to https://releases.parity.io/${PREFIX}/${VERSION}" - - aws s3 sync --acl public-read ./artifacts/ s3://${AWS_BUCKET}/${PREFIX}/${VERSION}/ - - echo "update objects at https://releases.parity.io/${PREFIX}/${EXTRATAG}" - - find ./artifacts -type f | while read file; do - name="${file#./artifacts/}"; - aws s3api copy-object - --copy-source ${AWS_BUCKET}/${PREFIX}/${VERSION}/${name} - --bucket ${AWS_BUCKET} --key ${PREFIX}/${EXTRATAG}/${name}; - done - - | - cat <<-EOM - | - | polkadot binary paths: - | - | - https://releases.parity.io/${PREFIX}/${EXTRATAG}/polkadot - | - https://releases.parity.io/${PREFIX}/${VERSION}/polkadot - | - EOM - after_script: - - aws s3 ls s3://${AWS_BUCKET}/${PREFIX}/${EXTRATAG}/ - --recursive --human-readable --summarize - -publish-rustdoc: - stage: publish - extends: - - .kubernetes-env - variables: - CI_IMAGE: paritytech/tools:latest - rules: - - if: $CI_PIPELINE_SOURCE == "pipeline" - when: never - - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "master" - # `needs:` can be removed after CI image gets nonroot. In this case `needs:` stops other - # artifacts from being dowloaded by this job. - needs: - - job: build-rustdoc - artifacts: true - - job: build-implementers-guide - artifacts: true - script: - # Save README and docs - - cp -r ./crate-docs/ /tmp/doc/ - - cp -r ./artifacts/book/ /tmp/ - # setup ssh - - eval $(ssh-agent) - - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} - - mkdir ~/.ssh && touch ~/.ssh/known_hosts - - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts - # Set git config - - git config user.email "devops-team@parity.io" - - git config user.name "${GITHUB_USER}" - - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git" - - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - - git fetch origin gh-pages - - git checkout gh-pages - # Remove everything and restore generated docs and README - - cp index.html /tmp - - cp README.md /tmp - - rm -rf ./* - # dir for rustdoc - - mkdir -p doc - # dir for implementors guide - - mkdir -p book - - mv /tmp/doc/* doc/ - - mv /tmp/book/html/* book/ - - mv /tmp/index.html . - - mv /tmp/README.md . - # Upload files - - git add --all --force - # `git commit` has an exit code of > 0 if there is nothing to commit. - # This causes GitLab to exit immediately and marks this job failed. - # We don't want to mark the entire job failed if there's nothing to - # publish though, hence the `|| true`. - - git commit -m "Updated docs for ${CI_COMMIT_REF_NAME}" || - echo "___Nothing to commit___" - - git push origin gh-pages --force - - echo "___Rustdoc was successfully published to https://paritytech.github.io/polkadot/___" - after_script: - - rm -rf .git/ ./* - -.update-substrate-template-repository: - stage: publish - extends: .kubernetes-env - variables: - GIT_STRATEGY: none - rules: - # The template is only updated for FINAL releases - # i.e. the rule should not cover RC or patch releases - - if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+$/ # e.g. v1.0 - - if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ # e.g. v1.0.0 - script: - - git clone --depth=1 --branch="$PIPELINE_SCRIPTS_TAG" https://github.com/paritytech/pipeline-scripts - - export POLKADOT_BRANCH="polkadot-$CI_COMMIT_TAG" - - git clone --depth=1 --branch="$POLKADOT_BRANCH" https://github.com/paritytech/"$TEMPLATE_SOURCE" - - cd "$TEMPLATE_SOURCE" - - ../pipeline-scripts/update_substrate_template.sh - --repo-name "$TARGET_REPOSITORY" - --template-path "$TEMPLATE_PATH" - --github-api-token "$GITHUB_TOKEN" - --polkadot-branch "$POLKADOT_BRANCH" - -# Ref: https://github.com/paritytech/opstooling/issues/111 -update-node-template: - extends: .update-substrate-template-repository - variables: - TARGET_REPOSITORY: substrate-node-template - TEMPLATE_SOURCE: substrate - TEMPLATE_PATH: bin/node-template - -# Ref: https://github.com/paritytech/opstooling/issues/111 -update-parachain-template: - extends: .update-substrate-template-repository - variables: - TARGET_REPOSITORY: substrate-parachain-template - TEMPLATE_SOURCE: cumulus - TEMPLATE_PATH: parachain-template diff --git a/polkadot/scripts/ci/gitlab/pipeline/short-benchmarks.yml b/polkadot/scripts/ci/gitlab/pipeline/short-benchmarks.yml deleted file mode 100644 index dd150e5916e263c74e1d6bf98872142705800982..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/short-benchmarks.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "short-benchmarks" stage - -# Run all pallet benchmarks only once to check if there are any errors -short-benchmark-polkadot: &short-bench - stage: short-benchmarks - extends: - - .test-pr-refs - - .docker-env - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: build-short-benchmark - artifacts: true - variables: - RUNTIME: polkadot - script: - - ./artifacts/polkadot benchmark pallet --wasm-execution compiled --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 - -short-benchmark-kusama: - <<: *short-bench - variables: - RUNTIME: kusama - -short-benchmark-westend: - <<: *short-bench - variables: - RUNTIME: westend diff --git a/polkadot/scripts/ci/gitlab/pipeline/test.yml b/polkadot/scripts/ci/gitlab/pipeline/test.yml deleted file mode 100644 index 963df0aa03031daef11fce665694cd5866d05c86..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/test.yml +++ /dev/null @@ -1,119 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "test" stage - -# It's more like a check and it belongs to the previous stage, but we want to run this job with real tests in parallel -find-fail-ci-phrase: - stage: test - variables: - CI_IMAGE: "paritytech/tools:latest" - ASSERT_REGEX: "FAIL-CI" - GIT_DEPTH: 1 - extends: - - .kubernetes-env - script: - - set +e - - rg --line-number --hidden --type rust --glob '!{.git,target}' "$ASSERT_REGEX" .; exit_status=$? - - if [ $exit_status -eq 0 ]; then - echo "$ASSERT_REGEX was found, exiting with 1"; - exit 1; - else - echo "No $ASSERT_REGEX was found, exiting with 0"; - exit 0; - fi - -test-linux-stable: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .common-refs - - .pipeline-stopper-artifacts - before_script: - - !reference [.compiler-info, before_script] - - !reference [.pipeline-stopper-vars, before_script] - variables: - RUST_TOOLCHAIN: stable - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - script: - - time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics,try-runtime,ci-only-tests - # Run `polkadot-runtime-parachains` tests a second time because `paras_inherent::enter` tests are gated by not having - # the `runtime-benchmarks` feature enabled. - - time cargo test --profile testnet --verbose --locked --features=runtime-metrics,try-runtime -p polkadot-runtime-parachains - -test-linux-oldkernel-stable: - extends: test-linux-stable - tags: - - oldkernel-vm - -.check-dependent-project: &check-dependent-project - stage: test - extends: - - .docker-env - - .test-pr-refs - script: - - git clone - --depth=1 - "--branch=$PIPELINE_SCRIPTS_TAG" - https://github.com/paritytech/pipeline-scripts - - ./pipeline-scripts/check_dependent_project.sh - --org paritytech - --dependent-repo "$DEPENDENT_REPO" - --github-api-token "$GITHUB_PR_TOKEN" - --extra-dependencies "$EXTRA_DEPENDENCIES" - --companion-overrides "$COMPANION_OVERRIDES" - -check-dependent-cumulus: - <<: *check-dependent-project - variables: - DEPENDENT_REPO: cumulus - EXTRA_DEPENDENCIES: substrate - COMPANION_OVERRIDES: | - polkadot: release-v* - cumulus: polkadot-v* - -test-node-metrics: - stage: test - extends: - - .docker-env - - .test-refs - - .compiler-info - variables: - RUST_TOOLCHAIN: stable - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - script: - # Build the required workers. - - cargo build --bin polkadot-execute-worker --bin polkadot-prepare-worker --profile testnet --verbose --locked - # Run tests. - - time cargo test --profile testnet --verbose --locked --features=runtime-metrics -p polkadot-node-metrics - -test-deterministic-wasm: - stage: test - extends: - - .docker-env - - .test-refs - - .compiler-info - script: - - ./scripts/ci/gitlab/test_deterministic_wasm.sh - -cargo-clippy: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - # the job can be found in check.yml - needs: - - job: job-starter - artifacts: false - extends: - - .docker-env - - .test-refs - script: - - echo $RUSTFLAGS - - cargo version && cargo clippy --version - - SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo clippy -q --locked --all-targets --workspace diff --git a/polkadot/scripts/ci/gitlab/pipeline/weights.yml b/polkadot/scripts/ci/gitlab/pipeline/weights.yml deleted file mode 100644 index edca9e769b4338a20d7099f8bc4a9bb839883286..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/weights.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "weights" stage - -update_polkadot_weights: &update-weights - # The update-weights pipeline defaults to `interruptible: false` so that we'll be able to - # reach and run the benchmarking jobs despite the "Auto-cancel redundant pipelines" CI setting. - # The setting is relevant because future pipelines (e.g. created for new commits or other schedules) - # might otherwise cancel the benchmark jobs early. - interruptible: false - stage: weights - timeout: 1d - when: manual - image: $CI_IMAGE - variables: - RUNTIME: polkadot - artifacts: - paths: - - ${RUNTIME}_weights_${CI_COMMIT_SHORT_SHA}.patch - script: - - ./scripts/ci/run_benches_for_runtime.sh $RUNTIME - - git diff -P > ${RUNTIME}_weights_${CI_COMMIT_SHORT_SHA}.patch - # uses the "shell" executors - tags: - - weights - -update_kusama_weights: - <<: *update-weights - variables: - RUNTIME: kusama - -update_westend_weights: - <<: *update-weights - variables: - RUNTIME: westend - -update_rococo_weights: - <<: *update-weights - variables: - RUNTIME: rococo diff --git a/polkadot/scripts/ci/gitlab/pipeline/zombienet.yml b/polkadot/scripts/ci/gitlab/pipeline/zombienet.yml deleted file mode 100644 index 62e081d1de0e5f4b61f2c1dc34a2ab53a73f3fe7..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/pipeline/zombienet.yml +++ /dev/null @@ -1,444 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "zombienet" stage - -zombienet-tests-parachains-smoke-test: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-malus-image - - job: publish-test-collators-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE="docker.io/paritypr/colander:7292" # The collator image is fixed - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0001-parachains-smoke-test.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-parachains-pvf: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0001-parachains-pvf.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-parachains-disputes: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: publish-malus-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0002-parachains-disputes.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-parachains-disputes-garbage-candidate: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: publish-malus-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0003-parachains-garbage-candidate.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-parachains-disputes-past-session: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: publish-malus-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0004-parachains-disputes-past-session.zndsl" - allow_failure: true - retry: 2 - tags: - - zombienet-polkadot-integration-test - - -zombienet-test-parachains-upgrade-smoke-test: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-malus-image - - job: publish-test-collators-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke" - before_script: - - echo "ZombieNet Tests Config" - - echo "${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}" - - echo "docker.io/parity/polkadot-collator:latest" - - echo "${ZOMBIENET_IMAGE}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export COL_IMAGE="docker.io/parity/polkadot-collator:latest" # Use cumulus lastest image - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0002-parachains-upgrade-smoke-test.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-misc-paritydb: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/misc" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0001-paritydb.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-misc-upgrade-node: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: build-linux-stable - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/misc" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/parity/polkadot:latest" - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - - BUILD_LINUX_JOB_ID="$(cat ./artifacts/BUILD_LINUX_JOB_ID)" - - export POLKADOT_PR_ARTIFACTS_URL="https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/${BUILD_LINUX_JOB_ID}/artifacts/raw/artifacts" - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0002-upgrade-node.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-malus-dispute-valid: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - - job: publish-malus-image - - job: publish-test-collators-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/node/malus/integrationtests" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie* - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0001-dispute-valid-block.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-deregister-register-validator: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie* - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0003-deregister-register-validator-smoke.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-beefy-and-mmr: - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - extends: - - .kubernetes-env - - .zombienet-refs - needs: - - job: publish-polkadot-debug-image - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie* - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="0003-beefy-and-mmr.zndsl" - allow_failure: true - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-async-backing-compatibility: - stage: zombienet - extends: - - .kubernetes-env - - .zombienet-refs - image: "${ZOMBIENET_IMAGE}" - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: build-linux-stable - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/async_backing" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}" - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="001-async-backing-compatibility.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-async-backing-runtime-upgrade: - stage: zombienet - extends: - - .kubernetes-env - - .zombienet-refs - image: "${ZOMBIENET_IMAGE}" - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: build-linux-stable - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/async_backing" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}" - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - - export POLKADOT_PR_BIN_URL="https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/${BUILD_LINUX_JOB_ID}/artifacts/raw/artifacts/polkadot" - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="002-async-backing-runtime-upgrade.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-tests-async-backing-collator-mix: - stage: zombienet - extends: - - .kubernetes-env - - .zombienet-refs - image: "${ZOMBIENET_IMAGE}" - needs: - - job: publish-polkadot-debug-image - - job: publish-test-collators-image - - job: build-linux-stable - artifacts: true - variables: - RUN_IN_CONTAINER: "1" - GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/async_backing" - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE_NAME}" - - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} - - export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}" - - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}" - --test="003-async-backing-collator-mix.zndsl" - allow_failure: false - retry: 2 - tags: - - zombienet-polkadot-integration-test diff --git a/polkadot/scripts/ci/gitlab/prettier.sh b/polkadot/scripts/ci/gitlab/prettier.sh deleted file mode 100755 index 299bbee179dcaeff3fbadffd89fb4548ac878555..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/prettier.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# meant to be installed via -# git config filter.ci-prettier.clean "scripts/ci/gitlab/prettier.sh" - -prettier --parser yaml diff --git a/polkadot/scripts/ci/gitlab/spellcheck.toml b/polkadot/scripts/ci/gitlab/spellcheck.toml deleted file mode 100644 index 636cafa2cc4e93484215284c897ded7b507cec54..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/spellcheck.toml +++ /dev/null @@ -1,34 +0,0 @@ -[hunspell] -lang = "en_US" -search_dirs = ["."] -extra_dictionaries = ["lingua.dic"] -skip_os_lookups = true -use_builtin = true - -[hunspell.quirks] -# He tagged it as 'TheGreatestOfAllTimes' -transform_regex = [ -# `Type`'s - "^'([^\\s])'$", -# 5x -# 10.7% - "^[0-9_]+(?:\\.[0-9]*)?(x|%)$", -# Transforms' - "^(.*)'$", -# backslashes - "^\\+$", - "^[0-9]*+k|MB|Mb|ms|Mbit|nd|th|rd$", -# single char `=` `>` `%` .. - "^=|>|<|%$", -# 22_100 - "^(?:[0-9]+_)+[0-9]+$", -# V5, v5, P1.2, etc - "[A-Za-z][0-9]", -# ~50 - "~[0-9]+", - "ABI", - "bool", - "sigil", -] -allow_concatenation = true -allow_dashes = true diff --git a/polkadot/scripts/ci/gitlab/test_deterministic_wasm.sh b/polkadot/scripts/ci/gitlab/test_deterministic_wasm.sh deleted file mode 100755 index b4292376942156e326517d3b3df3c99424270e6b..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/gitlab/test_deterministic_wasm.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -# build runtime -WASM_BUILD_NO_COLOR=1 cargo build --verbose --release -p kusama-runtime -p polkadot-runtime -p westend-runtime -# make checksum -sha256sum target/release/wbuild/*-runtime/target/wasm32-unknown-unknown/release/*.wasm > checksum.sha256 -# clean up - FIXME: can we reuse some of the artifacts? -cargo clean -# build again -WASM_BUILD_NO_COLOR=1 cargo build --verbose --release -p kusama-runtime -p polkadot-runtime -p westend-runtime -# confirm checksum -sha256sum -c checksum.sha256 diff --git a/polkadot/scripts/ci/run_benches_for_runtime.sh b/polkadot/scripts/ci/run_benches_for_runtime.sh deleted file mode 100755 index 296985a42764767c9a6c98b1c51d8a8939e7210d..0000000000000000000000000000000000000000 --- a/polkadot/scripts/ci/run_benches_for_runtime.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Runs all benchmarks for all pallets, for a given runtime, provided by $1 -# Should be run on a reference machine to gain accurate benchmarks -# current reference machine: https://github.com/paritytech/substrate/pull/5848 - -runtime="$1" - -echo "[+] Compiling benchmarks..." -cargo build --profile production --locked --features=runtime-benchmarks - -# Load all pallet names in an array. -PALLETS=($( - ./target/production/polkadot benchmark pallet --list --chain="${runtime}-dev" |\ - tail -n+2 |\ - cut -d',' -f1 |\ - sort |\ - uniq -)) - -echo "[+] Benchmarking ${#PALLETS[@]} pallets for runtime $runtime" - -# Define the error file. -ERR_FILE="benchmarking_errors.txt" -# Delete the error file before each run. -rm -f $ERR_FILE - -# Benchmark each pallet. -for PALLET in "${PALLETS[@]}"; do - echo "[+] Benchmarking $PALLET for $runtime"; - - output_file="" - if [[ $PALLET == *"::"* ]]; then - # translates e.g. "pallet_foo::bar" to "pallet_foo_bar" - output_file="${PALLET//::/_}.rs" - fi - - OUTPUT=$( - ./target/production/polkadot benchmark pallet \ - --chain="${runtime}-dev" \ - --steps=50 \ - --repeat=20 \ - --pallet="$PALLET" \ - --extrinsic="*" \ - --wasm-execution=compiled \ - --header=./file_header.txt \ - --output="./runtime/${runtime}/src/weights/${output_file}" 2>&1 - ) - if [ $? -ne 0 ]; then - echo "$OUTPUT" >> "$ERR_FILE" - echo "[-] Failed to benchmark $PALLET. Error written to $ERR_FILE; continuing..." - fi -done - -# Update the block and extrinsic overhead weights. -echo "[+] Benchmarking block and extrinsic overheads..." -OUTPUT=$( - ./target/production/polkadot benchmark overhead \ - --chain="${runtime}-dev" \ - --wasm-execution=compiled \ - --weight-path="runtime/${runtime}/constants/src/weights/" \ - --warmup=10 \ - --repeat=100 \ - --header=./file_header.txt -) -if [ $? -ne 0 ]; then - echo "$OUTPUT" >> "$ERR_FILE" - echo "[-] Failed to benchmark the block and extrinsic overheads. Error written to $ERR_FILE; continuing..." -fi - -# Check if the error file exists. -if [ -f "$ERR_FILE" ]; then - echo "[-] Some benchmarks failed. See: $ERR_FILE" -else - echo "[+] All benchmarks passed." -fi diff --git a/polkadot/statement-table/src/generic.rs b/polkadot/statement-table/src/generic.rs index a427aae42fb9523a21a416a106b61f56e8be46c2..22bffde5acc11b8fdbea565d054949caf40d788f 100644 --- a/polkadot/statement-table/src/generic.rs +++ b/polkadot/statement-table/src/generic.rs @@ -30,7 +30,10 @@ use std::{ hash::Hash, }; -use primitives::{ValidatorSignature, ValidityAttestation as PrimitiveValidityAttestation}; +use primitives::{ + effective_minimum_backing_votes, ValidatorSignature, + ValidityAttestation as PrimitiveValidityAttestation, +}; use parity_scale_codec::{Decode, Encode}; @@ -57,8 +60,8 @@ pub trait Context { /// Members are meant to submit candidates and vote on validity. fn is_member_of(&self, authority: &Self::AuthorityId, group: &Self::GroupId) -> bool; - /// requisite number of votes for validity from a group. - fn requisite_votes(&self, group: &Self::GroupId) -> usize; + /// Get a validator group size. + fn get_group_size(&self, group: &Self::GroupId) -> Option; } /// Table configuration. @@ -319,9 +322,12 @@ impl Table { &self, digest: &Ctx::Digest, context: &Ctx, + minimum_backing_votes: u32, ) -> Option> { self.candidate_votes.get(digest).and_then(|data| { - let v_threshold = context.requisite_votes(&data.group_id); + let v_threshold = context.get_group_size(&data.group_id).map_or(usize::MAX, |len| { + effective_minimum_backing_votes(len, minimum_backing_votes) + }); data.attested(v_threshold) }) } @@ -636,16 +642,13 @@ mod tests { self.authorities.get(authority).map(|v| v == group).unwrap_or(false) } - fn requisite_votes(&self, id: &GroupId) -> usize { - let mut total_validity = 0; - - for validity in self.authorities.values() { - if validity == id { - total_validity += 1 - } + fn get_group_size(&self, group: &Self::GroupId) -> Option { + let count = self.authorities.values().filter(|g| *g == group).count(); + if count == 0 { + None + } else { + Some(count) } - - total_validity / 2 + 1 } } @@ -910,7 +913,7 @@ mod tests { table.import_statement(&context, statement); assert!(!table.detected_misbehavior.contains_key(&AuthorityId(1))); - assert!(table.attested_candidate(&candidate_digest, &context).is_none()); + assert!(table.attested_candidate(&candidate_digest, &context, 2).is_none()); let vote = SignedStatement { statement: Statement::Valid(candidate_digest), @@ -920,7 +923,7 @@ mod tests { table.import_statement(&context, vote); assert!(!table.detected_misbehavior.contains_key(&AuthorityId(2))); - assert!(table.attested_candidate(&candidate_digest, &context).is_some()); + assert!(table.attested_candidate(&candidate_digest, &context, 2).is_some()); } #[test] diff --git a/polkadot/utils/generate-bags/Cargo.toml b/polkadot/utils/generate-bags/Cargo.toml index de5ec422ff41ebd047769f9a4ff2bba179002c14..98a0a9b6a88595ddb0de7c8910e35cdcaa57f98e 100644 --- a/polkadot/utils/generate-bags/Cargo.toml +++ b/polkadot/utils/generate-bags/Cargo.toml @@ -6,11 +6,11 @@ edition.workspace = true license.workspace = true [dependencies] -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } generate-bags = { path = "../../../substrate/utils/frame/generate-bags" } sp-io = { path = "../../../substrate/primitives/io" } westend-runtime = { path = "../../runtime/westend" } -kusama-runtime = { path = "../../runtime/kusama" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../runtime/kusama" } polkadot-runtime = { path = "../../runtime/polkadot" } diff --git a/polkadot/utils/remote-ext-tests/bags-list/Cargo.toml b/polkadot/utils/remote-ext-tests/bags-list/Cargo.toml index 3e5ccdb44d3cd8dc7944f99ed7eca20c5b5651e9..bbdddf7506449570dd16e1c7bced038dc12d4e26 100644 --- a/polkadot/utils/remote-ext-tests/bags-list/Cargo.toml +++ b/polkadot/utils/remote-ext-tests/bags-list/Cargo.toml @@ -8,7 +8,7 @@ license.workspace = true [dependencies] polkadot-runtime = { path = "../../../runtime/polkadot" } -kusama-runtime = { path = "../../../runtime/kusama" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../../runtime/kusama" } westend-runtime = { path = "../../../runtime/westend" } polkadot-runtime-constants = { path = "../../../runtime/polkadot/constants" } kusama-runtime-constants = { path = "../../../runtime/kusama/constants" } @@ -19,6 +19,6 @@ sp-tracing = { path = "../../../../substrate/primitives/tracing" } frame-system = { path = "../../../../substrate/frame/system" } sp-core = { path = "../../../../substrate/primitives/core" } -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } log = "0.4.17" tokio = { version = "1.24.2", features = ["macros"] } diff --git a/polkadot/utils/staking-miner/Cargo.toml b/polkadot/utils/staking-miner/Cargo.toml index 5ca528235a503da572dc369fb667c1a75670b5ad..09e73bc10f2d1828d224fe565bee444aa3cbd924 100644 --- a/polkadot/utils/staking-miner/Cargo.toml +++ b/polkadot/utils/staking-miner/Cargo.toml @@ -1,9 +1,9 @@ [[bin]] -name = "staking-miner" +name = "staging-staking-miner" path = "src/main.rs" [package] -name = "staking-miner" +name = "staging-staking-miner" version = "1.0.0" authors.workspace = true edition.workspace = true @@ -12,12 +12,12 @@ publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1" } -clap = { version = "4.0.9", features = ["derive", "env"] } +clap = { version = "4.4.2", features = ["derive", "env"] } tracing-subscriber = { version = "0.3.11", features = ["env-filter"] } jsonrpsee = { version = "0.16.2", features = ["ws-client", "macros"] } log = "0.4.17" paste = "1.0.7" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0" thiserror = "1.0.31" tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread", "sync"] } @@ -42,7 +42,7 @@ core-primitives = { package = "polkadot-core-primitives", path = "../../core-pri runtime-common = { package = "polkadot-runtime-common", path = "../../runtime/common" } polkadot-runtime = { path = "../../runtime/polkadot" } -kusama-runtime = { path = "../../runtime/kusama" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../runtime/kusama" } westend-runtime = { path = "../../runtime/westend" } exitcode = "1.1" diff --git a/polkadot/utils/staking-miner/src/opts.rs b/polkadot/utils/staking-miner/src/opts.rs index ecffe45310144caf5a8e73868f132bb8379e0b79..4cf4d0a765199ecf790f45c579b6874b050a630e 100644 --- a/polkadot/utils/staking-miner/src/opts.rs +++ b/polkadot/utils/staking-miner/src/opts.rs @@ -88,10 +88,10 @@ pub(crate) struct MonitorConfig { /// /// `--submission-strategy always`: always submit. /// - /// `--submission-strategy "percent-better "`: submit if the submission is `n` percent + /// `--submission-strategy "percent-better percent"`: submit if the submission is `n` percent /// better. /// - /// `--submission-strategy "no-worse-than "`: submit if submission is no more than + /// `--submission-strategy "no-worse-than percent"`: submit if submission is no more than /// `n` percent worse. #[clap(long, default_value = "if-leading")] pub submission_strategy: SubmissionStrategy, @@ -190,8 +190,8 @@ pub(crate) enum Solver { /// Possible options: /// * --submission-strategy if-leading: only submit if leading /// * --submission-strategy always: always submit -/// * --submission-strategy "percent-better ": submit if submission is `n` percent better. -/// * --submission-strategy "no-worse-than": submit if submission is no more than `n` +/// * --submission-strategy "percent-better percent": submit if submission is `n` percent better. +/// * --submission-strategy "no-worse-than percent": submit if submission is no more than `n` /// percent worse. impl FromStr for SubmissionStrategy { type Err = String; diff --git a/polkadot/xcm/Cargo.toml b/polkadot/xcm/Cargo.toml index ba1944ebe85f30a3d2a81cf0f1c247a3eebafb8f..f04f31c3ec103da9d08dd9c84cc3668eb46afb70 100644 --- a/polkadot/xcm/Cargo.toml +++ b/polkadot/xcm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xcm" +name = "staging-xcm" description = "The basic XCM datastructures." version = "1.0.0" authors.workspace = true @@ -14,8 +14,9 @@ log = { version = "0.4.17", default-features = false } parity-scale-codec = { version = "3.6.1", default-features = false, features = [ "derive", "max-encoded-len" ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } sp-weights = { path = "../../substrate/primitives/weights", default-features = false, features = ["serde"] } -serde = { version = "1.0.163", default-features = false, features = ["alloc", "derive"] } +serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"] } xcm-procedural = { path = "procedural" } +environmental = { version = "1.1.4", default-features = false } [dev-dependencies] sp-io = { path = "../../substrate/primitives/io" } @@ -27,6 +28,7 @@ default = [ "std" ] wasm-api = [] std = [ "bounded-collections/std", + "environmental/std", "parity-scale-codec/std", "scale-info/std", "serde/std", diff --git a/polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml b/polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml index 416f5c4bd6ed5506a4aaeebc1b9dfd18d498a5ee..35b0b7dc553e5fa58e9457ab89bf9416d418bfe8 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -16,10 +16,10 @@ frame-system = { path = "../../../substrate/frame/system", default-features = fa sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false} sp-std = { path = "../../../substrate/primitives/std", default-features = false} sp-io = { path = "../../../substrate/primitives/io", default-features = false} -xcm-executor = { path = "../xcm-executor", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../xcm-executor", default-features = false } frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false} -xcm = { path = "..", default-features = false } -xcm-builder = { path = "../xcm-builder", default-features = false } +xcm = { package = "staging-xcm", path = "..", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../xcm-builder", default-features = false } log = "0.4.17" [dev-dependencies] @@ -27,7 +27,7 @@ pallet-balances = { path = "../../../substrate/frame/balances" } pallet-assets = { path = "../../../substrate/frame/assets" } sp-core = { path = "../../../substrate/primitives/core" } sp-tracing = { path = "../../../substrate/primitives/tracing" } -xcm = { path = ".." } +xcm = { package = "staging-xcm", path = ".." } # temp pallet-xcm = { path = "../pallet-xcm" } polkadot-runtime-common = { path = "../../runtime/common" } diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mod.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mod.rs index 195066ee5b48441ea915872fa1ce1163d00772ac..f207c238a39f14e5d1b6606b1d91dda12b096237 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mod.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mod.rs @@ -24,10 +24,8 @@ mod mock; #[frame_support::pallet] pub mod pallet { use frame_benchmarking::BenchmarkError; - use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo}, - pallet_prelude::Encode, - }; + use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::Encode}; + use sp_runtime::traits::Dispatchable; use xcm::latest::{ InteriorMultiLocation, Junction, MultiAsset, MultiAssets, MultiLocation, NetworkId, Response, diff --git a/polkadot/xcm/pallet-xcm/Cargo.toml b/polkadot/xcm/pallet-xcm/Cargo.toml index 63a616281d817f2f5c3ec53dfceb06e97868c46a..17ee9840e8f47ad2436add35296b811dc38846e8 100644 --- a/polkadot/xcm/pallet-xcm/Cargo.toml +++ b/polkadot/xcm/pallet-xcm/Cargo.toml @@ -10,7 +10,7 @@ version = "1.0.0" bounded-collections = { version = "0.1.8", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } log = { version = "0.4.17", default-features = false } frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true } @@ -21,18 +21,18 @@ sp-io = { path = "../../../substrate/primitives/io", default-features = false} sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false} sp-std = { path = "../../../substrate/primitives/std", default-features = false} -xcm = { path = "..", default-features = false } -xcm-executor = { path = "../xcm-executor", default-features = false } +xcm = { package = "staging-xcm", path = "..", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../xcm-executor", default-features = false } [dev-dependencies] pallet-balances = { path = "../../../substrate/frame/balances" } polkadot-runtime-parachains = { path = "../../runtime/parachains" } -polkadot-parachain = { path = "../../parachain" } -xcm-builder = { path = "../xcm-builder" } +polkadot-parachain-primitives = { path = "../../parachain" } +xcm-builder = { package = "staging-xcm-builder", path = "../xcm-builder" } [features] default = [ "std" ] -# Enable `VersionedRuntimeUpgrade` for the migrations that is currently still experimental. +# Enable `VersionedMigration` for the migrations using the experimental feature. experimental = [ "frame-support/experimental" ] std = [ "bounded-collections/std", @@ -54,7 +54,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/polkadot/xcm/pallet-xcm/src/lib.rs b/polkadot/xcm/pallet-xcm/src/lib.rs index aefcf30910ed90a6f989e8db56cfa7f8ef558ef1..9dfb63c2c9c6411f2d198cbdfc42c1d292b23c0a 100644 --- a/polkadot/xcm/pallet-xcm/src/lib.rs +++ b/polkadot/xcm/pallet-xcm/src/lib.rs @@ -34,7 +34,8 @@ use frame_support::traits::{ use scale_info::TypeInfo; use sp_runtime::{ traits::{ - AccountIdConversion, BadOrigin, BlakeTwo256, BlockNumberProvider, Hash, Saturating, Zero, + AccountIdConversion, BadOrigin, BlakeTwo256, BlockNumberProvider, Dispatchable, Hash, + Saturating, Zero, }, RuntimeDebug, }; @@ -43,10 +44,7 @@ use xcm::{latest::QueryResponseInfo, prelude::*}; use xcm_executor::traits::{ConvertOrigin, Properties}; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo}, - pallet_prelude::*, - traits::WithdrawReasons, - PalletId, + dispatch::GetDispatchInfo, pallet_prelude::*, traits::WithdrawReasons, PalletId, }; use frame_system::pallet_prelude::*; pub use pallet::*; @@ -149,11 +147,12 @@ impl WeightInfo for TestWeightInfo { pub mod pallet { use super::*; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, + dispatch::{GetDispatchInfo, PostDispatchInfo}, parameter_types, }; use frame_system::Config as SysConfig; use sp_core::H256; + use sp_runtime::traits::Dispatchable; use xcm_executor::traits::{MatchesFungible, WeightBounds}; parameter_types! { diff --git a/polkadot/xcm/pallet-xcm/src/migration.rs b/polkadot/xcm/pallet-xcm/src/migration.rs index 08809f0d2f2e674e35321910d713eed8362b66b7..e28ca56563c66909e196e6c4e7751229b1406dcd 100644 --- a/polkadot/xcm/pallet-xcm/src/migration.rs +++ b/polkadot/xcm/pallet-xcm/src/migration.rs @@ -63,10 +63,10 @@ pub mod v1 { /// Version checked migration to v1. /// - /// Wrapped in VersionedRuntimeUpgrade so the pre/post checks don't begin failing after the - /// upgrade is enacted on-chain. + /// Wrapped in [`frame_support::migrations::VersionedMigration`] so the pre/post checks don't + /// begin failing after the upgrade is enacted on-chain. #[cfg(feature = "experimental")] - pub type VersionCheckedMigrateToV1 = frame_support::migrations::VersionedRuntimeUpgrade< + pub type VersionCheckedMigrateToV1 = frame_support::migrations::VersionedMigration< 0, 1, VersionUncheckedMigrateToV1, diff --git a/polkadot/xcm/pallet-xcm/src/mock.rs b/polkadot/xcm/pallet-xcm/src/mock.rs index b56b1af82defd2d21a1deb378508df817483f959..b09bcb80ed671de34eaea0a512b90be7e2b92534 100644 --- a/polkadot/xcm/pallet-xcm/src/mock.rs +++ b/polkadot/xcm/pallet-xcm/src/mock.rs @@ -21,7 +21,7 @@ use frame_support::{ weights::Weight, }; use frame_system::EnsureRoot; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use polkadot_runtime_parachains::origin; use sp_core::H256; use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; diff --git a/polkadot/xcm/pallet-xcm/src/tests.rs b/polkadot/xcm/pallet-xcm/src/tests.rs index 6ff9f1d893c890bed05ee6e84489126a90c07c8b..486887598c7829a5740ab951e8574f9feacb8c44 100644 --- a/polkadot/xcm/pallet-xcm/src/tests.rs +++ b/polkadot/xcm/pallet-xcm/src/tests.rs @@ -24,7 +24,7 @@ use frame_support::{ traits::{Currency, Hooks}, weights::Weight, }; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use sp_runtime::traits::{AccountIdConversion, BlakeTwo256, Hash}; use xcm::{latest::QueryResponseInfo, prelude::*}; use xcm_builder::AllowKnownQueryResponses; diff --git a/polkadot/xcm/src/lib.rs b/polkadot/xcm/src/lib.rs index a012c5f53fbf24cc4ec2c9e202573e3228d13f6d..d3e2baf4f8aa570ffb3722870b3328f1f15c1c03 100644 --- a/polkadot/xcm/src/lib.rs +++ b/polkadot/xcm/src/lib.rs @@ -20,7 +20,8 @@ // necessarily related to FRAME or even Substrate. // // Hence, `no_std` rather than sp-runtime. -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] + extern crate alloc; use derivative::Derivative; @@ -447,11 +448,6 @@ pub mod opaque { pub type VersionedXcm = super::VersionedXcm<()>; } -// A simple trait to get the weight of some object. -pub trait GetWeight { - fn weight(&self) -> latest::Weight; -} - #[test] fn conversion_works() { use latest::prelude::*; diff --git a/polkadot/xcm/src/v2/mod.rs b/polkadot/xcm/src/v2/mod.rs index 8a67b771c9e97844406ff0415967bde7ff3a7ce1..a81468cd4812d9a08baefad6bee85130d172788d 100644 --- a/polkadot/xcm/src/v2/mod.rs +++ b/polkadot/xcm/src/v2/mod.rs @@ -55,7 +55,7 @@ use super::{ NetworkId as NewNetworkId, Response as NewResponse, WeightLimit as NewWeightLimit, Xcm as NewXcm, }, - DoubleEncoded, GetWeight, + DoubleEncoded, }; use alloc::{vec, vec::Vec}; use bounded_collections::{ConstU32, WeakBoundedVec}; @@ -77,7 +77,7 @@ pub use multiasset::{ pub use multilocation::{ Ancestor, AncestorThen, InteriorMultiLocation, Junctions, MultiLocation, Parent, ParentThen, }; -pub use traits::{Error, ExecuteXcm, Outcome, Result, SendError, SendResult, SendXcm}; +pub use traits::{Error, ExecuteXcm, GetWeight, Outcome, Result, SendError, SendResult, SendXcm}; /// Basically just the XCM (more general) version of `ParachainDispatchOrigin`. #[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] diff --git a/polkadot/xcm/src/v2/multilocation.rs b/polkadot/xcm/src/v2/multilocation.rs index 9fb74e8afb35b59ad6231e7d7c8b86b19a537f45..7d6bdece335f5659c9c7afa81dae2373da01c8c5 100644 --- a/polkadot/xcm/src/v2/multilocation.rs +++ b/polkadot/xcm/src/v2/multilocation.rs @@ -238,15 +238,13 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation}; - /// # fn main() { + /// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation}; /// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild)); /// assert_eq!( /// m.match_and_split(&MultiLocation::new(1, X1(PalletInstance(3)))), /// Some(&OnlyChild), /// ); /// assert_eq!(m.match_and_split(&MultiLocation::new(1, Here)), None); - /// # } /// ``` pub fn match_and_split(&self, prefix: &MultiLocation) -> Option<&Junction> { if self.parents != prefix.parents { @@ -260,7 +258,7 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation}; + /// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation}; /// let m = MultiLocation::new(1, X3(PalletInstance(3), OnlyChild, OnlyChild)); /// assert!(m.starts_with(&MultiLocation::new(1, X1(PalletInstance(3))))); /// assert!(!m.starts_with(&MultiLocation::new(1, X1(GeneralIndex(99))))); @@ -279,12 +277,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation}; - /// # fn main() { + /// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation}; /// let mut m = MultiLocation::new(1, X1(Parachain(21))); /// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(())); /// assert_eq!(m, MultiLocation::new(1, X2(Parachain(21), PalletInstance(3)))); - /// # } /// ``` pub fn append_with(&mut self, suffix: Junctions) -> Result<(), Junctions> { if self.interior.len().saturating_add(suffix.len()) > MAX_JUNCTIONS { @@ -302,12 +298,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation}; - /// # fn main() { + /// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation}; /// let mut m = MultiLocation::new(2, X1(PalletInstance(3))); /// assert_eq!(m.prepend_with(MultiLocation::new(1, X2(Parachain(21), OnlyChild))), Ok(())); /// assert_eq!(m, MultiLocation::new(1, X1(PalletInstance(3)))); - /// # } /// ``` pub fn prepend_with(&mut self, mut prefix: MultiLocation) -> Result<(), MultiLocation> { // prefix self (suffix) @@ -839,12 +833,10 @@ impl Junctions { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*}; - /// # fn main() { + /// # use staging_xcm::v2::{Junctions::*, Junction::*}; /// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild); /// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild)); /// assert_eq!(m.match_and_split(&X1(Parachain(2))), None); - /// # } /// ``` pub fn match_and_split(&self, prefix: &Junctions) -> Option<&Junction> { if prefix.len() + 1 != self.len() || !self.starts_with(prefix) { @@ -857,7 +849,7 @@ impl Junctions { /// /// # Example /// ```rust - /// # use xcm::v2::{Junctions::*, Junction::*}; + /// # use staging_xcm::v2::{Junctions::*, Junction::*}; /// let mut j = X3(Parachain(2), PalletInstance(3), OnlyChild); /// assert!(j.starts_with(&X2(Parachain(2), PalletInstance(3)))); /// assert!(j.starts_with(&j)); diff --git a/polkadot/xcm/src/v2/traits.rs b/polkadot/xcm/src/v2/traits.rs index ae03cf5547bad2223d430325b98b469eda8274a8..8173beb19d87c8150f5118082b9cf193482b5e4f 100644 --- a/polkadot/xcm/src/v2/traits.rs +++ b/polkadot/xcm/src/v2/traits.rs @@ -23,6 +23,11 @@ use scale_info::TypeInfo; use super::*; +// A simple trait to get the weight of some object. +pub trait GetWeight { + fn weight(&self) -> sp_weights::Weight; +} + #[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo)] pub enum Error { // Errors that happen due to instructions being executed. These alone are defined in the @@ -273,7 +278,7 @@ pub type SendResult = result::Result<(), SendError>; /// /// # Example /// ```rust -/// # use xcm::v2::prelude::*; +/// # use staging_xcm::v2::prelude::*; /// # use parity_scale_codec::Encode; /// /// /// A sender that only passes the message through and does nothing. diff --git a/polkadot/xcm/src/v3/junctions.rs b/polkadot/xcm/src/v3/junctions.rs index 201a80fb7658c6f1c919b9c16951d949dad4ca00..f7624c91c861259fa6f747e0d8e811a68ac56310 100644 --- a/polkadot/xcm/src/v3/junctions.rs +++ b/polkadot/xcm/src/v3/junctions.rs @@ -437,12 +437,10 @@ impl Junctions { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation}; /// let mut m = X1(Parachain(21)); /// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(())); /// assert_eq!(m, X2(Parachain(21), PalletInstance(3))); - /// # } /// ``` pub fn append_with(&mut self, suffix: impl Into) -> Result<(), Junctions> { let suffix = suffix.into(); @@ -568,12 +566,10 @@ impl Junctions { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*}; /// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild); /// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild)); /// assert_eq!(m.match_and_split(&X1(Parachain(2))), None); - /// # } /// ``` pub fn match_and_split(&self, prefix: &Junctions) -> Option<&Junction> { if prefix.len() + 1 != self.len() { diff --git a/polkadot/xcm/src/v3/mod.rs b/polkadot/xcm/src/v3/mod.rs index ef3306d276fcb05efc663936a031af5f8a9aa558..a428f1277a5fe479422b3dd7bf80d741b267dd20 100644 --- a/polkadot/xcm/src/v3/mod.rs +++ b/polkadot/xcm/src/v3/mod.rs @@ -20,9 +20,9 @@ use super::v2::{ Instruction as OldInstruction, Response as OldResponse, WeightLimit as OldWeightLimit, Xcm as OldXcm, }; -use crate::{DoubleEncoded, GetWeight}; +use crate::DoubleEncoded; use alloc::{vec, vec::Vec}; -use bounded_collections::{parameter_types, BoundedVec, ConstU32}; +use bounded_collections::{parameter_types, BoundedVec}; use core::{ convert::{TryFrom, TryInto}, fmt::Debug, @@ -30,7 +30,8 @@ use core::{ }; use derivative::Derivative; use parity_scale_codec::{ - self, Decode, Encode, Error as CodecError, Input as CodecInput, MaxEncodedLen, + self, decode_vec_with_len, Compact, Decode, Encode, Error as CodecError, Input as CodecInput, + MaxEncodedLen, }; use scale_info::TypeInfo; @@ -54,7 +55,7 @@ pub use traits::{ SendResult, SendXcm, Weight, XcmHash, }; // These parts of XCM v2 are unchanged in XCM v3, and are re-imported here. -pub use super::v2::OriginKind; +pub use super::v2::{GetWeight, OriginKind}; /// This module's XCM version. pub const VERSION: super::Version = 3; @@ -69,13 +70,25 @@ pub type QueryId = u64; #[scale_info(bounds(), skip_type_params(Call))] pub struct Xcm(pub Vec>); -const MAX_INSTRUCTIONS_TO_DECODE: u32 = 100; +const MAX_INSTRUCTIONS_TO_DECODE: u8 = 100; + +environmental::environmental!(instructions_count: u8); impl Decode for Xcm { fn decode(input: &mut I) -> core::result::Result { - let bounded_instructions = - BoundedVec::, ConstU32>::decode(input)?; - Ok(Self(bounded_instructions.into_inner())) + instructions_count::using_once(&mut 0, || { + let number_of_instructions: u32 = >::decode(input)?.into(); + instructions_count::with(|count| { + *count = count.saturating_add(number_of_instructions as u8); + if *count > MAX_INSTRUCTIONS_TO_DECODE { + return Err(CodecError::from("Max instructions exceeded")) + } + Ok(()) + }) + .unwrap_or(Ok(()))?; + let decoded_instructions = decode_vec_with_len(input, number_of_instructions as usize)?; + Ok(Self(decoded_instructions)) + }) } } @@ -186,6 +199,7 @@ pub mod prelude { AssetInstance::{self, *}, BodyId, BodyPart, Error as XcmError, ExecuteXcm, Fungibility::{self, *}, + GetWeight, Instruction::*, InteriorMultiLocation, Junction::{self, *}, @@ -1440,15 +1454,31 @@ mod tests { } #[test] - fn decoding_fails_when_too_many_instructions() { - let small_xcm = Xcm::<()>(vec![ClearOrigin; 20]); - let bytes = small_xcm.encode(); - let decoded_xcm = Xcm::<()>::decode(&mut &bytes[..]); - assert!(matches!(decoded_xcm, Ok(_))); - - let big_xcm = Xcm::<()>(vec![ClearOrigin; 64_000]); - let bytes = big_xcm.encode(); - let decoded_xcm = Xcm::<()>::decode(&mut &bytes[..]); - assert!(matches!(decoded_xcm, Err(CodecError { .. }))); + fn decoding_respects_limit() { + let max_xcm = Xcm::<()>(vec![ClearOrigin; MAX_INSTRUCTIONS_TO_DECODE as usize]); + let encoded = max_xcm.encode(); + assert!(Xcm::<()>::decode(&mut &encoded[..]).is_ok()); + + let big_xcm = Xcm::<()>(vec![ClearOrigin; MAX_INSTRUCTIONS_TO_DECODE as usize + 1]); + let encoded = big_xcm.encode(); + assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err()); + + let nested_xcm = Xcm::<()>(vec![ + DepositReserveAsset { + assets: All.into(), + dest: Here.into(), + xcm: max_xcm, + }; + (MAX_INSTRUCTIONS_TO_DECODE / 2) as usize + ]); + let encoded = nested_xcm.encode(); + assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err()); + + let even_more_nested_xcm = Xcm::<()>(vec![SetAppendix(nested_xcm); 64]); + let encoded = even_more_nested_xcm.encode(); + assert_eq!(encoded.len(), 342530); + // This should not decode since the limit is 100 + assert_eq!(MAX_INSTRUCTIONS_TO_DECODE, 100, "precondition"); + assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err()); } } diff --git a/polkadot/xcm/src/v3/multilocation.rs b/polkadot/xcm/src/v3/multilocation.rs index 07f829d014c0bfdcb8a640ae334df6cb4428e5d7..8a1575d9bc950620e3f411349cdca6ef9db5deef 100644 --- a/polkadot/xcm/src/v3/multilocation.rs +++ b/polkadot/xcm/src/v3/multilocation.rs @@ -265,15 +265,13 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation}; /// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild)); /// assert_eq!( /// m.match_and_split(&MultiLocation::new(1, X1(PalletInstance(3)))), /// Some(&OnlyChild), /// ); /// assert_eq!(m.match_and_split(&MultiLocation::new(1, Here)), None); - /// # } /// ``` pub fn match_and_split(&self, prefix: &MultiLocation) -> Option<&Junction> { if self.parents != prefix.parents { @@ -292,12 +290,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; /// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into(); /// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(())); /// assert_eq!(m, MultiLocation::new(1, X2(Parachain(21), PalletInstance(3)))); - /// # } /// ``` pub fn append_with(&mut self, suffix: impl Into) -> Result<(), Self> { let prefix = core::mem::replace(self, suffix.into()); @@ -313,12 +309,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; /// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into(); /// let r = m.appended_with((Parent, PalletInstance(3))).unwrap(); /// assert_eq!(r, MultiLocation::new(1, X2(Parachain(21), PalletInstance(3)))); - /// # } /// ``` pub fn appended_with(mut self, suffix: impl Into) -> Result { match self.append_with(suffix) { @@ -333,12 +327,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; /// let mut m: MultiLocation = (Parent, Parent, PalletInstance(3)).into(); /// assert_eq!(m.prepend_with((Parent, Parachain(21), OnlyChild)), Ok(())); /// assert_eq!(m, MultiLocation::new(1, X1(PalletInstance(3)))); - /// # } /// ``` pub fn prepend_with(&mut self, prefix: impl Into) -> Result<(), Self> { // prefix self (suffix) @@ -382,12 +374,10 @@ impl MultiLocation { /// /// # Example /// ```rust - /// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; - /// # fn main() { + /// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent}; /// let m: MultiLocation = (Parent, Parent, PalletInstance(3)).into(); /// let r = m.prepended_with((Parent, Parachain(21), OnlyChild)).unwrap(); /// assert_eq!(r, MultiLocation::new(1, X1(PalletInstance(3)))); - /// # } /// ``` pub fn prepended_with(mut self, prefix: impl Into) -> Result { match self.prepend_with(prefix) { diff --git a/polkadot/xcm/src/v3/traits.rs b/polkadot/xcm/src/v3/traits.rs index 128be42c2a2b335adcf5414a0228e6001aeaa2e5..a3cbeada91bd258545664b72b79d88ff7ca09f4c 100644 --- a/polkadot/xcm/src/v3/traits.rs +++ b/polkadot/xcm/src/v3/traits.rs @@ -449,8 +449,8 @@ pub type SendResult = result::Result<(T, MultiAssets), SendError>; /// # Example /// ```rust /// # use parity_scale_codec::Encode; -/// # use xcm::v3::{prelude::*, Weight}; -/// # use xcm::VersionedXcm; +/// # use staging_xcm::v3::{prelude::*, Weight}; +/// # use staging_xcm::VersionedXcm; /// # use std::convert::Infallible; /// /// /// A sender that only passes the message through and does nothing. diff --git a/polkadot/xcm/xcm-builder/Cargo.toml b/polkadot/xcm/xcm-builder/Cargo.toml index ea44ce9aa73e660f89dd1ab6b1a43d49f8b74ba8..1f0e1cf347758b01f7a06c65f75d6caf7944aa51 100644 --- a/polkadot/xcm/xcm-builder/Cargo.toml +++ b/polkadot/xcm/xcm-builder/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xcm-builder" +name = "staging-xcm-builder" description = "Tools & types for building with XCM and its executor." authors.workspace = true edition.workspace = true @@ -10,8 +10,8 @@ version = "1.0.0" impl-trait-for-tuples = "0.2.1" parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -xcm = { path = "..", default-features = false } -xcm-executor = { path = "../xcm-executor", default-features = false } +xcm = { package = "staging-xcm", path = "..", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../xcm-executor", default-features = false } sp-std = { path = "../../../substrate/primitives/std", default-features = false } sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false } sp-io = { path = "../../../substrate/primitives/io", default-features = false } @@ -23,7 +23,7 @@ pallet-transaction-payment = { path = "../../../substrate/frame/transaction-paym log = { version = "0.4.17", default-features = false } # Polkadot dependencies -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain-primitives = { path = "../../parachain", default-features = false } [dev-dependencies] primitive-types = "0.12.1" @@ -45,7 +45,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-salary/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "polkadot-test-runtime/runtime-benchmarks", "primitives/runtime-benchmarks", @@ -58,7 +58,7 @@ std = [ "log/std", "pallet-transaction-payment/std", "parity-scale-codec/std", - "polkadot-parachain/std", + "polkadot-parachain-primitives/std", "scale-info/std", "sp-arithmetic/std", "sp-io/std", diff --git a/polkadot/xcm/xcm-builder/src/barriers.rs b/polkadot/xcm/xcm-builder/src/barriers.rs index 353e111b813b66e95fd7a0e7876ca9658afe0c94..0d04e0971bf7bbd4be0f32b088d5a518f4d58030 100644 --- a/polkadot/xcm/xcm-builder/src/barriers.rs +++ b/polkadot/xcm/xcm-builder/src/barriers.rs @@ -21,7 +21,7 @@ use frame_support::{ ensure, traits::{Contains, Get, ProcessMessageError}, }; -use polkadot_parachain::primitives::IsSystem; +use polkadot_parachain_primitives::primitives::IsSystem; use sp_std::{cell::Cell, marker::PhantomData, ops::ControlFlow, result::Result}; use xcm::prelude::*; use xcm_executor::traits::{CheckSuspension, OnResponse, Properties, ShouldExecute}; diff --git a/polkadot/xcm/xcm-builder/src/currency_adapter.rs b/polkadot/xcm/xcm-builder/src/currency_adapter.rs index 4dbd4fe8bcd0342d2bfe3722c2900f01f613bcf6..23dc7958fe15426dbec058cdcd01dc1f9b34a126 100644 --- a/polkadot/xcm/xcm-builder/src/currency_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/currency_adapter.rs @@ -53,7 +53,7 @@ impl From for XcmError { /// use frame_support::{parameter_types, PalletId}; /// use sp_runtime::traits::{AccountIdConversion, TrailingZeroInput}; /// use xcm::latest::prelude::*; -/// use xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete}; +/// use staging_xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete}; /// /// /// Our chain's account id. /// type AccountId = sp_runtime::AccountId32; diff --git a/polkadot/xcm/xcm-builder/src/matcher.rs b/polkadot/xcm/xcm-builder/src/matcher.rs index 4a3c896a159ff81601dcbd9fa07e04975aaffb64..9da135dae31ea3360b67b54558b82a93427d9cc5 100644 --- a/polkadot/xcm/xcm-builder/src/matcher.rs +++ b/polkadot/xcm/xcm-builder/src/matcher.rs @@ -50,7 +50,7 @@ impl<'a, Call> CreateMatcher for &'a mut [Instruction] { /// ```rust /// use frame_support::traits::ProcessMessageError; /// use xcm::latest::Instruction; -/// use xcm_builder::{CreateMatcher, MatchXcm}; +/// use staging_xcm_builder::{CreateMatcher, MatchXcm}; /// /// let mut msg = [Instruction::<()>::ClearOrigin]; /// let res = msg diff --git a/polkadot/xcm/xcm-builder/src/matches_token.rs b/polkadot/xcm/xcm-builder/src/matches_token.rs index ddb25799be62dc3ddf6e3f0850bdbe18b29a2165..b6a320d89316a50ec2c9554c1e71f2ace1412792 100644 --- a/polkadot/xcm/xcm-builder/src/matches_token.rs +++ b/polkadot/xcm/xcm-builder/src/matches_token.rs @@ -33,7 +33,7 @@ use xcm_executor::traits::{MatchesFungible, MatchesNonFungible}; /// /// ``` /// use xcm::latest::{MultiLocation, Parent}; -/// use xcm_builder::IsConcrete; +/// use staging_xcm_builder::IsConcrete; /// use xcm_executor::traits::MatchesFungible; /// /// frame_support::parameter_types! { @@ -71,7 +71,7 @@ impl, I: TryFrom> MatchesNonFungible for /// /// ``` /// use xcm::latest::prelude::*; -/// use xcm_builder::IsAbstract; +/// use staging_xcm_builder::IsAbstract; /// use xcm_executor::traits::{MatchesFungible, MatchesNonFungible}; /// /// frame_support::parameter_types! { diff --git a/polkadot/xcm/xcm-builder/src/origin_conversion.rs b/polkadot/xcm/xcm-builder/src/origin_conversion.rs index 112b26869a998f54f91bf67ab4d4f7b673d92d4d..cced7dedf62d234e9bec51f57292a77a6e365351 100644 --- a/polkadot/xcm/xcm-builder/src/origin_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/origin_conversion.rs @@ -18,7 +18,7 @@ use frame_support::traits::{EnsureOrigin, Get, GetBacking, OriginTrait}; use frame_system::RawOrigin as SystemRawOrigin; -use polkadot_parachain::primitives::IsSystem; +use polkadot_parachain_primitives::primitives::IsSystem; use sp_runtime::traits::TryConvert; use sp_std::marker::PhantomData; use xcm::latest::{BodyId, BodyPart, Junction, Junctions::*, MultiLocation, NetworkId, OriginKind}; diff --git a/polkadot/xcm/xcm-builder/src/pay.rs b/polkadot/xcm/xcm-builder/src/pay.rs index e36d26e425be3d0981e80ff93127e07a9c522805..39e09e056772ed1318a05ecb948859fdebb62bc6 100644 --- a/polkadot/xcm/xcm-builder/src/pay.rs +++ b/polkadot/xcm/xcm-builder/src/pay.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -193,7 +193,7 @@ pub struct LocatableAssetId { pub location: MultiLocation, } -/// Adapter `struct` which implements a conversion from any `AssetKind` into a [`LocatableAsset`] +/// Adapter `struct` which implements a conversion from any `AssetKind` into a [`LocatableAssetId`] /// value using a fixed `Location` for the `location` field. pub struct FixedLocation(sp_std::marker::PhantomData); impl, AssetKind: Into> Convert diff --git a/polkadot/xcm/xcm-builder/src/process_xcm_message.rs b/polkadot/xcm/xcm-builder/src/process_xcm_message.rs index 8130d1732935da4629b71d2421c00bdb9d5e5b9c..dba45a8310aca1cedac249a01eb0ded7435be98a 100644 --- a/polkadot/xcm/xcm-builder/src/process_xcm_message.rs +++ b/polkadot/xcm/xcm-builder/src/process_xcm_message.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify @@ -26,7 +26,7 @@ use sp_std::{fmt::Debug, marker::PhantomData}; use sp_weights::{Weight, WeightMeter}; use xcm::prelude::*; -/// A message processor that delegates execution to an [`XcmExecutor`]. +/// A message processor that delegates execution to an `XcmExecutor`. pub struct ProcessXcmMessage( PhantomData<(MessageOrigin, XcmExecutor, Call)>, ); @@ -110,7 +110,7 @@ mod tests { // Errors if we stay below a weight limit of 1000. for i in 0..10 { - let meter = &mut WeightMeter::from_limit((i * 10).into()); + let meter = &mut WeightMeter::with_limit((i * 10).into()); let mut id = [0; 32]; assert_err!( Processor::process_message(msg, ORIGIN, meter, &mut id), @@ -120,7 +120,7 @@ mod tests { } // Works with a limit of 1000. - let meter = &mut WeightMeter::from_limit(1000.into()); + let meter = &mut WeightMeter::with_limit(1000.into()); let mut id = [0; 32]; assert_ok!(Processor::process_message(msg, ORIGIN, meter, &mut id)); assert_eq!(meter.consumed(), 1000.into()); @@ -150,6 +150,6 @@ mod tests { } fn process_raw(raw: &[u8]) -> Result { - Processor::process_message(raw, ORIGIN, &mut WeightMeter::max_limit(), &mut [0; 32]) + Processor::process_message(raw, ORIGIN, &mut WeightMeter::new(), &mut [0; 32]) } } diff --git a/polkadot/xcm/xcm-builder/src/tests/mock.rs b/polkadot/xcm/xcm-builder/src/tests/mock.rs index 0e7b748106efefaf87af4e7b5772ffa7ddfc3f1d..e73b62f007314ae06034f35030e4474cc290183d 100644 --- a/polkadot/xcm/xcm-builder/src/tests/mock.rs +++ b/polkadot/xcm/xcm-builder/src/tests/mock.rs @@ -28,11 +28,10 @@ pub use crate::{ use frame_support::traits::{ContainsPair, Everything}; pub use frame_support::{ dispatch::{ - DispatchError, DispatchInfo, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo, - Parameter, PostDispatchInfo, + DispatchInfo, DispatchResultWithPostInfo, GetDispatchInfo, Parameter, PostDispatchInfo, }, ensure, match_types, parameter_types, - sp_runtime::DispatchErrorWithPostInfo, + sp_runtime::{traits::Dispatchable, DispatchError, DispatchErrorWithPostInfo}, traits::{ConstU32, Contains, Get, IsInVec}, }; pub use parity_scale_codec::{Decode, Encode}; diff --git a/polkadot/xcm/xcm-builder/src/weight.rs b/polkadot/xcm/xcm-builder/src/weight.rs index f1c14a4c65176b6e427e6fdfdd47e8775707c04a..c16c52939a38bfb62434e7d7c9a994ac54f35dd9 100644 --- a/polkadot/xcm/xcm-builder/src/weight.rs +++ b/polkadot/xcm/xcm-builder/src/weight.rs @@ -73,7 +73,7 @@ where W: XcmWeightInfo, C: Decode + GetDispatchInfo, M: Get, - Instruction: xcm::GetWeight, + Instruction: xcm::latest::GetWeight, { fn weight(message: &mut Xcm) -> Result { log::trace!(target: "xcm::weight", "WeightInfoBounds message: {:?}", message); @@ -90,7 +90,7 @@ where W: XcmWeightInfo, C: Decode + GetDispatchInfo, M: Get, - Instruction: xcm::GetWeight, + Instruction: xcm::latest::GetWeight, { fn weight_with_limit(message: &Xcm, instrs_limit: &mut u32) -> Result { let mut r: Weight = Weight::zero(); @@ -104,7 +104,6 @@ where instruction: &Instruction, instrs_limit: &mut u32, ) -> Result { - use xcm::GetWeight; let instr_weight = match instruction { Transact { require_weight_at_most, .. } => *require_weight_at_most, SetErrorHandler(xcm) | SetAppendix(xcm) => Self::weight_with_limit(xcm, instrs_limit)?, diff --git a/polkadot/xcm/xcm-builder/tests/mock/mod.rs b/polkadot/xcm/xcm-builder/tests/mock/mod.rs index f799be7e401309dd5c12db2f64a1c6cf808411ef..363748940ca624e12212733a897db3a1d840c531 100644 --- a/polkadot/xcm/xcm-builder/tests/mock/mod.rs +++ b/polkadot/xcm/xcm-builder/tests/mock/mod.rs @@ -25,11 +25,13 @@ use primitive_types::H256; use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; use sp_std::cell::RefCell; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use polkadot_runtime_parachains::{configuration, origin, shared}; use xcm::latest::{opaque, prelude::*}; use xcm_executor::XcmExecutor; +use staging_xcm_builder as xcm_builder; + use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, diff --git a/polkadot/xcm/xcm-builder/tests/scenarios.rs b/polkadot/xcm/xcm-builder/tests/scenarios.rs index 3e735720aa7620ce4d18450e55eff90f83101db3..426efcaccdbaf7f2dec0894e8b615bd0e199c188 100644 --- a/polkadot/xcm/xcm-builder/tests/scenarios.rs +++ b/polkadot/xcm/xcm-builder/tests/scenarios.rs @@ -20,7 +20,7 @@ use mock::{ fake_message_hash, kusama_like_with_balances, AccountId, Balance, Balances, BaseXcmWeight, System, XcmConfig, CENTS, }; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use sp_runtime::traits::AccountIdConversion; use xcm::latest::prelude::*; use xcm_executor::XcmExecutor; diff --git a/polkadot/xcm/xcm-executor/Cargo.toml b/polkadot/xcm/xcm-executor/Cargo.toml index 7a7eb75a80e73eb1c38acbe26aa9f353f33a7ab1..902f55901d6c8195ac6af2a44ddb68a9ab177768 100644 --- a/polkadot/xcm/xcm-executor/Cargo.toml +++ b/polkadot/xcm/xcm-executor/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xcm-executor" +name = "staging-xcm-executor" description = "An abstract and configurable XCM message executor." authors.workspace = true edition.workspace = true @@ -10,7 +10,7 @@ version = "1.0.0" impl-trait-for-tuples = "0.2.2" environmental = { version = "1.1.4", default-features = false } parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } -xcm = { path = "..", default-features = false } +xcm = { package = "staging-xcm", path = "..", default-features = false } sp-std = { path = "../../../substrate/primitives/std", default-features = false } sp-io = { path = "../../../substrate/primitives/io", default-features = false } sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false } diff --git a/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml b/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml index d1db6cccddc185b7ad6c03563f45549f06fc5ae2..d869fc6f2dcd2a72d0e20d80a890ebf89a9114cf 100644 --- a/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml @@ -20,8 +20,8 @@ sp-consensus = { path = "../../../../substrate/primitives/consensus/common" } sp-keyring = { path = "../../../../substrate/primitives/keyring" } sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false } sp-state-machine = { path = "../../../../substrate/primitives/state-machine" } -xcm = { path = "../..", default-features = false } -xcm-executor = { path = ".." } +xcm = { package = "staging-xcm", path = "../..", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = ".." } sp-tracing = { path = "../../../../substrate/primitives/tracing" } [features] diff --git a/polkadot/xcm/xcm-executor/src/assets.rs b/polkadot/xcm/xcm-executor/src/assets.rs index d8d8936df33187388522a705df08847a73f63245..33f2ff218c732ccc04c2950f1798a1ec65a89330 100644 --- a/polkadot/xcm/xcm-executor/src/assets.rs +++ b/polkadot/xcm/xcm-executor/src/assets.rs @@ -446,7 +446,7 @@ impl Assets { /// Example: /// /// ``` - /// use xcm_executor::Assets; + /// use staging_xcm_executor::Assets; /// use xcm::latest::prelude::*; /// let assets_i_have: Assets = vec![ (Here, 100).into(), ([0; 32], 100).into() ].into(); /// let assets_they_want: MultiAssetFilter = vec![ (Here, 200).into(), ([0; 32], 50).into() ].into(); diff --git a/polkadot/xcm/xcm-executor/src/config.rs b/polkadot/xcm/xcm-executor/src/config.rs index 1fc5cef39215380e2015c8d9d5dd273f3e15a87a..2ff12cd7a5399f442fc1882e534e914703a91df6 100644 --- a/polkadot/xcm/xcm-executor/src/config.rs +++ b/polkadot/xcm/xcm-executor/src/config.rs @@ -20,9 +20,10 @@ use crate::traits::{ WeightTrader, }; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, Parameter, PostDispatchInfo}, + dispatch::{GetDispatchInfo, Parameter, PostDispatchInfo}, traits::{Contains, ContainsPair, Get, PalletsInfoAccess}, }; +use sp_runtime::traits::Dispatchable; use xcm::prelude::*; /// The trait to parameterize the `XcmExecutor`. diff --git a/polkadot/xcm/xcm-executor/src/traits/conversion.rs b/polkadot/xcm/xcm-executor/src/traits/conversion.rs index dac099ffaf8e400a7d75cbd9009482ab375ea5db..1fcdf21405784860f39a51f2e7b1a7b1e0baa459 100644 --- a/polkadot/xcm/xcm-executor/src/traits/conversion.rs +++ b/polkadot/xcm/xcm-executor/src/traits/conversion.rs @@ -46,7 +46,7 @@ impl ConvertLocation for Tuple { /// /// ```rust /// # use xcm::latest::{MultiLocation, Junctions, Junction, OriginKind}; -/// # use xcm_executor::traits::ConvertOrigin; +/// # use staging_xcm_executor::traits::ConvertOrigin; /// // A convertor that will bump the para id and pass it to the next one. /// struct BumpParaId; /// impl ConvertOrigin for BumpParaId { diff --git a/polkadot/xcm/xcm-executor/src/traits/on_response.rs b/polkadot/xcm/xcm-executor/src/traits/on_response.rs index b0f8b35bb98f430c8c89d54c8be05f92ab2b9559..3558160dc87d37acc03833518875d980a458f4e2 100644 --- a/polkadot/xcm/xcm-executor/src/traits/on_response.rs +++ b/polkadot/xcm/xcm-executor/src/traits/on_response.rs @@ -16,12 +16,10 @@ use crate::Xcm; use core::result; -use frame_support::{ - dispatch::fmt::Debug, - pallet_prelude::{Get, TypeInfo}, -}; +use frame_support::pallet_prelude::{Get, TypeInfo}; use parity_scale_codec::{FullCodec, MaxEncodedLen}; use sp_arithmetic::traits::Zero; +use sp_std::fmt::Debug; use xcm::latest::{ Error as XcmError, InteriorMultiLocation, MultiLocation, QueryId, Response, Result as XcmResult, Weight, XcmContext, diff --git a/polkadot/xcm/xcm-simulator/Cargo.toml b/polkadot/xcm/xcm-simulator/Cargo.toml index cde8564977802f729c0ad86e0ce8c53d7c81cf7e..eedcfa0032af41d2cb69844c54048d8abb5137c9 100644 --- a/polkadot/xcm/xcm-simulator/Cargo.toml +++ b/polkadot/xcm/xcm-simulator/Cargo.toml @@ -14,9 +14,9 @@ frame-support = { path = "../../../substrate/frame/support" } sp-io = { path = "../../../substrate/primitives/io" } sp-std = { path = "../../../substrate/primitives/std" } -xcm = { path = ".." } -xcm-executor = { path = "../xcm-executor" } -xcm-builder = { path = "../xcm-builder" } +xcm = { package = "staging-xcm", path = ".." } +xcm-executor = { package = "staging-xcm-executor", path = "../xcm-executor" } +xcm-builder = { package = "staging-xcm-builder", path = "../xcm-builder" } polkadot-core-primitives = { path = "../../core-primitives" } -polkadot-parachain = { path = "../../parachain" } +polkadot-parachain-primitives = { path = "../../parachain" } polkadot-runtime-parachains = { path = "../../runtime/parachains" } diff --git a/polkadot/xcm/xcm-simulator/example/Cargo.toml b/polkadot/xcm/xcm-simulator/example/Cargo.toml index 06635938e1a666e1082782b10bd4cf2b0a8253e6..9c48b11f6226fd4a1af2a241cee91f37c010d1a1 100644 --- a/polkadot/xcm/xcm-simulator/example/Cargo.toml +++ b/polkadot/xcm/xcm-simulator/example/Cargo.toml @@ -22,14 +22,14 @@ sp-runtime = { path = "../../../../substrate/primitives/runtime" } sp-io = { path = "../../../../substrate/primitives/io" } sp-tracing = { path = "../../../../substrate/primitives/tracing" } -xcm = { path = "../.." } +xcm = { package = "staging-xcm", path = "../.." } xcm-simulator = { path = ".." } -xcm-executor = { path = "../../xcm-executor" } -xcm-builder = { path = "../../xcm-builder" } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm-executor" } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm-builder" } pallet-xcm = { path = "../../pallet-xcm" } polkadot-core-primitives = { path = "../../../core-primitives" } polkadot-runtime-parachains = { path = "../../../runtime/parachains" } -polkadot-parachain = { path = "../../../parachain" } +polkadot-parachain-primitives = { path = "../../../parachain" } [features] default = [] @@ -40,7 +40,7 @@ runtime-benchmarks = [ "pallet-message-queue/runtime-benchmarks", "pallet-uniques/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/polkadot/xcm/xcm-simulator/example/src/parachain.rs b/polkadot/xcm/xcm-simulator/example/src/parachain.rs index 9c4cbe8fcb2d8d501797cca6e6e29b77ea350cda..bc7cba313828b76e6079dcaa9d7ba7f9342a046f 100644 --- a/polkadot/xcm/xcm-simulator/example/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/parachain.rs @@ -34,7 +34,7 @@ use sp_std::prelude::*; use pallet_xcm::XcmPassthrough; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; -use polkadot_parachain::primitives::{ +use polkadot_parachain_primitives::primitives::{ DmpMessageHandler, Id as ParaId, Sibling, XcmpMessageFormat, XcmpMessageHandler, }; use xcm::{latest::prelude::*, VersionedXcm}; diff --git a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs index 6f0e92dc91b9a1c359bb48df9ba18625d867ace7..4e9195a8454f5091dde7bcbf2c841eaaeb148285 100644 --- a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs @@ -26,7 +26,7 @@ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; use sp_runtime::{traits::IdentityLookup, AccountId32}; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use polkadot_runtime_parachains::{ configuration, inclusion::{AggregateMessageOrigin, UmpQueueId}, diff --git a/polkadot/xcm/xcm-simulator/fuzzer/Cargo.toml b/polkadot/xcm/xcm-simulator/fuzzer/Cargo.toml index f585d50645638056495614f01c2fc212c2f6cbe9..0ca57e680d1ddff4ec784f49614d7747ea9cfb74 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/Cargo.toml +++ b/polkadot/xcm/xcm-simulator/fuzzer/Cargo.toml @@ -5,6 +5,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true license.workspace = true +publish = false [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1" } @@ -21,14 +22,14 @@ sp-core = { path = "../../../../substrate/primitives/core" } sp-runtime = { path = "../../../../substrate/primitives/runtime" } sp-io = { path = "../../../../substrate/primitives/io" } -xcm = { path = "../.." } +xcm = { package = "staging-xcm", path = "../.." } xcm-simulator = { path = ".." } -xcm-executor = { path = "../../xcm-executor" } -xcm-builder = { path = "../../xcm-builder" } +xcm-executor = { package = "staging-xcm-executor", path = "../../xcm-executor" } +xcm-builder = { package = "staging-xcm-builder", path = "../../xcm-builder" } pallet-xcm = { path = "../../pallet-xcm" } polkadot-core-primitives = { path = "../../../core-primitives" } polkadot-runtime-parachains = { path = "../../../runtime/parachains" } -polkadot-parachain = { path = "../../../parachain" } +polkadot-parachain-primitives = { path = "../../../parachain" } [features] runtime-benchmarks = [ @@ -37,7 +38,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/fuzz.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/fuzz.rs index 441b9f4d28616fe973192ad4e2a426da14511cf7..0893c7c086f8bc0d7e57647eadcdf87e9c732da0 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/fuzz.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/fuzz.rs @@ -19,7 +19,7 @@ mod relay_chain; use codec::DecodeLimit; use polkadot_core_primitives::AccountId; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use sp_runtime::{traits::AccountIdConversion, BuildStorage}; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs index 3d0b1c82f6911bf6a6650ae1fc98ef74bef22c88..95f875eca06e5c6fcb7d0d5610e1719a5f1b15b5 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -33,7 +33,7 @@ use sp_std::prelude::*; use pallet_xcm::XcmPassthrough; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; -use polkadot_parachain::primitives::{ +use polkadot_parachain_primitives::primitives::{ DmpMessageHandler, Id as ParaId, Sibling, XcmpMessageFormat, XcmpMessageHandler, }; use xcm::{latest::prelude::*, VersionedXcm}; diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs index 32f3b8aa83fba13d7b3778b3603cb2b41d5d45e5..a29ead9e6c3beaed1ef5e625012e3866ef5808f1 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs @@ -26,7 +26,7 @@ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; use sp_runtime::{traits::IdentityLookup, AccountId32}; -use polkadot_parachain::primitives::Id as ParaId; +use polkadot_parachain_primitives::primitives::Id as ParaId; use polkadot_runtime_parachains::{ configuration, inclusion::{AggregateMessageOrigin, UmpQueueId}, diff --git a/polkadot/xcm/xcm-simulator/src/lib.rs b/polkadot/xcm/xcm-simulator/src/lib.rs index cf56784f7d4e228f00a2ef08d07b2f8395670a5e..b38465b3d4a2cb9d2a83b35b2f9f0c2fc484c4a4 100644 --- a/polkadot/xcm/xcm-simulator/src/lib.rs +++ b/polkadot/xcm/xcm-simulator/src/lib.rs @@ -27,7 +27,7 @@ pub use sp_io::{hashing::blake2_256, TestExternalities}; pub use sp_std::{cell::RefCell, collections::vec_deque::VecDeque, marker::PhantomData}; pub use polkadot_core_primitives::BlockNumber as RelayBlockNumber; -pub use polkadot_parachain::primitives::{ +pub use polkadot_parachain_primitives::primitives::{ DmpMessageHandler as DmpMessageHandlerT, Id as ParaId, XcmpMessageFormat, XcmpMessageHandler as XcmpMessageHandlerT, }; @@ -324,7 +324,7 @@ macro_rules! decl_test_network { let mut _id = [0; 32]; let r = <$relay_chain>::process_message( encoded.as_slice(), para_id, - &mut $crate::WeightMeter::max_limit(), + &mut $crate::WeightMeter::new(), &mut _id, ); match r { diff --git a/polkadot/zombienet_tests/functional/0003-parachains-garbage-candidate.toml b/polkadot/zombienet_tests/functional/0004-parachains-garbage-candidate.toml similarity index 100% rename from polkadot/zombienet_tests/functional/0003-parachains-garbage-candidate.toml rename to polkadot/zombienet_tests/functional/0004-parachains-garbage-candidate.toml diff --git a/polkadot/zombienet_tests/functional/0003-parachains-garbage-candidate.zndsl b/polkadot/zombienet_tests/functional/0004-parachains-garbage-candidate.zndsl similarity index 98% rename from polkadot/zombienet_tests/functional/0003-parachains-garbage-candidate.zndsl rename to polkadot/zombienet_tests/functional/0004-parachains-garbage-candidate.zndsl index c4fd3ee7c55a851770af9650f1148a27b2bee6d4..be2ae9504b89bc1728c12e7521b11526e9793363 100644 --- a/polkadot/zombienet_tests/functional/0003-parachains-garbage-candidate.zndsl +++ b/polkadot/zombienet_tests/functional/0004-parachains-garbage-candidate.zndsl @@ -1,5 +1,5 @@ Description: Test dispute finality lag when 1/3 of parachain validators always attempt to include an invalid block -Network: ./0003-parachains-garbage-candidate.toml +Network: ./0004-parachains-garbage-candidate.toml Creds: config # Check authority status. diff --git a/polkadot/zombienet_tests/functional/0004-parachains-disputes-past-session.toml b/polkadot/zombienet_tests/functional/0005-parachains-disputes-past-session.toml similarity index 100% rename from polkadot/zombienet_tests/functional/0004-parachains-disputes-past-session.toml rename to polkadot/zombienet_tests/functional/0005-parachains-disputes-past-session.toml diff --git a/polkadot/zombienet_tests/functional/0004-parachains-disputes-past-session.zndsl b/polkadot/zombienet_tests/functional/0005-parachains-disputes-past-session.zndsl similarity index 97% rename from polkadot/zombienet_tests/functional/0004-parachains-disputes-past-session.zndsl rename to polkadot/zombienet_tests/functional/0005-parachains-disputes-past-session.zndsl index bf3fb0ac9de93a8be71ad78650d6de9fe373b772..bc3674f4f53ddef9ef87d1a2f301ed7a49d7161d 100644 --- a/polkadot/zombienet_tests/functional/0004-parachains-disputes-past-session.zndsl +++ b/polkadot/zombienet_tests/functional/0005-parachains-disputes-past-session.zndsl @@ -1,5 +1,5 @@ Description: Past-session dispute slashing -Network: ./0004-parachains-disputes-past-session.toml +Network: ./0005-parachains-disputes-past-session.toml Creds: config # Ensure nodes are up and running diff --git a/substrate/bin/node-template/docs/rust-setup.md b/substrate/bin/node-template/docs/rust-setup.md index 2755966e3ae0f8b6099314efc0da9ec03ae08508..133db0277bb4b42be891dcc58bf04d3ada8b1bd4 100644 --- a/substrate/bin/node-template/docs/rust-setup.md +++ b/substrate/bin/node-template/docs/rust-setup.md @@ -2,7 +2,7 @@ title: Installation --- -This guide is for reference only, please check the latest information on getting starting with Substrate +This guide is for reference only, please check the latest information on getting started with Substrate [here](https://docs.substrate.io/main-docs/install/). This page will guide you through the **2 steps** needed to prepare a computer for **Substrate** development. @@ -74,7 +74,7 @@ brew install openssl ### Windows **_PLEASE NOTE:_** Native Windows development of Substrate is _not_ very well supported! It is _highly_ -recommend to use [Windows Subsystem Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) +recommended to use [Windows Subsystem Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (WSL) and follow the instructions for [Ubuntu/Debian](#ubuntudebian). Please refer to the separate [guide for native Windows development](https://docs.substrate.io/main-docs/install/windows/). diff --git a/substrate/bin/node-template/node/Cargo.toml b/substrate/bin/node-template/node/Cargo.toml index 834668468f7936aa8ef6f406f88802bb55d801be..38eba5ee0e1f2e9119f9b93cfb64eb4795aa7656 100644 --- a/substrate/bin/node-template/node/Cargo.toml +++ b/substrate/bin/node-template/node/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] name = "node-template" [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } futures = { version = "0.3.21", features = ["thread-pool"]} sc-cli = { path = "../../../client/cli" } diff --git a/substrate/bin/node-template/pallets/template/src/lib.rs b/substrate/bin/node-template/pallets/template/src/lib.rs index edf7769bab7d3e852256b2d338c565b28117a600..4a2e53baa774ee5ca333602024d458aa078f9c10 100644 --- a/substrate/bin/node-template/pallets/template/src/lib.rs +++ b/substrate/bin/node-template/pallets/template/src/lib.rs @@ -1,105 +1,201 @@ +//! # Template Pallet +//! +//! A pallet with minimal functionality to help developers understand the essential components of +//! writing a FRAME pallet. It is typically used in beginner tutorials or in Substrate template +//! nodes as a starting point for creating a new pallet and **not meant to be used in production**. +//! +//! ## Overview +//! +//! This template pallet contains basic examples of: +//! - declaring a storage item that stores a single `u32` value +//! - declaring and using events +//! - declaring and using errors +//! - a dispatchable function that allows a user to set a new value to storage and emits an event +//! upon success +//! - another dispatchable function that causes a custom error to be thrown +//! +//! Each pallet section is annotated with an attribute using the `#[pallet::...]` procedural macro. +//! This macro generates the necessary code for a pallet to be aggregated into a FRAME runtime. +//! +//! Learn more about FRAME macros [here](https://docs.substrate.io/reference/frame-macros/). +//! +//! ### Pallet Sections +//! +//! The pallet sections in this template are: +//! +//! - A **configuration trait** that defines the types and parameters which the pallet depends on +//! (denoted by the `#[pallet::config]` attribute). See: [`Config`]. +//! - A **means to store pallet-specific data** (denoted by the `#[pallet::storage]` attribute). +//! See: [`storage_types`]. +//! - A **declaration of the events** this pallet emits (denoted by the `#[pallet::event]` +//! attribute). See: [`Event`]. +//! - A **declaration of the errors** that this pallet can throw (denoted by the `#[pallet::error]` +//! attribute). See: [`Error`]. +//! - A **set of dispatchable functions** that define the pallet's functionality (denoted by the +//! `#[pallet::call]` attribute). See: [`dispatchables`]. +//! +//! Run `cargo doc --package pallet-template --open` to view this pallet's documentation. + +// We make sure this pallet uses `no_std` for compiling to Wasm. #![cfg_attr(not(feature = "std"), no_std)] -/// Edit this file to define custom logic or remove it if it is not needed. -/// Learn more about FRAME and the core library of Substrate FRAME pallets: -/// +// Re-export pallet items so that they can be accessed from the crate namespace. pub use pallet::*; +// FRAME pallets require their own "mock runtimes" to be able to run unit tests. This module +// contains a mock runtime specific for testing this pallet's functionality. #[cfg(test)] mod mock; +// This module contains the unit tests for this pallet. +// Learn about pallet unit testing here: https://docs.substrate.io/test/unit-testing/ #[cfg(test)] mod tests; +// Every callable function or "dispatchable" a pallet exposes must have weight values that correctly +// estimate a dispatchable's execution time. The benchmarking module is used to calculate weights +// for each dispatchable and generates this pallet's weight.rs file. Learn more about benchmarking here: https://docs.substrate.io/test/benchmark/ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; pub mod weights; pub use weights::*; +// All pallet logic is defined in its own module and must be annotated by the `pallet` attribute. #[frame_support::pallet] pub mod pallet { + // Import various useful types required by all FRAME pallets. use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; + // The `Pallet` struct serves as a placeholder to implement traits, methods and dispatchables + // (`Call`s) in this pallet. #[pallet::pallet] pub struct Pallet(_); - /// Configure the pallet by specifying the parameters and types on which it depends. + /// The pallet's configuration trait. + /// + /// All our types and constants a pallet depends on must be declared here. + /// These types are defined generically and made concrete when the pallet is declared in the + /// `runtime/src/lib.rs` file of your chain. #[pallet::config] pub trait Config: frame_system::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. + /// The overarching runtime event type. type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Type representing the weight of this pallet + /// A type representing the weights required by the dispatchables of this pallet. type WeightInfo: WeightInfo; } - // The pallet's runtime storage items. - // https://docs.substrate.io/main-docs/build/runtime-storage/ + /// A storage item for this pallet. + /// + /// In this template, we are declaring a storage item called `Something` that stores a single + /// `u32` value. Learn more about runtime storage here: + /// The [`getter`] macro generates a function to conveniently retrieve the value from storage. #[pallet::storage] #[pallet::getter(fn something)] - // Learn more about declaring storage items: - // https://docs.substrate.io/main-docs/build/runtime-storage/#declaring-storage-items pub type Something = StorageValue<_, u32>; - // Pallets use events to inform users when important changes are made. - // https://docs.substrate.io/main-docs/build/events-errors/ + /// Events that functions in this pallet can emit. + /// + /// Events are a simple means of indicating to the outside world (such as dApps, chain explorers + /// or other users) that some notable update in the runtime has occurred. In a FRAME pallet, the + /// documentation for each event field and its parameters is added to a node's metadata so it + /// can be used by external interfaces or tools. + /// + /// The `generate_deposit` macro generates a function on `Pallet` called `deposit_event` which + /// will convert the event type of your pallet into `RuntimeEvent` (declared in the pallet's + /// [`Config`] trait) and deposit it using [`frame_system::Pallet::deposit_event`]. #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// Event documentation should end with an array that provides descriptive names for event - /// parameters. [something, who] - SomethingStored { something: u32, who: T::AccountId }, + /// A user has successfully set a new value. + SomethingStored { + /// The new value set. + something: u32, + /// The account who set the new value. + who: T::AccountId, + }, } - // Errors inform users that something went wrong. + /// Errors that can be returned by this pallet. + /// + /// Errors tell users that something went wrong so it's important that their naming is + /// informative. Similar to events, error documentation is added to a node's metadata so it's + /// equally important that they have helpful documentation associated with them. + /// + /// This type of runtime error can be up to 4 bytes in size should you want to return additional + /// information. #[pallet::error] pub enum Error { - /// Error names should be descriptive. + /// The value retrieved was `None` as no value was previously set. NoneValue, - /// Errors should have helpful documentation associated with them. + /// There was an attempt to increment the value in storage over `u32::MAX`. StorageOverflow, } - // Dispatchable functions allows users to interact with the pallet and invoke state changes. - // These functions materialize as "extrinsics", which are often compared to transactions. - // Dispatchable functions must be annotated with a weight and must return a DispatchResult. + /// The pallet's dispatchable functions ([`Call`]s). + /// + /// Dispatchable functions allows users to interact with the pallet and invoke state changes. + /// These functions materialize as "extrinsics", which are often compared to transactions. + /// They must always return a `DispatchResult` and be annotated with a weight and call index. + /// + /// The [`call_index`] macro is used to explicitly + /// define an index for calls in the [`Call`] enum. This is useful for pallets that may + /// introduce new dispatchables over time. If the order of a dispatchable changes, its index + /// will also change which will break backwards compatibility. + /// + /// The [`weight`] macro is used to assign a weight to each call. #[pallet::call] impl Pallet { - /// An example dispatchable that takes a singles value as a parameter, writes the value to - /// storage and emits an event. This function must be dispatched by a signed extrinsic. + /// An example dispatchable that takes a single u32 value as a parameter, writes the value + /// to storage and emits an event. + /// + /// It checks that the _origin_ for this call is _Signed_ and returns a dispatch + /// error if it isn't. Learn more about origins here: #[pallet::call_index(0)] #[pallet::weight(T::WeightInfo::do_something())] pub fn do_something(origin: OriginFor, something: u32) -> DispatchResult { // Check that the extrinsic was signed and get the signer. - // This function will return an error if the extrinsic is not signed. - // https://docs.substrate.io/main-docs/build/origins/ let who = ensure_signed(origin)?; // Update storage. - >::put(something); + Something::::put(something); // Emit an event. Self::deposit_event(Event::SomethingStored { something, who }); - // Return a successful DispatchResultWithPostInfo + + // Return a successful `DispatchResult` Ok(()) } /// An example dispatchable that may throw a custom error. + /// + /// It checks that the caller is a signed origin and reads the current value from the + /// `Something` storage item. If a current value exists, it is incremented by 1 and then + /// written back to storage. + /// + /// ## Errors + /// + /// The function will return an error under the following conditions: + /// + /// - If no value has been set ([`Error::NoneValue`]) + /// - If incrementing the value in storage causes an arithmetic overflow + /// ([`Error::StorageOverflow`]) #[pallet::call_index(1)] #[pallet::weight(T::WeightInfo::cause_error())] pub fn cause_error(origin: OriginFor) -> DispatchResult { let _who = ensure_signed(origin)?; // Read a value from storage. - match >::get() { + match Pallet::::something() { // Return an error if the value has not been set. None => Err(Error::::NoneValue.into()), Some(old) => { - // Increment the value read from storage; will error in the event of overflow. + // Increment the value read from storage. This will cause an error in the event + // of overflow. let new = old.checked_add(1).ok_or(Error::::StorageOverflow)?; // Update the value in storage with the incremented result. - >::put(new); + Something::::put(new); Ok(()) }, } diff --git a/substrate/bin/node/bench/Cargo.toml b/substrate/bin/node/bench/Cargo.toml index c98547a33d6f1ac368bfb8dbcdfd91b44ce457b8..a02d7393740aaa4bea4030eedb1e6bcc1028cd70 100644 --- a/substrate/bin/node/bench/Cargo.toml +++ b/substrate/bin/node/bench/Cargo.toml @@ -13,7 +13,7 @@ publish = false [dependencies] array-bytes = "6.1" -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } log = "0.4.17" node-primitives = { path = "../primitives" } node-testing = { path = "../testing" } @@ -21,7 +21,7 @@ kitchensink-runtime = { path = "../runtime" } sc-client-api = { path = "../../../client/api" } sp-runtime = { path = "../../../primitives/runtime" } sp-state-machine = { path = "../../../primitives/state-machine" } -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" derive_more = { version = "0.99.17", default-features = false, features = ["display"] } kvdb = "0.13.0" diff --git a/substrate/bin/node/cli/Cargo.toml b/substrate/bin/node/cli/Cargo.toml index 01e8d87166500096cdd33213c49f6a88dce42487..28701db482d2be3aab69f78d7d4113282d250284 100644 --- a/substrate/bin/node/cli/Cargo.toml +++ b/substrate/bin/node/cli/Cargo.toml @@ -38,9 +38,9 @@ crate-type = ["cdylib", "rlib"] [dependencies] # third-party dependencies array-bytes = "6.1" -clap = { version = "4.2.5", features = ["derive"], optional = true } +clap = { version = "4.4.2", features = ["derive"], optional = true } codec = { package = "parity-scale-codec", version = "3.6.1" } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } futures = "0.3.21" log = "0.4.17" @@ -135,7 +135,7 @@ pallet-timestamp = { path = "../../../frame/timestamp" } substrate-cli-test-utils = { path = "../../../test-utils/cli" } [build-dependencies] -clap = { version = "4.2.5", optional = true } +clap = { version = "4.4.2", optional = true } clap_complete = { version = "4.0.2", optional = true } node-inspect = { path = "../inspect", optional = true} frame-benchmarking-cli = { path = "../../../utils/frame/benchmarking-cli", optional = true} diff --git a/substrate/bin/node/inspect/Cargo.toml b/substrate/bin/node/inspect/Cargo.toml index 59700bca36e277dcca844ef0941be521781e3f66..2b6a5e1aea181df9d920e285522f5b5afe987875 100644 --- a/substrate/bin/node/inspect/Cargo.toml +++ b/substrate/bin/node/inspect/Cargo.toml @@ -13,7 +13,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1" } thiserror = "1.0" sc-cli = { path = "../../../client/cli" } diff --git a/substrate/bin/node/runtime/src/assets_api.rs b/substrate/bin/node/runtime/src/assets_api.rs index cf1a663d70300aa6a4427d3998112c84056e68d2..792ed7c6576bd85485eae9abe84ea17d5749cd13 100644 --- a/substrate/bin/node/runtime/src/assets_api.rs +++ b/substrate/bin/node/runtime/src/assets_api.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/substrate/bin/utils/chain-spec-builder/Cargo.toml b/substrate/bin/utils/chain-spec-builder/Cargo.toml index 0c8bc3b32dc26f295cd78051916910213ab11fa5..fcc97e7809bbf1d96de8d2d270ad6891b2e08107 100644 --- a/substrate/bin/utils/chain-spec-builder/Cargo.toml +++ b/substrate/bin/utils/chain-spec-builder/Cargo.toml @@ -22,7 +22,7 @@ crate-type = ["rlib"] [dependencies] ansi_term = "0.12.1" -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } rand = "0.8" node-cli = { path = "../../node/cli" } sc-chain-spec = { path = "../../../client/chain-spec" } diff --git a/substrate/bin/utils/subkey/Cargo.toml b/substrate/bin/utils/subkey/Cargo.toml index 5c1124d3984badf166cec78fe2d1b4b2920d1fb3..98276863f8deb1c927f289f6fa62d0cb9d84f8f4 100644 --- a/substrate/bin/utils/subkey/Cargo.toml +++ b/substrate/bin/utils/subkey/Cargo.toml @@ -17,5 +17,5 @@ path = "src/main.rs" name = "subkey" [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } sc-cli = { path = "../../../client/cli" } diff --git a/substrate/client/authority-discovery/build.rs b/substrate/client/authority-discovery/build.rs index 00d45f07ae159c3f15d6ea822d02f6dcd75ef2e0..83076ac8c893736cf9c2e0852d515339f8bde7a5 100644 --- a/substrate/client/authority-discovery/build.rs +++ b/substrate/client/authority-discovery/build.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + fn main() { prost_build::compile_protos( &["src/worker/schema/dht-v1.proto", "src/worker/schema/dht-v2.proto"], diff --git a/substrate/client/chain-spec/Cargo.toml b/substrate/client/chain-spec/Cargo.toml index e032e24e7210bd37cca655e1c479019802de7bb6..6acd57ef51683d7d064dec5a652358979fc45481 100644 --- a/substrate/client/chain-spec/Cargo.toml +++ b/substrate/client/chain-spec/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] memmap2 = "0.5.0" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" sc-client-api = { path = "../api" } sc-chain-spec-derive = { path = "derive" } diff --git a/substrate/client/cli/Cargo.toml b/substrate/client/cli/Cargo.toml index 7b827d897e0ab246108bcb54e7f14dbb68ac9196..917cdc04d1d9be07f99c15cfd243ca27e9e8897e 100644 --- a/substrate/client/cli/Cargo.toml +++ b/substrate/client/cli/Cargo.toml @@ -14,8 +14,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = "6.1" -chrono = "0.4.10" -clap = { version = "4.2.5", features = ["derive", "string"] } +chrono = "0.4.27" +clap = { version = "4.4.2", features = ["derive", "string"] } fdlimit = "0.2.1" futures = "0.3.21" libp2p-identity = { version = "0.1.3", features = ["peerid", "ed25519"]} @@ -25,7 +25,7 @@ parity-scale-codec = "3.6.1" rand = "0.8.5" regex = "1.6.0" rpassword = "7.0.0" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" thiserror = "1.0.30" tiny-bip39 = "1.0.0" diff --git a/substrate/client/consensus/babe/rpc/Cargo.toml b/substrate/client/consensus/babe/rpc/Cargo.toml index 0735cac21e7d9afd135ce8a4e73d683de56157ad..bfae5ad3fd0cef556d8180e55452a2cac572b314 100644 --- a/substrate/client/consensus/babe/rpc/Cargo.toml +++ b/substrate/client/consensus/babe/rpc/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } futures = "0.3.21" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } thiserror = "1.0" sc-consensus-babe = { path = ".." } sc-consensus-epochs = { path = "../../epochs" } diff --git a/substrate/client/consensus/beefy/Cargo.toml b/substrate/client/consensus/beefy/Cargo.toml index a5706724ebe11e26ffa7d7acf98d61815860e223..aae5a44d7fa26da98d90b02d1dcb9dbd22faae06 100644 --- a/substrate/client/consensus/beefy/Cargo.toml +++ b/substrate/client/consensus/beefy/Cargo.toml @@ -38,7 +38,7 @@ sp-mmr-primitives = { path = "../../../primitives/merkle-mountain-range" } sp-runtime = { path = "../../../primitives/runtime" } [dev-dependencies] -serde = "1.0.163" +serde = "1.0.188" tempfile = "3.1.0" tokio = "1.22.0" sc-block-builder = { path = "../../block-builder" } diff --git a/substrate/client/consensus/beefy/rpc/Cargo.toml b/substrate/client/consensus/beefy/rpc/Cargo.toml index 1480d87064c703984935b169166dad5d684a9a5c..f9c3b4a99dfe8613f2aecbe7db8068f91a20f79e 100644 --- a/substrate/client/consensus/beefy/rpc/Cargo.toml +++ b/substrate/client/consensus/beefy/rpc/Cargo.toml @@ -14,7 +14,7 @@ futures = "0.3.21" jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } log = "0.4" parking_lot = "0.12.1" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } thiserror = "1.0" sc-consensus-beefy = { path = ".." } sp-consensus-beefy = { path = "../../../../primitives/consensus/beefy" } diff --git a/substrate/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs b/substrate/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs index b8d8cd35434c97ac91a54c6fa73e57e6348f5ddd..71c5c49b3690ccfbd3cb06242d6733528a880964 100644 --- a/substrate/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs +++ b/substrate/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/consensus/grandpa/Cargo.toml b/substrate/client/consensus/grandpa/Cargo.toml index bf6549c6244d2050344e202e702a88046575bc05..dfd9916850e54d85eb53dee3226b6b57ec304a4b 100644 --- a/substrate/client/consensus/grandpa/Cargo.toml +++ b/substrate/client/consensus/grandpa/Cargo.toml @@ -52,7 +52,7 @@ sp-runtime = { path = "../../../primitives/runtime" } [dev-dependencies] assert_matches = "1.3.0" finality-grandpa = { version = "0.16.2", features = ["derive-codec", "test-helpers"] } -serde = "1.0.163" +serde = "1.0.188" tokio = "1.22.0" sc-network = { path = "../../network" } sc-network-test = { path = "../../network/test" } diff --git a/substrate/client/consensus/grandpa/rpc/Cargo.toml b/substrate/client/consensus/grandpa/rpc/Cargo.toml index fe8f17405d9c688371922735d3352267dc6740a8..e2f9e40afb2da661cd5003b4755d7ee425b5ee1a 100644 --- a/substrate/client/consensus/grandpa/rpc/Cargo.toml +++ b/substrate/client/consensus/grandpa/rpc/Cargo.toml @@ -15,7 +15,7 @@ futures = "0.3.16" jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } log = "0.4.8" parity-scale-codec = { version = "3.6.1", features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } thiserror = "1.0" sc-client-api = { path = "../../../api" } sc-consensus-grandpa = { path = ".." } diff --git a/substrate/client/consensus/grandpa/src/warp_proof.rs b/substrate/client/consensus/grandpa/src/warp_proof.rs index 9acf1f2187793c0ad5a722c0481f7cde2b22d77d..ea8114eafd789ec00a909b5535f0659ceea1fbfe 100644 --- a/substrate/client/consensus/grandpa/src/warp_proof.rs +++ b/substrate/client/consensus/grandpa/src/warp_proof.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/executor/runtime-test/src/lib.rs b/substrate/client/executor/runtime-test/src/lib.rs index 2bd2aeeb606ebed10a50743d13cccb6aa08abe39..ec9b2378d4d463b36fdd7370e013ab4de6849226 100644 --- a/substrate/client/executor/runtime-test/src/lib.rs +++ b/substrate/client/executor/runtime-test/src/lib.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #![cfg_attr(not(feature = "std"), no_std)] // Make the WASM binary available. diff --git a/substrate/client/keystore/src/local.rs b/substrate/client/keystore/src/local.rs index 97bc7c71a4a58a9ee317f075e79a5df740ec6093..c77f023e0f0afe0f8e9f0869599720ae22010698 100644 --- a/substrate/client/keystore/src/local.rs +++ b/substrate/client/keystore/src/local.rs @@ -19,10 +19,6 @@ use parking_lot::RwLock; use sp_application_crypto::{AppCrypto, AppPair, IsWrappedBy}; -#[cfg(feature = "bandersnatch-experimental")] -use sp_core::bandersnatch; -#[cfg(feature = "bls-experimental")] -use sp_core::{bls377, bls381}; use sp_core::{ crypto::{ByteArray, ExposeSecret, KeyTypeId, Pair as CorePair, SecretString, VrfSecret}, ecdsa, ed25519, sr25519, @@ -36,6 +32,14 @@ use std::{ sync::Arc, }; +sp_keystore::bandersnatch_experimental_enabled! { +use sp_core::bandersnatch; +} + +sp_keystore::bls_experimental_enabled! { +use sp_core::{bls377, bls381}; +} + use crate::{Error, Result}; /// A local based keystore that is either memory-based or filesystem-based. @@ -132,6 +136,25 @@ impl LocalKeystore { } impl Keystore for LocalKeystore { + fn insert( + &self, + key_type: KeyTypeId, + suri: &str, + public: &[u8], + ) -> std::result::Result<(), ()> { + self.0.write().insert(key_type, suri, public).map_err(|_| ()) + } + + fn keys(&self, key_type: KeyTypeId) -> std::result::Result>, TraitError> { + self.0.read().raw_public_keys(key_type).map_err(|e| e.into()) + } + + fn has_keys(&self, public_keys: &[(Vec, KeyTypeId)]) -> bool { + public_keys + .iter() + .all(|(p, t)| self.0.read().key_phrase_by_type(p, *t).ok().flatten().is_some()) + } + fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec { self.public_keys::(key_type) } @@ -236,140 +259,113 @@ impl Keystore for LocalKeystore { Ok(sig) } - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_public_keys(&self, key_type: KeyTypeId) -> Vec { - self.public_keys::(key_type) - } - - /// Generate a new pair compatible with the 'bandersnatch' signature scheme. - /// - /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_generate_new( - &self, - key_type: KeyTypeId, - seed: Option<&str>, - ) -> std::result::Result { - self.generate_new::(key_type, seed) - } - - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_sign( - &self, - key_type: KeyTypeId, - public: &bandersnatch::Public, - msg: &[u8], - ) -> std::result::Result, TraitError> { - self.sign::(key_type, public, msg) - } - - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_vrf_sign( - &self, - key_type: KeyTypeId, - public: &bandersnatch::Public, - data: &bandersnatch::vrf::VrfSignData, - ) -> std::result::Result, TraitError> { - self.vrf_sign::(key_type, public, data) - } + sp_keystore::bandersnatch_experimental_enabled! { + fn bandersnatch_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.public_keys::(key_type) + } - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_vrf_output( - &self, - key_type: KeyTypeId, - public: &bandersnatch::Public, - input: &bandersnatch::vrf::VrfInput, - ) -> std::result::Result, TraitError> { - self.vrf_output::(key_type, public, input) - } + /// Generate a new pair compatible with the 'bandersnatch' signature scheme. + /// + /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. + fn bandersnatch_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> std::result::Result { + self.generate_new::(key_type, seed) + } - #[cfg(feature = "bandersnatch-experimental")] - fn bandersnatch_ring_vrf_sign( - &self, - key_type: KeyTypeId, - public: &bandersnatch::Public, - data: &bandersnatch::vrf::VrfSignData, - prover: &bandersnatch::ring_vrf::RingProver, - ) -> std::result::Result, TraitError> { - let sig = self - .0 - .read() - .key_pair_by_type::(public, key_type)? - .map(|pair| pair.ring_vrf_sign(data, prover)); - Ok(sig) - } + fn bandersnatch_sign( + &self, + key_type: KeyTypeId, + public: &bandersnatch::Public, + msg: &[u8], + ) -> std::result::Result, TraitError> { + self.sign::(key_type, public, msg) + } - #[cfg(feature = "bls-experimental")] - fn bls381_public_keys(&self, key_type: KeyTypeId) -> Vec { - self.public_keys::(key_type) - } + fn bandersnatch_vrf_sign( + &self, + key_type: KeyTypeId, + public: &bandersnatch::Public, + data: &bandersnatch::vrf::VrfSignData, + ) -> std::result::Result, TraitError> { + self.vrf_sign::(key_type, public, data) + } - #[cfg(feature = "bls-experimental")] - /// Generate a new pair compatible with the 'bls381' signature scheme. - /// - /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. - fn bls381_generate_new( - &self, - key_type: KeyTypeId, - seed: Option<&str>, - ) -> std::result::Result { - self.generate_new::(key_type, seed) - } + fn bandersnatch_vrf_output( + &self, + key_type: KeyTypeId, + public: &bandersnatch::Public, + input: &bandersnatch::vrf::VrfInput, + ) -> std::result::Result, TraitError> { + self.vrf_output::(key_type, public, input) + } - #[cfg(feature = "bls-experimental")] - fn bls381_sign( - &self, - key_type: KeyTypeId, - public: &bls381::Public, - msg: &[u8], - ) -> std::result::Result, TraitError> { - self.sign::(key_type, public, msg) + fn bandersnatch_ring_vrf_sign( + &self, + key_type: KeyTypeId, + public: &bandersnatch::Public, + data: &bandersnatch::vrf::VrfSignData, + prover: &bandersnatch::ring_vrf::RingProver, + ) -> std::result::Result, TraitError> { + let sig = self + .0 + .read() + .key_pair_by_type::(public, key_type)? + .map(|pair| pair.ring_vrf_sign(data, prover)); + Ok(sig) + } } - #[cfg(feature = "bls-experimental")] - fn bls377_public_keys(&self, key_type: KeyTypeId) -> Vec { - self.public_keys::(key_type) - } + sp_keystore::bls_experimental_enabled! { + fn bls381_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.public_keys::(key_type) + } - #[cfg(feature = "bls-experimental")] - /// Generate a new pair compatible with the 'bls377' signature scheme. - /// - /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. - fn bls377_generate_new( - &self, - key_type: KeyTypeId, - seed: Option<&str>, - ) -> std::result::Result { - self.generate_new::(key_type, seed) - } + /// Generate a new pair compatible with the 'bls381' signature scheme. + /// + /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. + fn bls381_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> std::result::Result { + self.generate_new::(key_type, seed) + } - #[cfg(feature = "bls-experimental")] - fn bls377_sign( - &self, - key_type: KeyTypeId, - public: &bls377::Public, - msg: &[u8], - ) -> std::result::Result, TraitError> { - self.sign::(key_type, public, msg) - } + fn bls381_sign( + &self, + key_type: KeyTypeId, + public: &bls381::Public, + msg: &[u8], + ) -> std::result::Result, TraitError> { + self.sign::(key_type, public, msg) + } - fn insert( - &self, - key_type: KeyTypeId, - suri: &str, - public: &[u8], - ) -> std::result::Result<(), ()> { - self.0.write().insert(key_type, suri, public).map_err(|_| ()) - } + fn bls377_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.public_keys::(key_type) + } - fn keys(&self, key_type: KeyTypeId) -> std::result::Result>, TraitError> { - self.0.read().raw_public_keys(key_type).map_err(|e| e.into()) - } + /// Generate a new pair compatible with the 'bls377' signature scheme. + /// + /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory. + fn bls377_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> std::result::Result { + self.generate_new::(key_type, seed) + } - fn has_keys(&self, public_keys: &[(Vec, KeyTypeId)]) -> bool { - public_keys - .iter() - .all(|(p, t)| self.0.read().key_phrase_by_type(p, *t).ok().flatten().is_some()) + fn bls377_sign( + &self, + key_type: KeyTypeId, + public: &bls377::Public, + msg: &[u8], + ) -> std::result::Result, TraitError> { + self.sign::(key_type, public, msg) + } } } diff --git a/substrate/client/merkle-mountain-range/rpc/Cargo.toml b/substrate/client/merkle-mountain-range/rpc/Cargo.toml index 38aea97859726d629783cab202b18ef80c80c944..6aa32333af9729d11193cd426dc0776ed3583ffd 100644 --- a/substrate/client/merkle-mountain-range/rpc/Cargo.toml +++ b/substrate/client/merkle-mountain-range/rpc/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1" } jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } sp-api = { path = "../../../primitives/api" } sp-blockchain = { path = "../../../primitives/blockchain" } sp-core = { path = "../../../primitives/core" } diff --git a/substrate/client/network/Cargo.toml b/substrate/client/network/Cargo.toml index e8d847e14195dff1b6faaa8ad499f28c41812f15..72e38ce498d30421b53c860ab5621fa536b9080a 100644 --- a/substrate/client/network/Cargo.toml +++ b/substrate/client/network/Cargo.toml @@ -33,7 +33,7 @@ parking_lot = "0.12.1" partial_sort = "0.2.0" pin-project = "1.0.12" rand = "0.8.5" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" smallvec = "1.11.0" thiserror = "1.0" diff --git a/substrate/client/network/bitswap/build.rs b/substrate/client/network/bitswap/build.rs index 671277230a7746b4da5e4e1d9d6b68f5ccf10b3e..2495a9c25653bde1dd9a3d49bc3391c1d1053f20 100644 --- a/substrate/client/network/bitswap/build.rs +++ b/substrate/client/network/bitswap/build.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const PROTOS: &[&str] = &["src/schema/bitswap.v1.2.0.proto"]; fn main() { diff --git a/substrate/client/network/bitswap/src/lib.rs b/substrate/client/network/bitswap/src/lib.rs index beaaa8fd0fdec2d5d526ccc4447871cb832b4225..7bb8b00306534c991a5e7fb317d9255952f24bc6 100644 --- a/substrate/client/network/bitswap/src/lib.rs +++ b/substrate/client/network/bitswap/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/network/common/src/sync/warp.rs b/substrate/client/network/common/src/sync/warp.rs index 37a6e62c53b4e834914df12b6a39b1881f312c14..91d6c4151a42d0ca82e565aeeddcf7afb6b024a2 100644 --- a/substrate/client/network/common/src/sync/warp.rs +++ b/substrate/client/network/common/src/sync/warp.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/network/light/build.rs b/substrate/client/network/light/build.rs index 9c44bcd29318168397802bb7de04088c55309cc7..199738abc91b3186de33050bcbc964fee97e11ef 100644 --- a/substrate/client/network/light/build.rs +++ b/substrate/client/network/light/build.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const PROTOS: &[&str] = &["src/schema/light.v1.proto"]; fn main() { diff --git a/substrate/client/network/src/peer_store.rs b/substrate/client/network/src/peer_store.rs index 2f3d4a1fd1a0b00ed8bbb17c90a997d956b8bca6..35d17e588cb962099b4656481276457c5f8e56f2 100644 --- a/substrate/client/network/src/peer_store.rs +++ b/substrate/client/network/src/peer_store.rs @@ -222,7 +222,7 @@ impl PeerStoreInner { if peer_info.reputation < BANNED_THRESHOLD { self.protocols.iter().for_each(|handle| handle.disconnect_peer(peer_id)); - log::trace!( + log::warn!( target: LOG_TARGET, "Report {}: {:+} to {}. Reason: {}. Banned, disconnecting.", peer_id, diff --git a/substrate/client/network/sync/build.rs b/substrate/client/network/sync/build.rs index 55794919cdb42881975eb3d3911e8f7cfe9074a6..b780136737e72561a05717a8f89db827d4e9940d 100644 --- a/substrate/client/network/sync/build.rs +++ b/substrate/client/network/sync/build.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const PROTOS: &[&str] = &["src/schema/api.v1.proto"]; fn main() { diff --git a/substrate/client/network/sync/src/block_request_handler.rs b/substrate/client/network/sync/src/block_request_handler.rs index 291157eae4b07699572b2a66136f90dd4b33e1a8..d90a00b37673beb1997cf240b7169c540e9a2ee4 100644 --- a/substrate/client/network/sync/src/block_request_handler.rs +++ b/substrate/client/network/sync/src/block_request_handler.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/network/sync/src/engine.rs b/substrate/client/network/sync/src/engine.rs index d5c4957ab3d706db81c9f24f415e622cc117656e..65bd56a289584d231ac56e0155a556e221b3bea9 100644 --- a/substrate/client/network/sync/src/engine.rs +++ b/substrate/client/network/sync/src/engine.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/substrate/client/network/sync/src/state_request_handler.rs b/substrate/client/network/sync/src/state_request_handler.rs index ed14b889cbb54d18cc421e6f812b11334cbe87c3..f78fadccc2d5fd05e9ec07435de6560cffdf6856 100644 --- a/substrate/client/network/sync/src/state_request_handler.rs +++ b/substrate/client/network/sync/src/state_request_handler.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/network/sync/src/warp_request_handler.rs b/substrate/client/network/sync/src/warp_request_handler.rs index a49a65af51d0ba363502194066f60afc6232cee5..0e502a6dba59e55ea619ab890a0fc7b3ea34af35 100644 --- a/substrate/client/network/sync/src/warp_request_handler.rs +++ b/substrate/client/network/sync/src/warp_request_handler.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/rpc-api/Cargo.toml b/substrate/client/rpc-api/Cargo.toml index c13ca207cea602925a9bf430483fd052360d7624..fb0d0a8a1f8a156cf6b53a5d9fecf9ad88d29547 100644 --- a/substrate/client/rpc-api/Cargo.toml +++ b/substrate/client/rpc-api/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1" } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" thiserror = "1.0" sc-chain-spec = { path = "../chain-spec" } diff --git a/substrate/client/rpc-spec-v2/src/chain_head/tests.rs b/substrate/client/rpc-spec-v2/src/chain_head/tests.rs index 00ed9089058eeb2b364d84b9722ae6d97728d1e9..1336cff84b6ff31d3edae83afe80dff6671648c9 100644 --- a/substrate/client/rpc-spec-v2/src/chain_head/tests.rs +++ b/substrate/client/rpc-spec-v2/src/chain_head/tests.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + use crate::chain_head::{ event::{MethodResponse, StorageQuery, StorageQueryType, StorageResultType}, test_utils::ChainHeadMockClient, diff --git a/substrate/client/service/Cargo.toml b/substrate/client/service/Cargo.toml index 4a7539aa8a540a0785660c8a93711085b121288a..6f794d93fed30c33a455da3dcdbfd38066c87f3f 100644 --- a/substrate/client/service/Cargo.toml +++ b/substrate/client/service/Cargo.toml @@ -34,7 +34,7 @@ log = "0.4.17" futures-timer = "3.0.1" exit-future = "0.2.0" pin-project = "1.0.12" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" sc-keystore = { path = "../keystore" } sp-runtime = { path = "../../primitives/runtime" } diff --git a/substrate/client/storage-monitor/Cargo.toml b/substrate/client/storage-monitor/Cargo.toml index 48ee1b0356151a72d44215cfb93c709bfff82c29..c5b71260f97e34aef6c9de0486e79dcd8dffb240 100644 --- a/substrate/client/storage-monitor/Cargo.toml +++ b/substrate/client/storage-monitor/Cargo.toml @@ -9,7 +9,7 @@ description = "Storage monitor service for substrate" homepage = "https://substrate.io" [dependencies] -clap = { version = "4.2.5", features = ["derive", "string"] } +clap = { version = "4.4.2", features = ["derive", "string"] } log = "0.4.17" fs4 = "0.6.3" sc-client-db = { path = "../db", default-features = false} diff --git a/substrate/client/sync-state-rpc/Cargo.toml b/substrate/client/sync-state-rpc/Cargo.toml index 6babb1f5c9a352aa947762c499d06dc642c0d470..59cc6ba40481765a60d6f58ef6776b1d62b23883 100644 --- a/substrate/client/sync-state-rpc/Cargo.toml +++ b/substrate/client/sync-state-rpc/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1" } jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" thiserror = "1.0.30" sc-chain-spec = { path = "../chain-spec" } diff --git a/substrate/client/sysinfo/Cargo.toml b/substrate/client/sysinfo/Cargo.toml index 7301f28921c848c046ccf004b6fbae01fc8134f6..5834d8dec07778aeefe2d9e08d8ad6514b45a8e1 100644 --- a/substrate/client/sysinfo/Cargo.toml +++ b/substrate/client/sysinfo/Cargo.toml @@ -20,7 +20,7 @@ log = "0.4.17" rand = "0.8.5" rand_pcg = "0.3.1" regex = "1" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" sc-telemetry = { path = "../telemetry" } sp-core = { path = "../../primitives/core" } diff --git a/substrate/client/telemetry/Cargo.toml b/substrate/client/telemetry/Cargo.toml index 5817dc207a103bbe37fed21c0c79f794f69c08ba..15362912909193178acaaa3dbb26605af338550d 100644 --- a/substrate/client/telemetry/Cargo.toml +++ b/substrate/client/telemetry/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -chrono = "0.4.19" +chrono = "0.4.27" futures = "0.3.21" libp2p = { version = "0.51.3", features = ["dns", "tcp", "tokio", "wasm-ext", "websocket"] } log = "0.4.17" @@ -22,7 +22,7 @@ parking_lot = "0.12.1" pin-project = "1.0.12" sc-utils = { path = "../utils" } rand = "0.8.5" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.85" thiserror = "1.0.30" wasm-timer = "0.2.5" diff --git a/substrate/client/tracing/Cargo.toml b/substrate/client/tracing/Cargo.toml index 1cbb50f6d8365ff81d99aa160e8381bcfed24f68..c9cd6ca313cdb65251062c8f4054af4fccec5455 100644 --- a/substrate/client/tracing/Cargo.toml +++ b/substrate/client/tracing/Cargo.toml @@ -15,14 +15,14 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] ansi_term = "0.12.1" atty = "0.2.13" -chrono = "0.4.19" +chrono = "0.4.27" lazy_static = "1.4.0" libc = "0.2.121" log = { version = "0.4.17" } parking_lot = "0.12.1" regex = "1.6.0" rustc-hash = "1.1.0" -serde = "1.0.163" +serde = "1.0.188" thiserror = "1.0.30" tracing = "0.1.29" tracing-log = "0.1.3" diff --git a/substrate/client/tracing/src/block/mod.rs b/substrate/client/tracing/src/block/mod.rs index c0442abc125b939851fab146806733302d9f72fc..9ebf8e55c94d05f007c6fda363409e110a61c4c2 100644 --- a/substrate/client/tracing/src/block/mod.rs +++ b/substrate/client/tracing/src/block/mod.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/tracing/src/logging/directives.rs b/substrate/client/tracing/src/logging/directives.rs index f1caf1a13a2def082ccba51d5a37aa162034f782..a99e9c4c890976bbc935bb293ee65dec4be1402b 100644 --- a/substrate/client/tracing/src/logging/directives.rs +++ b/substrate/client/tracing/src/logging/directives.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify diff --git a/substrate/client/transaction-pool/Cargo.toml b/substrate/client/transaction-pool/Cargo.toml index 6f56378c699f0e958fdf19a34640c81ba61bc9c4..0e502cb39fba02736c86f3dbe417f9484983c689 100644 --- a/substrate/client/transaction-pool/Cargo.toml +++ b/substrate/client/transaction-pool/Cargo.toml @@ -20,7 +20,7 @@ futures-timer = "3.0.2" linked-hash-map = "0.5.4" log = "0.4.17" parking_lot = "0.12.1" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } thiserror = "1.0.30" prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus" } sc-client-api = { path = "../api" } diff --git a/substrate/client/transaction-pool/api/Cargo.toml b/substrate/client/transaction-pool/api/Cargo.toml index 65d32dc60f46240d16a9983b35fabe72b3b9514e..edab1304e01c18b72c657aebc6ebfb8d5ca930ba 100644 --- a/substrate/client/transaction-pool/api/Cargo.toml +++ b/substrate/client/transaction-pool/api/Cargo.toml @@ -13,7 +13,7 @@ async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" log = "0.4.17" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } thiserror = "1.0.30" sp-blockchain = { path = "../../../primitives/blockchain" } sp-core = { path = "../../../primitives/core", default-features = false} diff --git a/substrate/frame/alliance/src/lib.rs b/substrate/frame/alliance/src/lib.rs index 1986354a0941c6659d72a190edc8c48805e1d3e8..627399f805b3115617e03dd501f2d747e27c9c77 100644 --- a/substrate/frame/alliance/src/lib.rs +++ b/substrate/frame/alliance/src/lib.rs @@ -98,16 +98,13 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; use sp_runtime::{ - traits::{Saturating, StaticLookup, Zero}, - RuntimeDebug, + traits::{Dispatchable, Saturating, StaticLookup, Zero}, + DispatchError, RuntimeDebug, }; use sp_std::{convert::TryInto, prelude::*}; use frame_support::{ - dispatch::{ - DispatchError, DispatchResult, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo, - PostDispatchInfo, - }, + dispatch::{DispatchResult, DispatchResultWithPostInfo, GetDispatchInfo, PostDispatchInfo}, ensure, traits::{ ChangeMembers, Currency, Get, InitializeMembers, IsSubType, OnUnbalanced, diff --git a/substrate/frame/asset-conversion/src/lib.rs b/substrate/frame/asset-conversion/src/lib.rs index d1d68f3e10fbb477c3ad2654836d7352d1d85dd1..8d811473e861f10b65c3b957afbb199a377875d3 100644 --- a/substrate/frame/asset-conversion/src/lib.rs +++ b/substrate/frame/asset-conversion/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/asset-conversion/src/mock.rs b/substrate/frame/asset-conversion/src/mock.rs index 7fe81b814047d652f526168007a2fd136b50927a..3a19f39e7ca62d38a18b77ff143b24bde25f5ede 100644 --- a/substrate/frame/asset-conversion/src/mock.rs +++ b/substrate/frame/asset-conversion/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/asset-conversion/src/tests.rs b/substrate/frame/asset-conversion/src/tests.rs index 450a074ec36757a95e351862ac28c1ffd39cf335..190e4fb621476924377f047205932abac587d68d 100644 --- a/substrate/frame/asset-conversion/src/tests.rs +++ b/substrate/frame/asset-conversion/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/asset-conversion/src/types.rs b/substrate/frame/asset-conversion/src/types.rs index 9c28bd7666b7128dcf5a37d5a98ca6a963d118c2..ffdc63ce0ce7b75c0eb111de6fb1547161fdaccf 100644 --- a/substrate/frame/asset-conversion/src/types.rs +++ b/substrate/frame/asset-conversion/src/types.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/assets/src/benchmarking.rs b/substrate/frame/assets/src/benchmarking.rs index 376f19139ab9b6dca29fcbb4bd6427baaffc6bd4..c9b0825542de718ddf6393a38d6819f16f6f8178 100644 --- a/substrate/frame/assets/src/benchmarking.rs +++ b/substrate/frame/assets/src/benchmarking.rs @@ -23,10 +23,7 @@ use super::*; use frame_benchmarking::v1::{ account, benchmarks_instance_pallet, whitelist_account, whitelisted_caller, BenchmarkError, }; -use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get}, -}; +use frame_support::traits::{EnsureOrigin, Get, UnfilteredDispatchable}; use frame_system::RawOrigin as SystemOrigin; use sp_runtime::traits::Bounded; use sp_std::prelude::*; diff --git a/substrate/frame/assets/src/lib.rs b/substrate/frame/assets/src/lib.rs index 363a99701b56a1aff4178dd551a104efba7e337f..79e4fe3001872fe5c5471277c0888376d2f42e89 100644 --- a/substrate/frame/assets/src/lib.rs +++ b/substrate/frame/assets/src/lib.rs @@ -160,12 +160,12 @@ pub use types::*; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, Saturating, StaticLookup, Zero}, - ArithmeticError, TokenError, + ArithmeticError, DispatchError, TokenError, }; use sp_std::prelude::*; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, pallet_prelude::DispatchResultWithPostInfo, storage::KeyPrefixIterator, diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index 858417e8007fb8bfbf7847fa62fb67598eab0f6a..e20e1df564c7363c5a500906e35e9cdffb1ef2a3 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg(test)] use super::*; diff --git a/substrate/frame/bags-list/remote-tests/src/migration.rs b/substrate/frame/bags-list/remote-tests/src/migration.rs index 7847fdc7591c0195ec1922b7f730ff18535ca03e..dc133745afe073e33d466503307e86f834cc7382 100644 --- a/substrate/frame/bags-list/remote-tests/src/migration.rs +++ b/substrate/frame/bags-list/remote-tests/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/substrate/frame/bags-list/remote-tests/src/snapshot.rs b/substrate/frame/bags-list/remote-tests/src/snapshot.rs index 78c5b4e1c7b6dbf3559543c2e776a4fd89422487..13922cd3ca61845937f8988eb3588a22eeba9340 100644 --- a/substrate/frame/bags-list/remote-tests/src/snapshot.rs +++ b/substrate/frame/bags-list/remote-tests/src/snapshot.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/substrate/frame/bags-list/remote-tests/src/try_state.rs b/substrate/frame/bags-list/remote-tests/src/try_state.rs index 5bbac00bc75abd9610b95a4d2d44019c808201d5..338be50a93f79ac8fbcc65b09d3cddc817a7a219 100644 --- a/substrate/frame/bags-list/remote-tests/src/try_state.rs +++ b/substrate/frame/bags-list/remote-tests/src/try_state.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/substrate/frame/balances/src/impl_currency.rs b/substrate/frame/balances/src/impl_currency.rs index 2cbe776c51297ae51fe6b429a5f4466764f1e934..c64a4929dd568d2fda1a941cd05e3dabd36efaab 100644 --- a/substrate/frame/balances/src/impl_currency.rs +++ b/substrate/frame/balances/src/impl_currency.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/impl_fungible.rs b/substrate/frame/balances/src/impl_fungible.rs index 03c40bb3a8401608c4c9ded644f984df962c0082..fc8c2d71f256eebd0d77b1a675f7677fc6326b43 100644 --- a/substrate/frame/balances/src/impl_fungible.rs +++ b/substrate/frame/balances/src/impl_fungible.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/migration.rs b/substrate/frame/balances/src/migration.rs index 6a272a611c3f9c61d2cc687ffec5c66bea3b3b98..ba6819ec6e814da69807c8717a088df2451b6cb5 100644 --- a/substrate/frame/balances/src/migration.rs +++ b/substrate/frame/balances/src/migration.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify diff --git a/substrate/frame/balances/src/tests/currency_tests.rs b/substrate/frame/balances/src/tests/currency_tests.rs index c9ad19f79e36dcabce1fee9d78a10e86fe186c43..969731b49a236c792c2ea6043c16696ac2e44b40 100644 --- a/substrate/frame/balances/src/tests/currency_tests.rs +++ b/substrate/frame/balances/src/tests/currency_tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/tests/dispatchable_tests.rs b/substrate/frame/balances/src/tests/dispatchable_tests.rs index 76d0961e577d2dbec24643641558c2d3e5fcd66c..8f625a189446b2982e16433db3c2ebae7e43f34d 100644 --- a/substrate/frame/balances/src/tests/dispatchable_tests.rs +++ b/substrate/frame/balances/src/tests/dispatchable_tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/tests/fungible_tests.rs b/substrate/frame/balances/src/tests/fungible_tests.rs index ab2606c53ff71ce13cba779dcf58e39bb2ee351d..8bf0509d8f77e00802e0378eaa4c9ec26e341534 100644 --- a/substrate/frame/balances/src/tests/fungible_tests.rs +++ b/substrate/frame/balances/src/tests/fungible_tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index cefc6e9e8f51f2bf9df24f14f90a6c8205457824..d15f8e89118cc336cad226bfe1e16958cb653496 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/tests/reentrancy_tests.rs b/substrate/frame/balances/src/tests/reentrancy_tests.rs index e97bf2ed2b706d582fc672f2c62c5f66afc4f74f..1afbe82c7e2a7b2c9eec65e0ad2f34a23aa025a3 100644 --- a/substrate/frame/balances/src/tests/reentrancy_tests.rs +++ b/substrate/frame/balances/src/tests/reentrancy_tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/balances/src/types.rs b/substrate/frame/balances/src/types.rs index cd100d0df6c6d4278b49696f3155fb9908d2f21e..af775b8eefe5c259b1f4035485b1ef217cb88749 100644 --- a/substrate/frame/balances/src/types.rs +++ b/substrate/frame/balances/src/types.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/beefy-mmr/Cargo.toml b/substrate/frame/beefy-mmr/Cargo.toml index 82970ca385cfe24b82d7e8f46b857a0184836474..020ca52a277f68581479c59d9b053df3a2c672ef 100644 --- a/substrate/frame/beefy-mmr/Cargo.toml +++ b/substrate/frame/beefy-mmr/Cargo.toml @@ -13,7 +13,7 @@ array-bytes = { version = "6.1", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } binary-merkle-tree = { path = "../../utils/binary-merkle-tree", default-features = false} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/beefy/Cargo.toml b/substrate/frame/beefy/Cargo.toml index ddee3c6fe8ebe1ab621d6150dcfca75eceb1d812..1445658bafb53bc857489e9784ef6a8a4c282949 100644 --- a/substrate/frame/beefy/Cargo.toml +++ b/substrate/frame/beefy/Cargo.toml @@ -12,7 +12,7 @@ homepage = "https://substrate.io" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} pallet-authorship = { path = "../authorship", default-features = false} diff --git a/substrate/frame/benchmarking/Cargo.toml b/substrate/frame/benchmarking/Cargo.toml index 8b47a1f948b9dd59a2c512f161041a7f729b110d..107f3b7d56fef156171de1c19295338b23b427e1 100644 --- a/substrate/frame/benchmarking/Cargo.toml +++ b/substrate/frame/benchmarking/Cargo.toml @@ -18,7 +18,7 @@ linregress = { version = "0.5.1", optional = true } log = { version = "0.4.17", default-features = false } paste = "1.0" scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-support = { path = "../support", default-features = false} frame-support-procedural = { path = "../support/procedural", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/benchmarking/pov/src/weights.rs b/substrate/frame/benchmarking/pov/src/weights.rs index f16ac7fbc2733c1064664e2cefb88128fb55b7ca..d84ac88c98f022d77a286c512f979eadb5c2d7a0 100644 --- a/substrate/frame/benchmarking/pov/src/weights.rs +++ b/substrate/frame/benchmarking/pov/src/weights.rs @@ -1,3 +1,19 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. //! Autogenerated weights for frame_benchmarking_pallet_pov //! diff --git a/substrate/frame/benchmarking/src/utils.rs b/substrate/frame/benchmarking/src/utils.rs index 59e5192b427b0efcbdeec7ff73628ac5c1632621..b9b3f91e2dd7bfc13b01accd15020e70f29cd7ac 100644 --- a/substrate/frame/benchmarking/src/utils.rs +++ b/substrate/frame/benchmarking/src/utils.rs @@ -17,16 +17,12 @@ //! Interfaces, types and utils for benchmarking a FRAME runtime. use codec::{Decode, Encode}; -use frame_support::{ - dispatch::{DispatchError, DispatchErrorWithPostInfo}, - pallet_prelude::*, - traits::StorageInfo, -}; +use frame_support::{dispatch::DispatchErrorWithPostInfo, pallet_prelude::*, traits::StorageInfo}; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_io::hashing::blake2_256; -use sp_runtime::traits::TrailingZeroInput; +use sp_runtime::{traits::TrailingZeroInput, DispatchError}; use sp_std::{prelude::Box, vec::Vec}; use sp_storage::TrackedStorageKey; diff --git a/substrate/frame/broker/src/tick_impls.rs b/substrate/frame/broker/src/tick_impls.rs index 0677d2793e21acd17e3591738ec97c9df6687f7e..d65b8968f3cfe91daf6e6c65d7a42b507b72ae13 100644 --- a/substrate/frame/broker/src/tick_impls.rs +++ b/substrate/frame/broker/src/tick_impls.rs @@ -41,7 +41,7 @@ impl Pallet { _ => return Weight::zero(), }; - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); if Self::process_core_count(&mut status) { meter.consume(T::WeightInfo::process_core_count(status.core_count.into())); diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index ac6ad39eac5a44c0ae52cebef18e8352204c3d08..10f989e5c4cc6ef92c258c21455d8f227dcf3dbe 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -45,13 +45,15 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_io::storage; -use sp_runtime::{traits::Hash, RuntimeDebug}; +use sp_runtime::{ + traits::{Dispatchable, Hash}, + DispatchError, RuntimeDebug, +}; use sp_std::{marker::PhantomData, prelude::*, result}; use frame_support::{ dispatch::{ - DispatchError, DispatchResult, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo, - Pays, PostDispatchInfo, + DispatchResult, DispatchResultWithPostInfo, GetDispatchInfo, Pays, PostDispatchInfo, }, ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{ diff --git a/substrate/frame/contracts/fixtures/balance.wat b/substrate/frame/contracts/fixtures/balance.wat new file mode 100644 index 0000000000000000000000000000000000000000..d86d5c4b1c60ced43282b03100bc370c60a6ebcf --- /dev/null +++ b/substrate/frame/contracts/fixtures/balance.wat @@ -0,0 +1,42 @@ +(module + (import "seal0" "seal_balance" (func $seal_balance (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 8) reserved for $seal_balance output + + ;; [8, 16) length of the buffer for $seal_balance + (data (i32.const 8) "\08") + + ;; [16, inf) zero initialized + + (func $assert (param i32) + (block $ok + (br_if $ok + (get_local 0) + ) + (unreachable) + ) + ) + + (func (export "deploy")) + + (func (export "call") + (call $seal_balance (i32.const 0) (i32.const 8)) + + ;; Balance should be encoded as a u64. + (call $assert + (i32.eq + (i32.load (i32.const 8)) + (i32.const 8) + ) + ) + + ;; Assert the free balance to be zero. + (call $assert + (i64.eq + (i64.load (i32.const 0)) + (i64.const 0) + ) + ) + ) +) diff --git a/substrate/frame/contracts/fixtures/drain.wat b/substrate/frame/contracts/fixtures/drain.wat index 9f126898fac81e48d62581d61fbbfc2c8a009bc1..cb8ff0aed61fe76ea6dced1ec1fe1bd68fb708b5 100644 --- a/substrate/frame/contracts/fixtures/drain.wat +++ b/substrate/frame/contracts/fixtures/drain.wat @@ -1,14 +1,20 @@ (module (import "seal0" "seal_balance" (func $seal_balance (param i32 i32))) + (import "seal0" "seal_minimum_balance" (func $seal_minimum_balance (param i32 i32))) (import "seal0" "seal_transfer" (func $seal_transfer (param i32 i32 i32 i32) (result i32))) (import "env" "memory" (memory 1 1)) ;; [0, 8) reserved for $seal_balance output - ;; [8, 16) length of the buffer + ;; [8, 16) length of the buffer for $seal_balance (data (i32.const 8) "\08") - ;; [16, inf) zero initialized + ;; [16, 24) reserved for $seal_minimum_balance + + ;; [24, 32) length of the buffer for $seal_minimum_balance + (data (i32.const 24) "\08") + + ;; [32, inf) zero initialized (func $assert (param i32) (block $ok @@ -33,13 +39,32 @@ ) ) - ;; Try to self-destruct by sending full balance to the 0 address. + ;; Get the minimum balance. + (call $seal_minimum_balance (i32.const 16) (i32.const 24)) + + ;; Minimum balance should be encoded as a u64. + (call $assert + (i32.eq + (i32.load (i32.const 24)) + (i32.const 8) + ) + ) + + ;; Make the transferred value exceed the balance by adding the minimum balance. + (i64.store (i32.const 0) + (i64.add + (i64.load (i32.const 0)) + (i64.load (i32.const 16)) + ) + ) + + ;; Try to self-destruct by sending more balance to the 0 address. ;; The call will fail because a contract transfer has a keep alive requirement (call $assert (i32.eq (call $seal_transfer - (i32.const 16) ;; Pointer to destination address - (i32.const 32) ;; Length of destination address + (i32.const 32) ;; Pointer to destination address + (i32.const 48) ;; Length of destination address (i32.const 0) ;; Pointer to the buffer with value to transfer (i32.const 8) ;; Length of the buffer with value to transfer ) diff --git a/substrate/frame/contracts/src/debug.rs b/substrate/frame/contracts/src/debug.rs index a92f428c8f8a43d8d37f79220c2564eb618b4827..d92379a806ddaffa82f9d126abe4ebf6fe690d75 100644 --- a/substrate/frame/contracts/src/debug.rs +++ b/substrate/frame/contracts/src/debug.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use crate::exec::ExportedFunction; use crate::{CodeHash, Config, LOG_TARGET}; use pallet_contracts_primitives::ExecReturnValue; diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index 1ba44220ff8dcb1448b2047eeb92f77f9af58bb2..894667280b71d3a81cdb7ab0f9cc1033562ea3a3 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -25,14 +25,12 @@ use crate::{ }; use frame_support::{ crypto::ecdsa::ECDSAExt, - dispatch::{ - fmt::Debug, DispatchError, DispatchResult, DispatchResultWithPostInfo, Dispatchable, - }, + dispatch::{DispatchResult, DispatchResultWithPostInfo}, ensure, storage::{with_transaction, TransactionOutcome}, traits::{ fungible::{Inspect, Mutate}, - tokens::Preservation, + tokens::{Fortitude, Preservation}, Contains, OriginTrait, Randomness, Time, }, weights::Weight, @@ -47,8 +45,11 @@ use sp_core::{ Get, }; use sp_io::{crypto::secp256k1_ecdsa_recover_compressed, hashing::blake2_256}; -use sp_runtime::traits::{Convert, Hash, Zero}; -use sp_std::{marker::PhantomData, mem, prelude::*, vec::Vec}; +use sp_runtime::{ + traits::{Convert, Dispatchable, Hash, Zero}, + DispatchError, +}; +use sp_std::{fmt::Debug, marker::PhantomData, mem, prelude::*, vec::Vec}; pub type AccountIdOf = ::AccountId; pub type MomentOf = <::Time as Time>::Moment; @@ -1367,7 +1368,11 @@ where } fn balance(&self) -> BalanceOf { - T::Currency::balance(&self.top_frame().account_id) + T::Currency::reducible_balance( + &self.top_frame().account_id, + Preservation::Preserve, + Fortitude::Polite, + ) } fn value_transferred(&self) -> BalanceOf { diff --git a/substrate/frame/contracts/src/gas.rs b/substrate/frame/contracts/src/gas.rs index 7d17642d92e54f4ecad74c71faf1eae8741c3fbc..363ddfad975b1eb92c6a4ebcc23982f585eef08c 100644 --- a/substrate/frame/contracts/src/gas.rs +++ b/substrate/frame/contracts/src/gas.rs @@ -17,14 +17,12 @@ use crate::{exec::ExecError, Config, Error}; use frame_support::{ - dispatch::{ - DispatchError, DispatchErrorWithPostInfo, DispatchResultWithPostInfo, PostDispatchInfo, - }, + dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo, PostDispatchInfo}, weights::Weight, DefaultNoBound, }; use sp_core::Get; -use sp_runtime::traits::Zero; +use sp_runtime::{traits::Zero, DispatchError}; use sp_std::marker::PhantomData; #[cfg(test)] diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index 2b9dd07b3f6fee0fa60b7140ba54e00723466b6d..e22e4a3f9ff86b64c47646e6578a6aa63fdef43a 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -111,10 +111,7 @@ use crate::{ use codec::{Codec, Decode, Encode, HasCompact, MaxEncodedLen}; use environmental::*; use frame_support::{ - dispatch::{ - DispatchError, Dispatchable, GetDispatchInfo, Pays, PostDispatchInfo, RawOrigin, - WithPostDispatchInfo, - }, + dispatch::{GetDispatchInfo, Pays, PostDispatchInfo, RawOrigin, WithPostDispatchInfo}, ensure, error::BadOrigin, traits::{ @@ -137,8 +134,8 @@ use pallet_contracts_primitives::{ use scale_info::TypeInfo; use smallvec::Array; use sp_runtime::{ - traits::{Convert, Hash, Saturating, StaticLookup, Zero}, - RuntimeDebug, + traits::{Convert, Dispatchable, Hash, Saturating, StaticLookup, Zero}, + DispatchError, RuntimeDebug, }; use sp_std::{fmt::Debug, prelude::*}; diff --git a/substrate/frame/contracts/src/migration/v15.rs b/substrate/frame/contracts/src/migration/v15.rs index efece62905ff8474a7288cb03d21bd8ae05eae11..180fe855ca66728ba18b17555363eeac11a340ba 100644 --- a/substrate/frame/contracts/src/migration/v15.rs +++ b/substrate/frame/contracts/src/migration/v15.rs @@ -28,7 +28,7 @@ use crate::{ AccountIdOf, BalanceOf, CodeHash, Config, HoldReason, Pallet, TrieId, Weight, LOG_TARGET, }; #[cfg(feature = "try-runtime")] -use frame_support::{dispatch::Vec, traits::fungible::InspectHold}; +use frame_support::traits::fungible::InspectHold; use frame_support::{ pallet_prelude::*, storage_alias, @@ -43,6 +43,8 @@ use sp_core::hexdisplay::HexDisplay; #[cfg(feature = "try-runtime")] use sp_runtime::TryRuntimeError; use sp_runtime::{traits::Zero, Saturating}; +#[cfg(feature = "try-runtime")] +use sp_std::vec::Vec; mod old { use super::*; diff --git a/substrate/frame/contracts/src/storage.rs b/substrate/frame/contracts/src/storage.rs index d58fd0fe9dbdf42d01dac9f048fba96ea4973664..d4d261f4ec1ffcfc68c5245864b00ea2f47928ed 100644 --- a/substrate/frame/contracts/src/storage.rs +++ b/substrate/frame/contracts/src/storage.rs @@ -27,7 +27,6 @@ use crate::{ }; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::DispatchError, storage::child::{self, ChildInfo}, weights::Weight, CloneNoBound, DefaultNoBound, @@ -37,7 +36,7 @@ use sp_core::Get; use sp_io::KillStorageResult; use sp_runtime::{ traits::{Hash, Saturating, Zero}, - BoundedBTreeMap, DispatchResult, RuntimeDebug, + BoundedBTreeMap, DispatchError, DispatchResult, RuntimeDebug, }; use sp_std::{marker::PhantomData, prelude::*}; diff --git a/substrate/frame/contracts/src/storage/meter.rs b/substrate/frame/contracts/src/storage/meter.rs index 2a9a083412b00f56a74d1bf2526b00a32b78848b..9f098090bc8bb1d4f42339fb619d38b909501d8a 100644 --- a/substrate/frame/contracts/src/storage/meter.rs +++ b/substrate/frame/contracts/src/storage/meter.rs @@ -23,7 +23,6 @@ use crate::{ }; use frame_support::{ - dispatch::{fmt::Debug, DispatchError}, ensure, traits::{ fungible::{Mutate, MutateHold}, @@ -37,9 +36,9 @@ use frame_support::{ use sp_api::HashT; use sp_runtime::{ traits::{Saturating, Zero}, - FixedPointNumber, FixedU128, + DispatchError, FixedPointNumber, FixedU128, }; -use sp_std::{marker::PhantomData, vec, vec::Vec}; +use sp_std::{fmt::Debug, marker::PhantomData, vec, vec::Vec}; /// Deposit that uses the native fungible's balance type. pub type DepositOf = Deposit>; diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 8cc6d00b3d45d726b445210c1a20d643464dc2a3..0c0a2f7f9327315a5991e2283e6e3f6b00aedf87 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -42,7 +42,7 @@ use assert_matches::assert_matches; use codec::Encode; use frame_support::{ assert_err, assert_err_ignore_postinfo, assert_err_with_weight, assert_noop, assert_ok, - dispatch::{DispatchError, DispatchErrorWithPostInfo, PostDispatchInfo}, + dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}, parameter_types, storage::child, traits::{ @@ -61,7 +61,7 @@ use sp_keystore::{testing::MemoryKeystore, KeystoreExt}; use sp_runtime::{ testing::H256, traits::{BlakeTwo256, Convert, Hash, IdentityLookup}, - AccountId32, BuildStorage, Perbill, TokenError, + AccountId32, BuildStorage, DispatchError, Perbill, TokenError, }; type Block = frame_system::mocking::MockBlock; @@ -5891,3 +5891,53 @@ fn root_cannot_instantiate() { ); }); } + +#[test] +fn balance_api_returns_free_balance() { + let (wasm, _code_hash) = compile_module::("balance").unwrap(); + ExtBuilder::default().existential_deposit(200).build().execute_with(|| { + let _ = ::Currency::set_balance(&ALICE, 1_000_000); + + // Instantiate the BOB contract without any extra balance. + let addr = Contracts::bare_instantiate( + ALICE, + 0, + GAS_LIMIT, + None, + Code::Upload(wasm.to_vec()), + vec![], + vec![], + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result + .unwrap() + .account_id; + + let value = 0; + // Call BOB which makes it call the balance runtime API. + // The contract code asserts that the returned balance is 0. + assert_ok!(Contracts::call( + RuntimeOrigin::signed(ALICE), + addr.clone(), + value, + GAS_LIMIT, + None, + vec![] + )); + + let value = 1; + // Calling with value will trap the contract. + assert_err_ignore_postinfo!( + Contracts::call( + RuntimeOrigin::signed(ALICE), + addr.clone(), + value, + GAS_LIMIT, + None, + vec![] + ), + >::ContractTrapped + ); + }); +} diff --git a/substrate/frame/contracts/src/tests/pallet_dummy.rs b/substrate/frame/contracts/src/tests/pallet_dummy.rs index 7f8db53bf463fba8d83ebb7c643a421148b9dfa3..2af8475d17eda39854a8b82555b2102e9d67948f 100644 --- a/substrate/frame/contracts/src/tests/pallet_dummy.rs +++ b/substrate/frame/contracts/src/tests/pallet_dummy.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use pallet::*; #[frame_support::pallet(dev_mode)] diff --git a/substrate/frame/contracts/src/tests/test_debug.rs b/substrate/frame/contracts/src/tests/test_debug.rs index ba936a4588d18954119664b1647241b736eed7e3..c7862c7f03dd3d406e9e11bdd76f08e8f1ee0643 100644 --- a/substrate/frame/contracts/src/tests/test_debug.rs +++ b/substrate/frame/contracts/src/tests/test_debug.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::*; use crate::debug::{CallSpan, ExportedFunction, Tracing}; use frame_support::traits::Currency; diff --git a/substrate/frame/contracts/src/wasm/mod.rs b/substrate/frame/contracts/src/wasm/mod.rs index 291f39f7fa797462dcfc4825234f837ac94787b6..5fc65e314ad9fe6b61d6ae641bc37d6f9df17e24 100644 --- a/substrate/frame/contracts/src/wasm/mod.rs +++ b/substrate/frame/contracts/src/wasm/mod.rs @@ -42,12 +42,12 @@ use crate::{ }; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, traits::{fungible::MutateHold, tokens::Precision::BestEffort}, }; use sp_core::Get; -use sp_runtime::RuntimeDebug; +use sp_runtime::{DispatchError, RuntimeDebug}; use sp_std::prelude::*; use wasmi::{Instance, Linker, Memory, MemoryType, StackLimits, Store}; diff --git a/substrate/frame/contracts/src/wasm/runtime.rs b/substrate/frame/contracts/src/wasm/runtime.rs index ca23ab9fe5dd0205bc437773b1628e60545ea99b..4bc00388f726fb2f4057b6e527157ec6080439fa 100644 --- a/substrate/frame/contracts/src/wasm/runtime.rs +++ b/substrate/frame/contracts/src/wasm/runtime.rs @@ -26,13 +26,13 @@ use crate::{ use bitflags::bitflags; use codec::{Decode, DecodeLimit, Encode, MaxEncodedLen}; -use frame_support::{dispatch::DispatchError, ensure, traits::Get, weights::Weight}; +use frame_support::{ensure, traits::Get, weights::Weight}; use pallet_contracts_primitives::{ExecReturnValue, ReturnFlags}; use pallet_contracts_proc_macro::define_env; use sp_io::hashing::{blake2_128, blake2_256, keccak_256, sha2_256}; use sp_runtime::{ traits::{Bounded, Zero}, - RuntimeDebug, + DispatchError, RuntimeDebug, }; use sp_std::{fmt, prelude::*}; use wasmi::{core::HostError, errors::LinkerError, Linker, Memory, Store}; diff --git a/substrate/frame/conviction-voting/Cargo.toml b/substrate/frame/conviction-voting/Cargo.toml index 6efa631cd97b0e046471cdfe25b774cd3e9578be..666a02e9b2396d83b221cbd3502281d362bba86f 100644 --- a/substrate/frame/conviction-voting/Cargo.toml +++ b/substrate/frame/conviction-voting/Cargo.toml @@ -19,7 +19,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = "max-encoded-len", ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"], optional = true } +serde = { version = "1.0.188", features = ["derive"], optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/conviction-voting/src/lib.rs b/substrate/frame/conviction-voting/src/lib.rs index 9c2993fc5cae19215eeb973b97fe9d057983b92b..1d6fbaa38694233a6766410728bf8efec0671d0e 100644 --- a/substrate/frame/conviction-voting/src/lib.rs +++ b/substrate/frame/conviction-voting/src/lib.rs @@ -28,7 +28,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, traits::{ fungible, Currency, Get, LockIdentifier, LockableCurrency, PollStatus, Polling, @@ -38,7 +38,7 @@ use frame_support::{ use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::{ traits::{AtLeast32BitUnsigned, Saturating, StaticLookup, Zero}, - ArithmeticError, Perbill, + ArithmeticError, DispatchError, Perbill, }; use sp_std::prelude::*; @@ -86,8 +86,15 @@ type ClassOf = <>::Polls as Polling>>::C #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::{pallet_prelude::*, traits::ClassCountOf}; + use frame_support::{ + pallet_prelude::{ + DispatchResultWithPostInfo, IsType, StorageDoubleMap, StorageMap, ValueQuery, + }, + traits::ClassCountOf, + Twox64Concat, + }; use frame_system::pallet_prelude::*; + use sp_runtime::BoundedVec; #[pallet::pallet] pub struct Pallet(_); diff --git a/substrate/frame/core-fellowship/src/lib.rs b/substrate/frame/core-fellowship/src/lib.rs index ace614d2bddb9d1fec24bb24252ebe18e8f51dec..1aa53cf08d17499bedc2fd4e6d11f78240426123 100644 --- a/substrate/frame/core-fellowship/src/lib.rs +++ b/substrate/frame/core-fellowship/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/core-fellowship/src/tests.rs b/substrate/frame/core-fellowship/src/tests.rs index c95699e66e41be802e3163d54f5bbe6ae376c4ec..a02c010718c91c37bfdde1f9eef7878ded0013b9 100644 --- a/substrate/frame/core-fellowship/src/tests.rs +++ b/substrate/frame/core-fellowship/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/democracy/Cargo.toml b/substrate/frame/democracy/Cargo.toml index d686684b63807cc3f8834456b41c168e5076f000..038e8d2cef47d7e86d69d932d67e97131b22de5c 100644 --- a/substrate/frame/democracy/Cargo.toml +++ b/substrate/frame/democracy/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = "derive", ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"], optional = true } +serde = { version = "1.0.188", features = ["derive"], optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/election-provider-multi-phase/src/unsigned.rs b/substrate/frame/election-provider-multi-phase/src/unsigned.rs index af8f632f8a9e3322edb2a17180f29005a5b68d98..f1c9e92a704e926bc5e2ccf1e18ec590f1c69fd6 100644 --- a/substrate/frame/election-provider-multi-phase/src/unsigned.rs +++ b/substrate/frame/election-provider-multi-phase/src/unsigned.rs @@ -984,12 +984,12 @@ mod tests { }; use codec::Decode; use frame_election_provider_support::IndexAssignment; - use frame_support::{assert_noop, assert_ok, dispatch::Dispatchable, traits::OffchainWorker}; + use frame_support::{assert_noop, assert_ok, traits::OffchainWorker}; use sp_npos_elections::ElectionScore; use sp_runtime::{ bounded_vec, offchain::storage_lock::{BlockAndTime, StorageLock}, - traits::{ValidateUnsigned, Zero}, + traits::{Dispatchable, ValidateUnsigned, Zero}, ModuleError, PerU16, Perbill, }; diff --git a/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs index 9c3511ae35751527eb7c702eb0e51cdd7a4577e5..501f9f89ab7a9f57b4a5990d9139be98f95d65a8 100644 --- a/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,8 @@ #![allow(dead_code)] use frame_support::{ - assert_ok, dispatch::UnfilteredDispatchable, parameter_types, traits, traits::Hooks, + assert_ok, parameter_types, traits, + traits::{Hooks, UnfilteredDispatchable}, weights::constants, }; use frame_system::EnsureRoot; diff --git a/substrate/frame/election-provider-support/solution-type/fuzzer/Cargo.toml b/substrate/frame/election-provider-support/solution-type/fuzzer/Cargo.toml index 1bf4196e825ee83ea686c6a0a7400b3a513ab860..69ce42559a61e95b171034481d0fd5fafaea7b19 100644 --- a/substrate/frame/election-provider-support/solution-type/fuzzer/Cargo.toml +++ b/substrate/frame/election-provider-support/solution-type/fuzzer/Cargo.toml @@ -13,7 +13,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } honggfuzz = "0.5" rand = { version = "0.8", features = ["std", "small_rng"] } diff --git a/substrate/frame/election-provider-support/solution-type/fuzzer/src/compact.rs b/substrate/frame/election-provider-support/solution-type/fuzzer/src/compact.rs index e7ef440ff21956ba0ecf8c3346c19612b57c3727..90fd9509e6f297905862cd5ff6040acd2729c276 100644 --- a/substrate/frame/election-provider-support/solution-type/fuzzer/src/compact.rs +++ b/substrate/frame/election-provider-support/solution-type/fuzzer/src/compact.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; use honggfuzz::fuzz; use sp_arithmetic::Percent; diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.rs index 52ae9623fd38462da2fc60f195e944d79da1e7c6..c72ad9853e2a6c03b573d7d1d6db3e90060ac0df 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.stderr index b6bb8f39ede610819e35684e50ecb8d287c29171..4ff7d479a98695c2ab56fcf03c35805aa500faf6 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.stderr @@ -1,5 +1,5 @@ error: Expected binding: `Accuracy = ...` - --> $DIR/missing_accuracy.rs:6:2 - | -6 | Perbill, - | ^^^^^^^ + --> tests/ui/fail/missing_accuracy.rs:23:2 + | +23 | Perbill, + | ^^^^^^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs index fe8ac04cc8d6148bab6f1ef23139c95fe9af172e..c1dd59649724f70ee77f8380c6ed493a6dd6c654 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr index c685ab816d399d47bb8d4551fe9b8b6e2cae8bd8..52fb081b3f4669139959546d7a363407be9544d9 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr @@ -1,5 +1,5 @@ error: Expected binding: `MaxVoters = ...` - --> tests/ui/fail/missing_size_bound.rs:7:2 - | -7 | ConstU32::<10>, - | ^^^^^^^^^^^^^^ + --> tests/ui/fail/missing_size_bound.rs:24:2 + | +24 | ConstU32::<10>, + | ^^^^^^^^^^^^^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.rs index b457c4abada6c3dc0ea8e1ab630f5a48c999565e..1747693b4e59c8c6a47850eb7495737d80363935 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.stderr index d0c92c5bbd8e9f84154cd676dd7d80f7023e4469..783af709fe2e05517db321f87876671d16432f50 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_target.stderr @@ -1,5 +1,5 @@ error: Expected binding: `TargetIndex = ...` - --> $DIR/missing_target.rs:5:2 - | -5 | u8, - | ^^ + --> tests/ui/fail/missing_target.rs:22:2 + | +22 | u8, + | ^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.rs index 3d12e3e6b5ec4822fc044a4e2ab2c8f8b30a8b06..10e7d7577a271702ce2e4bbf0f2df48de0a99d2d 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.stderr index a825d460c2fa8c9411c5132a1c755c7e87a090ff..c8a5b92b76289b77b3fab902dbb1ac85ca496095 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.stderr @@ -1,5 +1,5 @@ error: Expected binding: `VoterIndex = ...` - --> $DIR/missing_voter.rs:4:2 - | -4 | u16, - | ^^^ + --> tests/ui/fail/missing_voter.rs:21:2 + | +21 | u16, + | ^^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.rs index 9aab15e7ec9a1798464cca328fb89cc88dacba62..6e0a0df14cee797bac4302018d0cc7ef8641c3d3 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.stderr index 28f1c2091546fc24f2bfea8dc976fbcc979fbba4..af548a524b2795834a958ae3631751a1dc94c75a 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.stderr @@ -1,5 +1,5 @@ error: Expected binding: `VoterIndex = ...` - --> $DIR/no_annotations.rs:4:2 - | -4 | u16, - | ^^^ + --> tests/ui/fail/no_annotations.rs:21:2 + | +21 | u16, + | ^^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.rs index 4275aae045a604f9b5e8e746b87fd830b4c0bd27..2ae1aa2b9deb740ba8ba62ed4e1cd9b4dff71702 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!(pub struct TestSolution::< diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.stderr index 5759fee7472fab271a1a79f0a02c48684d7a5951..0a4bc7515f4e4d31b711a8d4a0f68d14f0ad3660 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.stderr @@ -1,5 +1,5 @@ error: Expected `VoterIndex` - --> $DIR/swap_voter_target.rs:4:2 - | -4 | TargetIndex = u16, - | ^^^^^^^^^^^ + --> tests/ui/fail/swap_voter_target.rs:21:2 + | +21 | TargetIndex = u16, + | ^^^^^^^^^^^ diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.rs b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.rs index a51cc724ad1580489fc8d71335717462df67fa54..4fcd8a815c954f4e42130091803e12f89a458d5e 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.rs +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_election_provider_solution_type::generate_solution_type; generate_solution_type!( diff --git a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.stderr b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.stderr index ab700a3f2afcbf4516d695aebbfe034ce08ffc22..a18b294516bd146572d0d120356e313a6fc80730 100644 --- a/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.stderr +++ b/substrate/frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.stderr @@ -1,5 +1,5 @@ error: compact solution can accept only #[compact] - --> $DIR/wrong_attribute.rs:4:2 - | -4 | #[pages(1)] pub struct TestSolution::< - | ^^^^^^^^^^^ + --> tests/ui/fail/wrong_attribute.rs:21:2 + | +21 | #[pages(1)] pub struct TestSolution::< + | ^^^^^^^^^^^ diff --git a/substrate/frame/elections-phragmen/src/migrations/v5.rs b/substrate/frame/elections-phragmen/src/migrations/v5.rs index eb35c1fae0f29645ceba82c9c38f83ad382e6561..6fac923703fec2071746c01fe9ccc6f6ad300c15 100644 --- a/substrate/frame/elections-phragmen/src/migrations/v5.rs +++ b/substrate/frame/elections-phragmen/src/migrations/v5.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::super::*; /// Migrate the locks and vote stake on accounts (as specified with param `to_migrate`) that have diff --git a/substrate/frame/examples/kitchensink/src/weights.rs b/substrate/frame/examples/kitchensink/src/weights.rs index 1d083a9b80eeaa69783f8a811f82b998f23f1938..43f48332ae946b684e912286b35705ac26086481 100644 --- a/substrate/frame/examples/kitchensink/src/weights.rs +++ b/substrate/frame/examples/kitchensink/src/weights.rs @@ -1,3 +1,19 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. //! Autogenerated weights for `pallet_example_kitchensink` //! diff --git a/substrate/frame/examples/split/src/weights.rs b/substrate/frame/examples/split/src/weights.rs index 4219ce1e2697c1a20d396ee24085e1efa87e3ec8..58b9e2af43a1c6a1c9447e5962f53f2af331597d 100644 --- a/substrate/frame/examples/split/src/weights.rs +++ b/substrate/frame/examples/split/src/weights.rs @@ -1,3 +1,19 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. //! Autogenerated weights for pallet_template //! diff --git a/substrate/frame/glutton/src/benchmarking.rs b/substrate/frame/glutton/src/benchmarking.rs index 587207587456a025b52f6819ff658b40007c5af3..fa93c7ccc82901608b7be9808118103064d010ee 100644 --- a/substrate/frame/glutton/src/benchmarking.rs +++ b/substrate/frame/glutton/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/glutton/src/lib.rs b/substrate/frame/glutton/src/lib.rs index c76cc30017cf00e639c0061ff73dc6f95062ab07..f5e90a17c735ec9f4c0fcb21b35824eea33d1136 100644 --- a/substrate/frame/glutton/src/lib.rs +++ b/substrate/frame/glutton/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -188,7 +188,7 @@ pub mod pallet { } fn on_idle(_: BlockNumberFor, remaining_weight: Weight) -> Weight { - let mut meter = WeightMeter::from_limit(remaining_weight); + let mut meter = WeightMeter::with_limit(remaining_weight); if meter.try_consume(T::WeightInfo::empty_on_idle()).is_err() { return T::WeightInfo::empty_on_idle() } @@ -197,7 +197,7 @@ pub mod pallet { Storage::::get().saturating_mul_int(meter.remaining().proof_size()); let computation_weight_limit = Compute::::get().saturating_mul_int(meter.remaining().ref_time()); - let mut meter = WeightMeter::from_limit(Weight::from_parts( + let mut meter = WeightMeter::with_limit(Weight::from_parts( computation_weight_limit, proof_size_limit, )); diff --git a/substrate/frame/glutton/src/mock.rs b/substrate/frame/glutton/src/mock.rs index c79ddd53718eb5acabe6a63105a93ac725b87a35..4bc40b5478870e7640a507e5292d308d5def10c0 100644 --- a/substrate/frame/glutton/src/mock.rs +++ b/substrate/frame/glutton/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/glutton/src/tests.rs b/substrate/frame/glutton/src/tests.rs index 1897ff63a70fb31a88c4effd192eb6db98404dca..b72d5272772540e5106af8cec248170cfcf910d6 100644 --- a/substrate/frame/glutton/src/tests.rs +++ b/substrate/frame/glutton/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -252,7 +252,7 @@ fn on_idle_weight_over_unity_is_close_enough_works() { fn waste_at_most_ref_time_weight_close_enough() { new_test_ext().execute_with(|| { let mut meter = - WeightMeter::from_limit(Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX)); + WeightMeter::with_limit(Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX)); // Over-spending fails defensively. Glutton::waste_at_most_ref_time(&mut meter); @@ -269,7 +269,7 @@ fn waste_at_most_ref_time_weight_close_enough() { fn waste_at_most_proof_size_weight_close_enough() { new_test_ext().execute_with(|| { let mut meter = - WeightMeter::from_limit(Weight::from_parts(u64::MAX, WEIGHT_PROOF_SIZE_PER_MB * 5)); + WeightMeter::with_limit(Weight::from_parts(u64::MAX, WEIGHT_PROOF_SIZE_PER_MB * 5)); // Over-spending fails defensively. Glutton::waste_at_most_proof_size(&mut meter); diff --git a/substrate/frame/lottery/src/lib.rs b/substrate/frame/lottery/src/lib.rs index c9c0254042424c7d5b46b386e942c9ed662250b7..c54f6d76803fff51e820b99db1b86c82b7629ca6 100644 --- a/substrate/frame/lottery/src/lib.rs +++ b/substrate/frame/lottery/src/lib.rs @@ -56,7 +56,7 @@ pub mod weights; use codec::{Decode, Encode}; use frame_support::{ - dispatch::{DispatchResult, Dispatchable, GetDispatchInfo}, + dispatch::{DispatchResult, GetDispatchInfo}, ensure, pallet_prelude::MaxEncodedLen, storage::bounded_vec::BoundedVec, @@ -65,7 +65,7 @@ use frame_support::{ }; pub use pallet::*; use sp_runtime::{ - traits::{AccountIdConversion, Saturating, Zero}, + traits::{AccountIdConversion, Dispatchable, Saturating, Zero}, ArithmeticError, DispatchError, RuntimeDebug, }; use sp_std::prelude::*; diff --git a/substrate/frame/message-queue/Cargo.toml b/substrate/frame/message-queue/Cargo.toml index 81f929c8f0732568452613be72d2c5b5f3ef2377..19ea25198f3489d5e6e8d9baf970bbef376bceae 100644 --- a/substrate/frame/message-queue/Cargo.toml +++ b/substrate/frame/message-queue/Cargo.toml @@ -11,7 +11,7 @@ description = "FRAME pallet to queue and process messages" [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } log = { version = "0.4.17", default-features = false } sp-core = { path = "../../primitives/core", default-features = false} diff --git a/substrate/frame/message-queue/src/benchmarking.rs b/substrate/frame/message-queue/src/benchmarking.rs index bbd321ceadd1abd622eff7c342170be4cf6b1376..eedaaebeca944bd8dfd1778fea82ad7504111d03 100644 --- a/substrate/frame/message-queue/src/benchmarking.rs +++ b/substrate/frame/message-queue/src/benchmarking.rs @@ -78,7 +78,7 @@ mod benchmarks { fn service_queue_base() { #[block] { - MessageQueue::::service_queue(0.into(), &mut WeightMeter::max_limit(), Weight::MAX); + MessageQueue::::service_queue(0.into(), &mut WeightMeter::new(), Weight::MAX); } } @@ -89,7 +89,7 @@ mod benchmarks { let page = PageOf::::default(); Pages::::insert(&origin, 0, &page); let mut book_state = single_page_book::(); - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); let limit = Weight::MAX; #[block] @@ -108,7 +108,7 @@ mod benchmarks { page.remaining = 1.into(); Pages::::insert(&origin, 0, &page); let mut book_state = single_page_book::(); - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); let limit = Weight::MAX; #[block] @@ -124,7 +124,7 @@ mod benchmarks { let mut page = page::(&msg.clone()); let mut book = book_for::(&page); assert!(page.peek_first().is_some(), "There is one message"); - let mut weight = WeightMeter::max_limit(); + let mut weight = WeightMeter::new(); #[block] { @@ -158,7 +158,7 @@ mod benchmarks { #[benchmark] fn bump_service_head() { setup_bump_service_head::(0.into(), 10.into()); - let mut weight = WeightMeter::max_limit(); + let mut weight = WeightMeter::new(); #[block] { diff --git a/substrate/frame/message-queue/src/lib.rs b/substrate/frame/message-queue/src/lib.rs index 5acc3e9d5a1385245e5fbe95305fd24ad2436cd5..9ded84bb035c5f1adf964e9748dc3805fad3ff61 100644 --- a/substrate/frame/message-queue/src/lib.rs +++ b/substrate/frame/message-queue/src/lib.rs @@ -832,7 +832,7 @@ impl Pallet { ); ensure!(!is_processed, Error::::AlreadyProcessed); use MessageExecutionStatus::*; - let mut weight_counter = WeightMeter::from_limit(weight_limit); + let mut weight_counter = WeightMeter::with_limit(weight_limit); match Self::process_message_payload( origin.clone(), page_index, @@ -1150,7 +1150,7 @@ impl Pallet { //loop around this origin let starting_origin = ServiceHead::::get().unwrap(); - while let Some(head) = Self::bump_service_head(&mut WeightMeter::max_limit()) { + while let Some(head) = Self::bump_service_head(&mut WeightMeter::new()) { ensure!( BookStateFor::::contains_key(&head), "Service head must point to an existing book" @@ -1362,7 +1362,7 @@ impl ServiceQueues for Pallet { fn service_queues(weight_limit: Weight) -> Weight { // The maximum weight that processing a single message may take. let overweight_limit = weight_limit; - let mut weight = WeightMeter::from_limit(weight_limit); + let mut weight = WeightMeter::with_limit(weight_limit); let mut next = match Self::bump_service_head(&mut weight) { Some(h) => h, @@ -1402,7 +1402,7 @@ impl ServiceQueues for Pallet { weight_limit: Weight, (message_origin, page, index): Self::OverweightMessageAddress, ) -> Result { - let mut weight = WeightMeter::from_limit(weight_limit); + let mut weight = WeightMeter::with_limit(weight_limit); if weight .try_consume( T::WeightInfo::execute_overweight_page_removed() diff --git a/substrate/frame/message-queue/src/tests.rs b/substrate/frame/message-queue/src/tests.rs index bcb099a6accd12b29abe5a6865e551fab5c23627..092bd1d833450502f383e30fedca033d28a22179 100644 --- a/substrate/frame/message-queue/src/tests.rs +++ b/substrate/frame/message-queue/src/tests.rs @@ -381,7 +381,7 @@ fn service_queue_bails() { // Not enough weight for `service_queue_base`. build_and_execute::(|| { set_weight("service_queue_base", 2.into_weight()); - let mut meter = WeightMeter::from_limit(1.into_weight()); + let mut meter = WeightMeter::with_limit(1.into_weight()); assert_storage_noop!(MessageQueue::service_queue(0u32.into(), &mut meter, Weight::MAX)); assert!(meter.consumed().is_zero()); @@ -389,7 +389,7 @@ fn service_queue_bails() { // Not enough weight for `ready_ring_unknit`. build_and_execute::(|| { set_weight("ready_ring_unknit", 2.into_weight()); - let mut meter = WeightMeter::from_limit(1.into_weight()); + let mut meter = WeightMeter::with_limit(1.into_weight()); assert_storage_noop!(MessageQueue::service_queue(0u32.into(), &mut meter, Weight::MAX)); assert!(meter.consumed().is_zero()); @@ -399,7 +399,7 @@ fn service_queue_bails() { set_weight("service_queue_base", 2.into_weight()); set_weight("ready_ring_unknit", 2.into_weight()); - let mut meter = WeightMeter::from_limit(3.into_weight()); + let mut meter = WeightMeter::with_limit(3.into_weight()); assert_storage_noop!(MessageQueue::service_queue(0.into(), &mut meter, Weight::MAX)); assert!(meter.consumed().is_zero()); }); @@ -426,7 +426,7 @@ fn service_page_works() { msgs -= process; // Enough weight to process `process` messages. - let mut meter = WeightMeter::from_limit(((2 + (3 + 1) * process) as u64).into_weight()); + let mut meter = WeightMeter::with_limit(((2 + (3 + 1) * process) as u64).into_weight()); System::reset_events(); let (processed, status) = crate::Pallet::::service_page(&Here, &mut book, &mut meter, Weight::MAX); @@ -449,7 +449,7 @@ fn service_page_bails() { // Not enough weight for `service_page_base_completion`. build_and_execute::(|| { set_weight("service_page_base_completion", 2.into_weight()); - let mut meter = WeightMeter::from_limit(1.into_weight()); + let mut meter = WeightMeter::with_limit(1.into_weight()); let (page, _) = full_page::(); let mut book = book_for::(&page); @@ -466,7 +466,7 @@ fn service_page_bails() { // Not enough weight for `service_page_base_no_completion`. build_and_execute::(|| { set_weight("service_page_base_no_completion", 2.into_weight()); - let mut meter = WeightMeter::from_limit(1.into_weight()); + let mut meter = WeightMeter::with_limit(1.into_weight()); let (page, _) = full_page::(); let mut book = book_for::(&page); @@ -487,7 +487,7 @@ fn service_page_item_bails() { build_and_execute::(|| { let _guard = StorageNoopGuard::default(); let (mut page, _) = full_page::(); - let mut weight = WeightMeter::from_limit(10.into_weight()); + let mut weight = WeightMeter::with_limit(10.into_weight()); let overweight_limit = 10.into_weight(); set_weight("service_page_item", 11.into_weight()); @@ -518,7 +518,7 @@ fn service_page_suspension_works() { Pages::::insert(Here, 0, page); // First we process 5 messages from this page. - let mut meter = WeightMeter::from_limit(5.into_weight()); + let mut meter = WeightMeter::with_limit(5.into_weight()); let (_, status) = crate::Pallet::::service_page(&Here, &mut book, &mut meter, Weight::MAX); @@ -534,7 +534,7 @@ fn service_page_suspension_works() { let (_, status) = crate::Pallet::::service_page( &Here, &mut book, - &mut WeightMeter::max_limit(), + &mut WeightMeter::new(), Weight::MAX, ); assert_eq!(status, NoProgress); @@ -546,7 +546,7 @@ fn service_page_suspension_works() { let (_, status) = crate::Pallet::::service_page( &Here, &mut book, - &mut WeightMeter::max_limit(), + &mut WeightMeter::new(), Weight::MAX, ); assert_eq!(status, NoMore); @@ -564,7 +564,7 @@ fn bump_service_head_works() { // Bump 99 times. for i in 0..99 { - let current = MessageQueue::bump_service_head(&mut WeightMeter::max_limit()).unwrap(); + let current = MessageQueue::bump_service_head(&mut WeightMeter::new()).unwrap(); assert_eq!(current, [Here, There, Everywhere(0)][i % 3]); } @@ -581,7 +581,7 @@ fn bump_service_head_bails() { setup_bump_service_head::(0.into(), 1.into()); let _guard = StorageNoopGuard::default(); - let mut meter = WeightMeter::from_limit(1.into_weight()); + let mut meter = WeightMeter::with_limit(1.into_weight()); assert!(MessageQueue::bump_service_head(&mut meter).is_none()); assert_eq!(meter.consumed(), 0.into_weight()); }); @@ -591,7 +591,7 @@ fn bump_service_head_bails() { fn bump_service_head_trivial_works() { build_and_execute::(|| { set_weight("bump_service_head", 2.into_weight()); - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); assert_eq!(MessageQueue::bump_service_head(&mut meter), None, "Cannot bump"); assert_eq!(meter.consumed(), 2.into_weight()); @@ -616,7 +616,7 @@ fn bump_service_head_no_head_noops() { ServiceHead::::kill(); // Nothing happens. - assert_storage_noop!(MessageQueue::bump_service_head(&mut WeightMeter::max_limit())); + assert_storage_noop!(MessageQueue::bump_service_head(&mut WeightMeter::new())); }); } @@ -624,7 +624,7 @@ fn bump_service_head_no_head_noops() { fn service_page_item_consumes_correct_weight() { build_and_execute::(|| { let mut page = page::(b"weight=3"); - let mut weight = WeightMeter::from_limit(10.into_weight()); + let mut weight = WeightMeter::with_limit(10.into_weight()); let overweight_limit = 0.into_weight(); set_weight("service_page_item", 2.into_weight()); @@ -648,7 +648,7 @@ fn service_page_item_consumes_correct_weight() { fn service_page_item_skips_perm_overweight_message() { build_and_execute::(|| { let mut page = page::(b"TooMuch"); - let mut weight = WeightMeter::from_limit(2.into_weight()); + let mut weight = WeightMeter::with_limit(2.into_weight()); let overweight_limit = 0.into_weight(); set_weight("service_page_item", 2.into_weight()); diff --git a/substrate/frame/multisig/src/migrations.rs b/substrate/frame/multisig/src/migrations.rs index 298e73c5d75762408229bfae29b7268e67a0185d..3be55080b2407478b015ecbca653bb7919c2a482 100644 --- a/substrate/frame/multisig/src/migrations.rs +++ b/substrate/frame/multisig/src/migrations.rs @@ -19,8 +19,7 @@ use super::*; use frame_support::{ - dispatch::GetStorageVersion, - traits::{OnRuntimeUpgrade, WrapperKeepOpaque}, + traits::{GetStorageVersion, OnRuntimeUpgrade, WrapperKeepOpaque}, Identity, }; diff --git a/substrate/frame/nft-fractionalization/src/lib.rs b/substrate/frame/nft-fractionalization/src/lib.rs index b1663e95d855d8af6def429236e11b55ba3ab891..e97d3802fd206ca52ee008da007b46776ea76de8 100644 --- a/substrate/frame/nft-fractionalization/src/lib.rs +++ b/substrate/frame/nft-fractionalization/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/nft-fractionalization/src/mock.rs b/substrate/frame/nft-fractionalization/src/mock.rs index 6565adaf6fc7e6bc1ebdcc6f7e7f223ea005e16d..c690f0e580ed6242cc68066893dc563758984ca0 100644 --- a/substrate/frame/nft-fractionalization/src/mock.rs +++ b/substrate/frame/nft-fractionalization/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/nft-fractionalization/src/tests.rs b/substrate/frame/nft-fractionalization/src/tests.rs index b82402bda1e678a34a248378424ef02be6416e10..036cc668db2dc9b1dc6c2db4f095168668d0d7c4 100644 --- a/substrate/frame/nft-fractionalization/src/tests.rs +++ b/substrate/frame/nft-fractionalization/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/nft-fractionalization/src/types.rs b/substrate/frame/nft-fractionalization/src/types.rs index cbaaf5f5160d3168127b1883b52e879fb92696f1..8df65b15112cb232d23b5429394860d21194ddcb 100644 --- a/substrate/frame/nft-fractionalization/src/types.rs +++ b/substrate/frame/nft-fractionalization/src/types.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/nfts/runtime-api/Cargo.toml b/substrate/frame/nfts/runtime-api/Cargo.toml index 9c0d817723d13439be91f80376b60710ea247215..483c4bd323423e02bf538f670d045e0ed98391d8 100644 --- a/substrate/frame/nfts/runtime-api/Cargo.toml +++ b/substrate/frame/nfts/runtime-api/Cargo.toml @@ -14,10 +14,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } -frame-support = { path = "../../support", default-features = false} pallet-nfts = { path = "..", default-features = false} sp-api = { path = "../../../primitives/api", default-features = false} [features] default = [ "std" ] -std = [ "codec/std", "frame-support/std", "pallet-nfts/std", "sp-api/std" ] +std = [ "codec/std", "pallet-nfts/std", "sp-api/std" ] diff --git a/substrate/frame/nfts/runtime-api/src/lib.rs b/substrate/frame/nfts/runtime-api/src/lib.rs index 0c23d178107e714e44a78b41b74d1210b56178d4..cf2d444b42f8c32f3e7a0c90a9a20f0979727c3e 100644 --- a/substrate/frame/nfts/runtime-api/src/lib.rs +++ b/substrate/frame/nfts/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode}; -use frame_support::dispatch::Vec; +use sp_api::vec::Vec; sp_api::decl_runtime_apis! { pub trait NftsApi diff --git a/substrate/frame/nfts/src/benchmarking.rs b/substrate/frame/nfts/src/benchmarking.rs index 995c842036746c86ca9ab3441a72fe4a52f2a820..8792af675fc16de7c18f07312aa74e4bab46d3db 100644 --- a/substrate/frame/nfts/src/benchmarking.rs +++ b/substrate/frame/nfts/src/benchmarking.rs @@ -26,8 +26,7 @@ use frame_benchmarking::v1::{ }; use frame_support::{ assert_ok, - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get}, + traits::{EnsureOrigin, Get, UnfilteredDispatchable}, BoundedVec, }; use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin as SystemOrigin}; diff --git a/substrate/frame/nfts/src/tests.rs b/substrate/frame/nfts/src/tests.rs index f7879570a4cb74efc2714d35b0d42d2c4a80b946..6e264048f11a6e332447061b808a77d4927e3a2c 100644 --- a/substrate/frame/nfts/src/tests.rs +++ b/substrate/frame/nfts/src/tests.rs @@ -21,7 +21,6 @@ use crate::{mock::*, Event, *}; use enumflags2::BitFlags; use frame_support::{ assert_noop, assert_ok, - dispatch::Dispatchable, traits::{ tokens::nonfungibles_v2::{Create, Destroy, Mutate}, Currency, Get, @@ -29,7 +28,10 @@ use frame_support::{ }; use pallet_balances::Error as BalancesError; use sp_core::{bounded::BoundedVec, Pair}; -use sp_runtime::{traits::IdentifyAccount, MultiSignature, MultiSigner}; +use sp_runtime::{ + traits::{Dispatchable, IdentifyAccount}, + MultiSignature, MultiSigner, +}; use sp_std::prelude::*; type AccountIdOf = ::AccountId; diff --git a/substrate/frame/nomination-pools/src/mock.rs b/substrate/frame/nomination-pools/src/mock.rs index 13c739af39431f31c2a8e76d630d66c36c852ed3..e2198f6f0308400783577f3e233a69cdcb14ecd2 100644 --- a/substrate/frame/nomination-pools/src/mock.rs +++ b/substrate/frame/nomination-pools/src/mock.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::*; use crate::{self as pools}; use frame_support::{assert_ok, parameter_types, PalletId}; diff --git a/substrate/frame/offences/Cargo.toml b/substrate/frame/offences/Cargo.toml index 7e9b093a038693537a1088ebbceb4f0da9253d83..2cfbfe6b5d0a1a5822cdd4cc133356c60078a5fc 100644 --- a/substrate/frame/offences/Cargo.toml +++ b/substrate/frame/offences/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} pallet-balances = { path = "../balances", default-features = false} diff --git a/substrate/frame/offences/src/migration.rs b/substrate/frame/offences/src/migration.rs index 3c0d243a55d98d4e6b47601def317939d03e40cc..3b5cf3ce926952df21248ea5b35271d6596a554b 100644 --- a/substrate/frame/offences/src/migration.rs +++ b/substrate/frame/offences/src/migration.rs @@ -17,10 +17,9 @@ use super::{Config, Kind, OffenceDetails, Pallet, Perbill, SessionIndex, LOG_TARGET}; use frame_support::{ - dispatch::GetStorageVersion, pallet_prelude::ValueQuery, storage_alias, - traits::{Get, OnRuntimeUpgrade}, + traits::{Get, GetStorageVersion, OnRuntimeUpgrade}, weights::Weight, Twox64Concat, }; diff --git a/substrate/frame/paged-list/fuzzer/Cargo.toml b/substrate/frame/paged-list/fuzzer/Cargo.toml index a6f499d0da12e8adb469c21341cea2eddd5933e3..d96c0348cf43c44d9e8617833fff64a806769c0a 100644 --- a/substrate/frame/paged-list/fuzzer/Cargo.toml +++ b/substrate/frame/paged-list/fuzzer/Cargo.toml @@ -10,7 +10,7 @@ description = "Fuzz storage types of pallet-paged-list" publish = false [[bin]] -name = "pallet-paged-list" +name = "pallet-paged-list-fuzzer" path = "src/paged_list.rs" [dependencies] diff --git a/substrate/frame/proxy/src/lib.rs b/substrate/frame/proxy/src/lib.rs index 586d52fb62bddabc0f17bd46aeb77dc60d4cd9ec..4d4da0433afa015a6c33e8ee68e1e1c90851ce97 100644 --- a/substrate/frame/proxy/src/lib.rs +++ b/substrate/frame/proxy/src/lib.rs @@ -35,7 +35,7 @@ pub mod weights; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::{DispatchError, GetDispatchInfo}, + dispatch::GetDispatchInfo, ensure, traits::{Currency, Get, InstanceFilter, IsSubType, IsType, OriginTrait, ReservableCurrency}, }; @@ -45,7 +45,7 @@ use scale_info::TypeInfo; use sp_io::hashing::blake2_256; use sp_runtime::{ traits::{Dispatchable, Hash, Saturating, StaticLookup, TrailingZeroInput, Zero}, - DispatchResult, RuntimeDebug, + DispatchError, DispatchResult, RuntimeDebug, }; use sp_std::prelude::*; pub use weights::WeightInfo; diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs index 48a2a4ed0cc33b1d21fabb4a08d30a41046c70d3..0667be6e1e52b87c89b887171fe4d418dc2f6412 100644 --- a/substrate/frame/proxy/src/tests.rs +++ b/substrate/frame/proxy/src/tests.rs @@ -25,11 +25,10 @@ use crate as proxy; use codec::{Decode, Encode}; use frame_support::{ assert_noop, assert_ok, derive_impl, - dispatch::DispatchError, traits::{ConstU32, ConstU64, Contains}, }; use sp_core::H256; -use sp_runtime::{traits::BlakeTwo256, BuildStorage, RuntimeDebug}; +use sp_runtime::{traits::BlakeTwo256, BuildStorage, DispatchError, RuntimeDebug}; type Block = frame_system::mocking::MockBlock; diff --git a/substrate/frame/ranked-collective/src/benchmarking.rs b/substrate/frame/ranked-collective/src/benchmarking.rs index b610d10009a0899aac26d7f832f319f00595e624..518428880e4dead922ae32609833ef506db64a43 100644 --- a/substrate/frame/ranked-collective/src/benchmarking.rs +++ b/substrate/frame/ranked-collective/src/benchmarking.rs @@ -24,7 +24,7 @@ use crate::Pallet as RankedCollective; use frame_benchmarking::v1::{ account, benchmarks_instance_pallet, whitelisted_caller, BenchmarkError, }; -use frame_support::{assert_ok, dispatch::UnfilteredDispatchable}; +use frame_support::{assert_ok, traits::UnfilteredDispatchable}; use frame_system::RawOrigin as SystemOrigin; const SEED: u32 = 0; diff --git a/substrate/frame/ranked-collective/src/lib.rs b/substrate/frame/ranked-collective/src/lib.rs index d94932a1dac71a7e14afde4f96d52544b890a7b7..deb1ccf23578b797ad0ce950b3b721609010c2ff 100644 --- a/substrate/frame/ranked-collective/src/lib.rs +++ b/substrate/frame/ranked-collective/src/lib.rs @@ -47,12 +47,12 @@ use sp_arithmetic::traits::Saturating; use sp_runtime::{ traits::{Convert, StaticLookup}, ArithmeticError::Overflow, - Perbill, RuntimeDebug, + DispatchError, Perbill, RuntimeDebug, }; use sp_std::{marker::PhantomData, prelude::*}; use frame_support::{ - dispatch::{DispatchError, DispatchResultWithPostInfo, PostDispatchInfo}, + dispatch::{DispatchResultWithPostInfo, PostDispatchInfo}, ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{EnsureOrigin, EnsureOriginWithArg, PollStatus, Polling, RankedMembers, VoteTally}, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, diff --git a/substrate/frame/referenda/Cargo.toml b/substrate/frame/referenda/Cargo.toml index 6c0e86db346bf8f908e5825670fc808b64d88112..ac4f46d12df957821bde1cdc626b7ef613401648 100644 --- a/substrate/frame/referenda/Cargo.toml +++ b/substrate/frame/referenda/Cargo.toml @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = "derive", ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"], optional = true } +serde = { version = "1.0.188", features = ["derive"], optional = true } sp-arithmetic = { path = "../../primitives/arithmetic", default-features = false} frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} diff --git a/substrate/frame/referenda/src/benchmarking.rs b/substrate/frame/referenda/src/benchmarking.rs index 78d14bd99d2ee6a3f03b94e3bcfe1293153e2d24..e884a0bb6ec921edf3f3ff93818482941ee1abea 100644 --- a/substrate/frame/referenda/src/benchmarking.rs +++ b/substrate/frame/referenda/src/benchmarking.rs @@ -25,8 +25,7 @@ use frame_benchmarking::v1::{ }; use frame_support::{ assert_ok, - dispatch::UnfilteredDispatchable, - traits::{Bounded, Currency, EnsureOrigin, EnsureOriginWithArg}, + traits::{Bounded, Currency, EnsureOrigin, EnsureOriginWithArg, UnfilteredDispatchable}, }; use frame_system::RawOrigin; use sp_runtime::traits::Bounded as ArithBounded; diff --git a/substrate/frame/referenda/src/tests.rs b/substrate/frame/referenda/src/tests.rs index c7469946c2dab84a6fc0f3bfa32b77c49d16596e..d748c524605a839b5d9f5b4804cf0d799452bc0c 100644 --- a/substrate/frame/referenda/src/tests.rs +++ b/substrate/frame/referenda/src/tests.rs @@ -21,12 +21,9 @@ use super::*; use crate::mock::{RefState::*, *}; use assert_matches::assert_matches; use codec::Decode; -use frame_support::{ - assert_noop, assert_ok, - dispatch::{DispatchError::BadOrigin, RawOrigin}, - traits::Contains, -}; +use frame_support::{assert_noop, assert_ok, dispatch::RawOrigin, traits::Contains}; use pallet_balances::Error as BalancesError; +use sp_runtime::DispatchError::BadOrigin; #[test] fn params_should_work() { diff --git a/substrate/frame/remark/Cargo.toml b/substrate/frame/remark/Cargo.toml index cf98ae2794a938c820fe58585fdfad56dc0c3802..ae791011b160c47d7ec74371acccbd837050df09 100644 --- a/substrate/frame/remark/Cargo.toml +++ b/substrate/frame/remark/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/safe-mode/src/tests.rs b/substrate/frame/safe-mode/src/tests.rs index 4ce9922d3b65c70646caec497a394704973edcc9..1e2eb343aa2f7fd26a20f89b9b31078d1ce1fb78 100644 --- a/substrate/frame/safe-mode/src/tests.rs +++ b/substrate/frame/safe-mode/src/tests.rs @@ -22,8 +22,8 @@ use super::*; use crate::mock::{RuntimeCall, *}; -use frame_support::{assert_err, assert_noop, assert_ok, dispatch::Dispatchable, traits::Currency}; -use sp_runtime::TransactionOutcome; +use frame_support::{assert_err, assert_noop, assert_ok, traits::Currency}; +use sp_runtime::{traits::Dispatchable, TransactionOutcome}; /// Do something hypothetically by rolling back any changes afterwards. /// diff --git a/substrate/frame/salary/src/lib.rs b/substrate/frame/salary/src/lib.rs index 75d6fdd329ac82582edb7df0412a36bf0325a599..f2903f527f25a5c21348e8214d5a2afe5bc4f14b 100644 --- a/substrate/frame/salary/src/lib.rs +++ b/substrate/frame/salary/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/salary/src/tests.rs b/substrate/frame/salary/src/tests.rs index 034dce24b8b3883a768a54074f73510cab02a08a..1136ea746f605cde30a4a09c651e90e8b4acae9c 100644 --- a/substrate/frame/salary/src/tests.rs +++ b/substrate/frame/salary/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/scheduler/src/benchmarking.rs b/substrate/frame/scheduler/src/benchmarking.rs index b41cea449654c5035e0cb2024177ae0db549c71b..341a19cdb230223536621db424f0e300399279e8 100644 --- a/substrate/frame/scheduler/src/benchmarking.rs +++ b/substrate/frame/scheduler/src/benchmarking.rs @@ -131,7 +131,7 @@ benchmarks! { let now = BlockNumberFor::::from(BLOCK_NUMBER); IncompleteSince::::put(now - One::one()); }: { - Scheduler::::service_agendas(&mut WeightMeter::max_limit(), now, 0); + Scheduler::::service_agendas(&mut WeightMeter::new(), now, 0); } verify { assert_eq!(IncompleteSince::::get(), Some(now - One::one())); } @@ -143,7 +143,7 @@ benchmarks! { fill_schedule::(now, s)?; let mut executed = 0; }: { - Scheduler::::service_agenda(&mut WeightMeter::max_limit(), &mut executed, now, now, 0); + Scheduler::::service_agenda(&mut WeightMeter::new(), &mut executed, now, now, 0); } verify { assert_eq!(executed, 0); } @@ -154,7 +154,7 @@ benchmarks! { let now = BLOCK_NUMBER.into(); let task = make_task::(false, false, false, None, 0); // prevent any tasks from actually being executed as we only want the surrounding weight. - let mut counter = WeightMeter::from_limit(Weight::zero()); + let mut counter = WeightMeter::with_limit(Weight::zero()); }: { let result = Scheduler::::service_task(&mut counter, now, now, 0, true, task); } verify { @@ -172,7 +172,7 @@ benchmarks! { let now = BLOCK_NUMBER.into(); let task = make_task::(false, false, false, Some(s), 0); // prevent any tasks from actually being executed as we only want the surrounding weight. - let mut counter = WeightMeter::from_limit(Weight::zero()); + let mut counter = WeightMeter::with_limit(Weight::zero()); }: { let result = Scheduler::::service_task(&mut counter, now, now, 0, true, task); } verify { @@ -184,7 +184,7 @@ benchmarks! { let now = BLOCK_NUMBER.into(); let task = make_task::(false, true, false, None, 0); // prevent any tasks from actually being executed as we only want the surrounding weight. - let mut counter = WeightMeter::from_limit(Weight::zero()); + let mut counter = WeightMeter::with_limit(Weight::zero()); }: { let result = Scheduler::::service_task(&mut counter, now, now, 0, true, task); } verify { @@ -196,7 +196,7 @@ benchmarks! { let now = BLOCK_NUMBER.into(); let task = make_task::(true, false, false, None, 0); // prevent any tasks from actually being executed as we only want the surrounding weight. - let mut counter = WeightMeter::from_limit(Weight::zero()); + let mut counter = WeightMeter::with_limit(Weight::zero()); }: { let result = Scheduler::::service_task(&mut counter, now, now, 0, true, task); } verify { @@ -204,7 +204,7 @@ benchmarks! { // `execute_dispatch` when the origin is `Signed`, not counting the dispatable's weight. execute_dispatch_signed { - let mut counter = WeightMeter::max_limit(); + let mut counter = WeightMeter::new(); let origin = make_origin::(true); let call = T::Preimages::realize(&make_call::(None)).unwrap().0; }: { @@ -215,7 +215,7 @@ benchmarks! { // `execute_dispatch` when the origin is not `Signed`, not counting the dispatable's weight. execute_dispatch_unsigned { - let mut counter = WeightMeter::max_limit(); + let mut counter = WeightMeter::new(); let origin = make_origin::(false); let call = T::Preimages::realize(&make_call::(None)).unwrap().0; }: { diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index 3538331bbd4ca0ebf9a3cf00712bdc9f12914cd6..3da4aa03caeb040bea5c3fc2ac6e63d1ca958e1e 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -87,9 +87,7 @@ pub mod weights; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::{ - DispatchError, DispatchResult, Dispatchable, GetDispatchInfo, Parameter, RawOrigin, - }, + dispatch::{DispatchResult, GetDispatchInfo, Parameter, RawOrigin}, ensure, traits::{ schedule::{self, DispatchTime, MaybeHashed}, @@ -105,8 +103,8 @@ use frame_system::{ use scale_info::TypeInfo; use sp_io::hashing::blake2_256; use sp_runtime::{ - traits::{BadOrigin, One, Saturating, Zero}, - BoundedVec, RuntimeDebug, + traits::{BadOrigin, Dispatchable, One, Saturating, Zero}, + BoundedVec, DispatchError, RuntimeDebug, }; use sp_std::{borrow::Borrow, cmp::Ordering, marker::PhantomData, prelude::*}; @@ -320,7 +318,7 @@ pub mod pallet { impl Hooks> for Pallet { /// Execute the scheduled calls fn on_initialize(now: BlockNumberFor) -> Weight { - let mut weight_counter = WeightMeter::from_limit(T::MaximumWeight::get()); + let mut weight_counter = WeightMeter::with_limit(T::MaximumWeight::get()); Self::service_agendas(&mut weight_counter, now, u32::max_value()); weight_counter.consumed() } @@ -1096,7 +1094,14 @@ impl Pallet { let (call, lookup_len) = match T::Preimages::peek(&task.call) { Ok(c) => c, - Err(_) => return Err((Unavailable, Some(task))), + Err(_) => { + Self::deposit_event(Event::CallUnavailable { + task: (when, agenda_index), + id: task.maybe_id, + }); + + return Err((Unavailable, Some(task))) + }, }; let _ = weight.try_consume(T::WeightInfo::service_task( @@ -1106,15 +1111,7 @@ impl Pallet { )); match Self::execute_dispatch(weight, task.origin.clone(), call) { - Err(Unavailable) => { - debug_assert!(false, "Checked to exist with `peek`"); - Self::deposit_event(Event::CallUnavailable { - task: (when, agenda_index), - id: task.maybe_id, - }); - Err((Unavailable, Some(task))) - }, - Err(Overweight) if is_first => { + Err(()) if is_first => { T::Preimages::drop(&task.call); Self::deposit_event(Event::PermanentlyOverweight { task: (when, agenda_index), @@ -1122,7 +1119,7 @@ impl Pallet { }); Err((Unavailable, Some(task))) }, - Err(Overweight) => Err((Overweight, Some(task))), + Err(()) => Err((Overweight, Some(task))), Ok(result) => { Self::deposit_event(Event::Dispatched { task: (when, agenda_index), @@ -1162,11 +1159,13 @@ impl Pallet { /// /// NOTE: Only the weight for this function will be counted (origin lookup, dispatch and the /// call itself). + /// + /// Returns an error if the call is overweight. fn execute_dispatch( weight: &mut WeightMeter, origin: T::PalletsOrigin, call: ::RuntimeCall, - ) -> Result { + ) -> Result { let base_weight = match origin.as_system_ref() { Some(&RawOrigin::Signed(_)) => T::WeightInfo::execute_dispatch_signed(), _ => T::WeightInfo::execute_dispatch_unsigned(), @@ -1176,7 +1175,7 @@ impl Pallet { let max_weight = base_weight.saturating_add(call_weight); if !weight.can_consume(max_weight) { - return Err(Overweight) + return Err(()) } let dispatch_origin = origin.into(); diff --git a/substrate/frame/scheduler/src/tests.rs b/substrate/frame/scheduler/src/tests.rs index 477df5579dcf1d8f5984e7fb982b406f891e3323..25a60732e060bcb535a1bed46fcb9cecd6041931 100644 --- a/substrate/frame/scheduler/src/tests.rs +++ b/substrate/frame/scheduler/src/tests.rs @@ -1878,3 +1878,42 @@ fn reschedule_named_last_task_removes_agenda() { assert!(Agenda::::get(when).len() == 0); }); } + +/// Ensures that an unvailable call sends an event. +#[test] +fn unavailable_call_is_detected() { + use frame_support::traits::schedule::v3::Named; + + new_test_ext().execute_with(|| { + let call = + RuntimeCall::Logger(LoggerCall::log { i: 42, weight: Weight::from_parts(10, 0) }); + let hash = ::Hashing::hash_of(&call); + let len = call.using_encoded(|x| x.len()) as u32; + // Important to use here `Bounded::Lookup` to ensure that we request the hash. + let bound = Bounded::Lookup { hash, len }; + + let name = [1u8; 32]; + + // Schedule a call. + let _address = >::schedule_named( + name, + DispatchTime::At(4), + None, + 127, + root(), + bound.clone(), + ) + .unwrap(); + + // Ensure the preimage isn't available + assert!(!Preimage::have(&bound)); + + // Executes in block 4. + run_to_block(4); + + assert_eq!( + System::events().last().unwrap().event, + crate::Event::CallUnavailable { task: (4, 0), id: Some(name) }.into() + ); + }); +} diff --git a/substrate/frame/session/src/lib.rs b/substrate/frame/session/src/lib.rs index 1c0093c1df64f36aaee8f8a188f7acef9ba7acce..bf4671a247f0d1677d53f3295a3ccd518bba4ce2 100644 --- a/substrate/frame/session/src/lib.rs +++ b/substrate/frame/session/src/lib.rs @@ -117,7 +117,7 @@ pub mod weights; use codec::{Decode, MaxEncodedLen}; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, traits::{ EstimateNextNewSession, EstimateNextSessionRotation, FindAuthor, Get, OneSessionHandler, @@ -129,7 +129,7 @@ use frame_support::{ use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::{ traits::{AtLeast32BitUnsigned, Convert, Member, One, OpaqueKeys, Zero}, - ConsensusEngineId, KeyTypeId, Permill, RuntimeAppPublic, + ConsensusEngineId, DispatchError, KeyTypeId, Permill, RuntimeAppPublic, }; use sp_staking::SessionIndex; use sp_std::{ diff --git a/substrate/frame/society/Cargo.toml b/substrate/frame/society/Cargo.toml index c112e2bbb8cc9edcbcd8db75e76b89d007ffddcb..1510e17b8b57025f5476742b229fdac0c1e9e02b 100644 --- a/substrate/frame/society/Cargo.toml +++ b/substrate/frame/society/Cargo.toml @@ -34,7 +34,7 @@ sp-io = { path = "../../primitives/io" } [features] default = [ "std" ] -# Enable `VersionedRuntimeUpgrade` for the migrations that is currently still experimental. +# Enable `VersionedMigration` for migrations using this feature. experimental = [ "frame-support/experimental" ] std = [ "codec/std", diff --git a/substrate/frame/society/src/migrations.rs b/substrate/frame/society/src/migrations.rs index 4685167dcbcfd34fb595605f14a540a1c8ec24aa..b50b0e088a6e882b6c9a8060c658c5abd08cbf87 100644 --- a/substrate/frame/society/src/migrations.rs +++ b/substrate/frame/society/src/migrations.rs @@ -93,12 +93,11 @@ impl< } } -/// [`VersionUncheckedMigrateToV2`] wrapped in a -/// [`frame_support::migrations::VersionedRuntimeUpgrade`], ensuring the migration is only performed -/// when on-chain version is 0. +/// [`VersionUncheckedMigrateToV2`] wrapped in a [`frame_support::migrations::VersionedMigration`], +/// ensuring the migration is only performed when on-chain version is 0. #[cfg(feature = "experimental")] pub type VersionCheckedMigrateToV2 = - frame_support::migrations::VersionedRuntimeUpgrade< + frame_support::migrations::VersionedMigration< 0, 2, VersionUncheckedMigrateToV2, diff --git a/substrate/frame/society/src/weights.rs b/substrate/frame/society/src/weights.rs index d113f617c886ca7f694e0601d7bc6531800296db..7c59aed8449a21c72afb39bdd11e14a315d1c659 100644 --- a/substrate/frame/society/src/weights.rs +++ b/substrate/frame/society/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/staking/Cargo.toml b/substrate/frame/staking/Cargo.toml index 491d19008da00d344aeee179faaadd059b4480ac..5cd134471ebcd61731d943adee66199d0c6757d4 100644 --- a/substrate/frame/staking/Cargo.toml +++ b/substrate/frame/staking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.163", default-features = false, features = ["alloc", "derive"]} +serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"]} codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ "derive", ] } diff --git a/substrate/frame/staking/reward-curve/src/log.rs b/substrate/frame/staking/reward-curve/src/log.rs index 248a1e3c36a6e226b6c4f95bbff2b383c012ea17..70191180da3c3e626c203031b7135f00a252ce5f 100644 --- a/substrate/frame/staking/reward-curve/src/log.rs +++ b/substrate/frame/staking/reward-curve/src/log.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Simple u32 power of 2 function - simply uses a bit shift macro_rules! pow2 { ($n:expr) => { diff --git a/substrate/frame/staking/runtime-api/src/lib.rs b/substrate/frame/staking/runtime-api/src/lib.rs index 378599c665506007ddae5ea227829d4af2483103..c669d222ec68b2ec6305cbffc3d0003acdc78c94 100644 --- a/substrate/frame/staking/runtime-api/src/lib.rs +++ b/substrate/frame/staking/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/staking/src/benchmarking.rs b/substrate/frame/staking/src/benchmarking.rs index e72a9baf044fefdef9610ef02dac3f054ff965e4..ce5c35524c747af4fa9face89a2d79be3c90e301 100644 --- a/substrate/frame/staking/src/benchmarking.rs +++ b/substrate/frame/staking/src/benchmarking.rs @@ -24,9 +24,8 @@ use testing_utils::*; use codec::Decode; use frame_election_provider_support::{bounds::DataProviderBounds, SortedListProvider}; use frame_support::{ - dispatch::UnfilteredDispatchable, pallet_prelude::*, - traits::{Currency, Get, Imbalance}, + traits::{Currency, Get, Imbalance, UnfilteredDispatchable}, }; use sp_runtime::{ traits::{Bounded, One, StaticLookup, TrailingZeroInput, Zero}, diff --git a/substrate/frame/staking/src/migrations.rs b/substrate/frame/staking/src/migrations.rs index 332da506f01ed6ebb2bfcf9b449cd243b83ceba6..89520028b901c07599817d371db875fb258f536a 100644 --- a/substrate/frame/staking/src/migrations.rs +++ b/substrate/frame/staking/src/migrations.rs @@ -19,8 +19,9 @@ use super::*; use frame_election_provider_support::SortedListProvider; use frame_support::{ - dispatch::GetStorageVersion, pallet_prelude::ValueQuery, storage_alias, - traits::OnRuntimeUpgrade, + pallet_prelude::ValueQuery, + storage_alias, + traits::{GetStorageVersion, OnRuntimeUpgrade}, }; #[cfg(feature = "try-runtime")] diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 40a2f5cf73eb186d2e188cb36c7583184457a284..c6c75326b80cdef42afa9d35dd844b2f91e3b50d 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -17,11 +17,11 @@ //! Staking FRAME Pallet. +use codec::Codec; use frame_election_provider_support::{ ElectionProvider, ElectionProviderBase, SortedListProvider, VoteWeight, }; use frame_support::{ - dispatch::Codec, pallet_prelude::*, traits::{ Currency, Defensive, DefensiveResult, DefensiveSaturating, EnsureOrigin, diff --git a/substrate/frame/state-trie-migration/Cargo.toml b/substrate/frame/state-trie-migration/Cargo.toml index 8ba57fc8f71ef050ca79116940a04b7710faf933..83218a131361894b955ce1c79085c93c5626c92d 100644 --- a/substrate/frame/state-trie-migration/Cargo.toml +++ b/substrate/frame/state-trie-migration/Cargo.toml @@ -15,9 +15,9 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } thousands = { version = "0.2.0", optional = true } -zstd = { version = "0.12.3", default-features = false, optional = true } +zstd = { version = "0.12.4", default-features = false, optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/state-trie-migration/src/lib.rs b/substrate/frame/state-trie-migration/src/lib.rs index e22a47458b7d510b33baadb1894eab44ad1d8591..3e69b219bb527781ce555d48eea692cbe69f159c 100644 --- a/substrate/frame/state-trie-migration/src/lib.rs +++ b/substrate/frame/state-trie-migration/src/lib.rs @@ -1268,7 +1268,6 @@ mod mock { #[cfg(test)] mod test { use super::{mock::*, *}; - use frame_support::dispatch::*; use sp_runtime::{bounded_vec, traits::Bounded, StateVersion}; #[test] diff --git a/substrate/frame/support/Cargo.toml b/substrate/frame/support/Cargo.toml index fa85181b31e7d1833dae9bb1f7650f6f23999e69..864e3bd9ad3077142692aac6d22f3ec063d49825 100644 --- a/substrate/frame/support/Cargo.toml +++ b/substrate/frame/support/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.163", default-features = false, features = ["alloc", "derive"] } +serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } frame-metadata = { version = "16.0.0", default-features = false, features = ["current"] } diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs index cbf2ea9078535d87db6a92dba83870e4851b5160..859b9a327e48dc7ee8cdce9c7ff3caa8c7621457 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs @@ -124,16 +124,16 @@ pub fn expand_outer_dispatch( } } - impl #scrate::dispatch::GetCallMetadata for RuntimeCall { - fn get_call_metadata(&self) -> #scrate::dispatch::CallMetadata { - use #scrate::dispatch::GetCallName; + impl #scrate::traits::GetCallMetadata for RuntimeCall { + fn get_call_metadata(&self) -> #scrate::traits::CallMetadata { + use #scrate::traits::GetCallName; match self { #( #pallet_attrs #variant_patterns => { let function_name = call.get_call_name(); let pallet_name = stringify!(#pallet_names); - #scrate::dispatch::CallMetadata { function_name, pallet_name } + #scrate::traits::CallMetadata { function_name, pallet_name } } )* } @@ -147,7 +147,7 @@ pub fn expand_outer_dispatch( } fn get_call_names(module: &str) -> &'static [&'static str] { - use #scrate::dispatch::{Callable, GetCallName}; + use #scrate::{dispatch::Callable, traits::GetCallName}; match module { #( #pallet_attrs @@ -159,7 +159,7 @@ pub fn expand_outer_dispatch( } } } - impl #scrate::dispatch::Dispatchable for RuntimeCall { + impl #scrate::__private::Dispatchable for RuntimeCall { type RuntimeOrigin = RuntimeOrigin; type Config = RuntimeCall; type Info = #scrate::dispatch::DispatchInfo; diff --git a/substrate/frame/support/procedural/src/dummy_part_checker.rs b/substrate/frame/support/procedural/src/dummy_part_checker.rs index 792b17a8f775855eb4f277f76b10bbdd16c44e21..34d9a3e236b46bedf466039874922a8f8bc7dedf 100644 --- a/substrate/frame/support/procedural/src/dummy_part_checker.rs +++ b/substrate/frame/support/procedural/src/dummy_part_checker.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::COUNTER; use proc_macro::TokenStream; diff --git a/substrate/frame/support/procedural/src/pallet/expand/call.rs b/substrate/frame/support/procedural/src/pallet/expand/call.rs index 6489949ed5c33499038cbbe9c78138e2c109408f..3ed5509863e91f940145bf41e2407da08a4e471a 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/call.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/call.rs @@ -351,7 +351,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { } } - impl<#type_impl_gen> #frame_support::dispatch::GetCallName for #call_ident<#type_use_gen> + impl<#type_impl_gen> #frame_support::traits::GetCallName for #call_ident<#type_use_gen> #where_clause { fn get_call_name(&self) -> &'static str { @@ -366,7 +366,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { } } - impl<#type_impl_gen> #frame_support::dispatch::GetCallIndex for #call_ident<#type_use_gen> + impl<#type_impl_gen> #frame_support::traits::GetCallIndex for #call_ident<#type_use_gen> #where_clause { fn get_call_index(&self) -> u8 { diff --git a/substrate/frame/support/procedural/src/pallet/expand/doc_only.rs b/substrate/frame/support/procedural/src/pallet/expand/doc_only.rs index 50afeb3ca88cfcb0d9ee6400b5fc2de606f01b0e..621a051acae1aab556791e55abe55c899494175e 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/doc_only.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/doc_only.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/procedural/src/pallet/expand/storage.rs b/substrate/frame/support/procedural/src/pallet/expand/storage.rs index 1a941f6cb3f5ca135081935c6b6bc21bc24bb289..c01f0f3926a699561cb22ff3ff731a7688871c04 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/storage.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/storage.rs @@ -22,7 +22,6 @@ use crate::{ Def, }, }; -use itertools::Itertools; use quote::ToTokens; use std::{collections::HashMap, ops::IndexMut}; use syn::spanned::Spanned; @@ -443,11 +442,14 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { let cfg_attrs = &storage.cfg_attrs; - // If the storage item is public, just link to it rather than copy-pasting the docs. + // If the storage item is public, link it and otherwise just mention it. + // + // We can not just copy the docs from a non-public type as it may links to internal + // types which makes the compiler very unhappy :( let getter_doc_line = if matches!(storage.vis, syn::Visibility::Public(_)) { format!("An auto-generated getter for [`{}`].", storage.ident) } else { - storage.docs.iter().map(|d| d.into_token_stream().to_string()).join("\n") + format!("An auto-generated getter for `{}`.", storage.ident) }; match &storage.metadata { diff --git a/substrate/frame/support/src/dispatch.rs b/substrate/frame/support/src/dispatch.rs index 0388a9adb394895b5fbc88c3041bb4893eb11be0..eb1fc524200b7129a7d8f749c639e8710834b345 100644 --- a/substrate/frame/support/src/dispatch.rs +++ b/substrate/frame/support/src/dispatch.rs @@ -18,30 +18,18 @@ //! Dispatch system. Contains a macro for defining runtime modules and //! generating values representing lazy module function calls. -pub use crate::traits::{ - CallMetadata, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion, - UnfilteredDispatchable, -}; -pub use codec::{ - Codec, Decode, Encode, EncodeAsRef, EncodeLike, HasCompact, Input, MaxEncodedLen, Output, -}; -pub use scale_info::TypeInfo; -pub use sp_runtime::{ - traits::Dispatchable, transaction_validity::TransactionPriority, DispatchError, RuntimeDebug, -}; -pub use sp_std::{ - fmt, marker, - prelude::{Clone, Eq, PartialEq, Vec}, - result, -}; -pub use sp_weights::Weight; - +use crate::traits::UnfilteredDispatchable; +use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen}; +use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_runtime::{ generic::{CheckedExtrinsic, UncheckedExtrinsic}, traits::SignedExtension, + DispatchError, RuntimeDebug, }; +use sp_std::fmt; +use sp_weights::Weight; /// The return type of a `Dispatchable` in frame. When returned explicitly from /// a dispatchable function it allows overriding the default `PostDispatchInfo` diff --git a/substrate/frame/support/src/dispatch_context.rs b/substrate/frame/support/src/dispatch_context.rs index 31278ea9f81946baf3d57e75c50e79c5ca25d2ea..608187b72206399913e337a5fa9f5c1e42277978 100644 --- a/substrate/frame/support/src/dispatch_context.rs +++ b/substrate/frame/support/src/dispatch_context.rs @@ -26,11 +26,11 @@ //! //! # FRAME integration //! -//! The FRAME macros implement [`UnfilteredDispatchable`](crate::traits::UnfilteredDispatchable) for -//! each pallet `Call` enum. Part of this implementation is the call to [`run_in_context`], so that -//! each call to +//! The FRAME macros implement +//! [`UnfilteredDispatchable`](frame_support::traits::UnfilteredDispatchable) for each pallet `Call` +//! enum. Part of this implementation is the call to [`run_in_context`], so that each call to //! [`UnfilteredDispatchable::dispatch_bypass_filter`](crate::traits::UnfilteredDispatchable::dispatch_bypass_filter) -//! or [`Dispatchable::dispatch`](crate::dispatch::Dispatchable::dispatch) will run in a dispatch +//! or [`Dispatchable::dispatch`](sp_runtime::traits::Dispatchable::dispatch) will run in a dispatch //! context. //! //! # Example diff --git a/substrate/frame/support/src/genesis_builder_helper.rs b/substrate/frame/support/src/genesis_builder_helper.rs index d4144a4d9fd19090cc35e50d7b216090e3908299..b2594d183ec5bdaa7ea2cae736ca57baada15459 100644 --- a/substrate/frame/support/src/genesis_builder_helper.rs +++ b/substrate/frame/support/src/genesis_builder_helper.rs @@ -25,7 +25,10 @@ use sp_runtime::format_runtime_string; /// Get the default `GenesisConfig` as a JSON blob. For more info refer to /// [`sp_genesis_builder::GenesisBuilder::create_default_config`] -pub fn create_default_config() -> sp_std::vec::Vec { +pub fn create_default_config() -> sp_std::vec::Vec +where + GC: BuildGenesisConfig + Default, +{ serde_json::to_string(&GC::default()) .expect("serialization to json is expected to work. qed.") .into_bytes() diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index a2a7e5ebc485fd01218d33ede91a9b7aa2d7150d..a7106780e0215069af1d6191e5d3ad79fef7170d 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -49,7 +49,7 @@ pub mod __private { pub use sp_metadata_ir as metadata_ir; #[cfg(feature = "std")] pub use sp_runtime::{bounded_btree_map, bounded_vec}; - pub use sp_runtime::{RuntimeDebug, StateVersion}; + pub use sp_runtime::{traits::Dispatchable, RuntimeDebug, StateVersion}; #[cfg(feature = "std")] pub use sp_state_machine::BasicExternalities; pub use sp_std; @@ -806,10 +806,7 @@ pub mod testing_prelude { /// Prelude to be used alongside pallet macro, for ease of use. pub mod pallet_prelude { pub use crate::{ - dispatch::{ - DispatchClass, DispatchError, DispatchResult, DispatchResultWithPostInfo, Parameter, - Pays, - }, + dispatch::{DispatchClass, DispatchResult, DispatchResultWithPostInfo, Parameter, Pays}, ensure, inherent::{InherentData, InherentIdentifier, ProvideInherent}, storage, @@ -855,7 +852,7 @@ pub mod pallet_prelude { TransactionTag, TransactionValidity, TransactionValidityError, UnknownTransaction, ValidTransaction, }, - RuntimeDebug, MAX_MODULE_ERROR_ENCODED_SIZE, + DispatchError, RuntimeDebug, MAX_MODULE_ERROR_ENCODED_SIZE, }; pub use sp_std::marker::PhantomData; pub use sp_weights::Weight; @@ -1266,8 +1263,9 @@ pub mod pallet_prelude { /// Field types in enum variants must also implement [`PalletError`](traits::PalletError), /// otherwise the pallet will fail to compile. Rust primitive types have already implemented /// the [`PalletError`](traits::PalletError) trait along with some commonly used stdlib types -/// such as [`Option`] and [`PhantomData`](`frame_support::dispatch::marker::PhantomData`), and -/// hence in most use cases, a manual implementation is not necessary and is discouraged. +/// such as [`Option`] and +/// [`PhantomData`](`frame_support::__private::sp_std::marker::PhantomData`), and hence in most +/// use cases, a manual implementation is not necessary and is discouraged. /// /// The generic `T` must not bound anything and a `where` clause is not allowed. That said, /// bounds and/or a where clause should not needed for any use-case. diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index 19eec194a76ad4a2fa4a255d37aaa07882b1c013..6fc1834f01adf61198366d7c01f1eb71332965dc 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -28,9 +28,9 @@ use sp_std::marker::PhantomData; /// /// Make it easier to write versioned runtime upgrades. /// -/// [`VersionedRuntimeUpgrade`] allows developers to write migrations without worrying about -/// checking and setting storage versions. Instead, the developer wraps their migration in this -/// struct which takes care of version handling using best practices. +/// [`VersionedMigration`] allows developers to write migrations without worrying about checking and +/// setting storage versions. Instead, the developer wraps their migration in this struct which +/// takes care of version handling using best practices. /// /// It takes 5 type parameters: /// - `From`: The version being upgraded from. @@ -39,11 +39,11 @@ use sp_std::marker::PhantomData; /// - `Pallet`: The Pallet being upgraded. /// - `Weight`: The runtime's RuntimeDbWeight implementation. /// -/// When a [`VersionedRuntimeUpgrade`] `on_runtime_upgrade`, `pre_upgrade`, or `post_upgrade` -/// method is called, the on-chain version of the pallet is compared to `From`. If they match, the -/// `Inner` equivalent is called and the pallets on-chain version is set to `To` after the -/// migration. Otherwise, a warning is logged notifying the developer that the upgrade was a noop -/// and should probably be removed. +/// When a [`VersionedMigration`] `on_runtime_upgrade`, `pre_upgrade`, or `post_upgrade` method is +/// called, the on-chain version of the pallet is compared to `From`. If they match, the `Inner` +/// equivalent is called and the pallets on-chain version is set to `To` after the migration. +/// Otherwise, a warning is logged notifying the developer that the upgrade was a noop and should +/// probably be removed. /// /// ### Examples /// ```ignore @@ -54,7 +54,7 @@ use sp_std::marker::PhantomData; /// } /// /// pub type VersionCheckedMigrateV5ToV6 = -/// VersionedRuntimeUpgrade< +/// VersionedMigration< /// 5, /// 6, /// VersionUncheckedMigrateV5ToV6, @@ -70,7 +70,7 @@ use sp_std::marker::PhantomData; /// ); /// ``` #[cfg(feature = "experimental")] -pub struct VersionedRuntimeUpgrade { +pub struct VersionedMigration { _marker: PhantomData<(Inner, Pallet, Weight)>, } @@ -85,7 +85,7 @@ pub enum VersionedPostUpgradeData { Noop, } -/// Implementation of the `OnRuntimeUpgrade` trait for `VersionedRuntimeUpgrade`. +/// Implementation of the `OnRuntimeUpgrade` trait for `VersionedMigration`. /// /// Its main function is to perform the runtime upgrade in `on_runtime_upgrade` only if the on-chain /// version of the pallets storage matches `From`, and after the upgrade set the on-chain storage to @@ -98,7 +98,7 @@ impl< Inner: crate::traits::OnRuntimeUpgrade, Pallet: GetStorageVersion + PalletInfoAccess, DbWeight: Get, - > crate::traits::OnRuntimeUpgrade for VersionedRuntimeUpgrade + > crate::traits::OnRuntimeUpgrade for VersionedMigration { /// Executes pre_upgrade if the migration will run, and wraps the pre_upgrade bytes in /// [`VersionedPostUpgradeData`] before passing them to post_upgrade, so it knows whether the @@ -158,7 +158,7 @@ impl< ) -> Result<(), sp_runtime::TryRuntimeError> { use codec::DecodeAll; match ::decode_all(&mut &versioned_post_upgrade_data_bytes[..]) - .map_err(|_| "VersionedRuntimeUpgrade post_upgrade failed to decode PreUpgradeData")? + .map_err(|_| "VersionedMigration post_upgrade failed to decode PreUpgradeData")? { VersionedPostUpgradeData::MigrationExecuted(inner_bytes) => Inner::post_upgrade(inner_bytes), diff --git a/substrate/frame/support/src/storage/types/counted_nmap.rs b/substrate/frame/support/src/storage/types/counted_nmap.rs index 7dbcb74f000537b0f2a6c067d7594f529763a554..54f8e57cf242d5fa1984817878a2c76837ade542 100644 --- a/substrate/frame/support/src/storage/types/counted_nmap.rs +++ b/substrate/frame/support/src/storage/types/counted_nmap.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/hooks.rs b/substrate/frame/support/src/traits/hooks.rs index 6163c048e75d854e601aaad3e50cd89e03b38d90..6acecb8928d8fa76ab122b299d27f5e626c0e6f3 100644 --- a/substrate/frame/support/src/traits/hooks.rs +++ b/substrate/frame/support/src/traits/hooks.rs @@ -359,7 +359,7 @@ pub trait Hooks { /// done. This is helpful to prevent accidental repetitive execution of this hook, which can be /// catastrophic. /// - /// Alternatively, `migrations::VersionedRuntimeUpgrade` can be used to assist with + /// Alternatively, [`frame_support::migrations::VersionedMigration`] can be used to assist with /// this. /// /// ## Implementation Note: Runtime Level Migration @@ -442,7 +442,7 @@ pub trait Hooks { /// A trait to define the build function of a genesis config for both runtime and pallets. /// /// Replaces deprecated [`GenesisBuild`]. -pub trait BuildGenesisConfig: Default + sp_runtime::traits::MaybeSerializeDeserialize { +pub trait BuildGenesisConfig: sp_runtime::traits::MaybeSerializeDeserialize { /// The build function puts initial `GenesisConfig` keys/values pairs into the storage. fn build(&self); } @@ -452,7 +452,7 @@ pub trait BuildGenesisConfig: Default + sp_runtime::traits::MaybeSerializeDeseri #[deprecated( note = "GenesisBuild is planned to be removed in December 2023. Use BuildGenesisConfig instead of it." )] -pub trait GenesisBuild: Default + sp_runtime::traits::MaybeSerializeDeserialize { +pub trait GenesisBuild: sp_runtime::traits::MaybeSerializeDeserialize { /// The build function is called within an externalities allowing storage APIs. /// Thus one can write to storage using regular pallet storages. fn build(&self); diff --git a/substrate/frame/support/src/traits/tokens/currency.rs b/substrate/frame/support/src/traits/tokens/currency.rs index e6a7284a74b7ff50c4b88fa4c5d6737694bffc67..0030e1261dac1be87f572b1ee26220b2992798cd 100644 --- a/substrate/frame/support/src/traits/tokens/currency.rs +++ b/substrate/frame/support/src/traits/tokens/currency.rs @@ -21,11 +21,8 @@ use super::{ imbalance::{Imbalance, SignedImbalance}, misc::{Balance, ExistenceRequirement, WithdrawReasons}, }; -use crate::{ - dispatch::{DispatchError, DispatchResult}, - traits::Get, -}; -use sp_runtime::traits::MaybeSerializeDeserialize; +use crate::{dispatch::DispatchResult, traits::Get}; +use sp_runtime::{traits::MaybeSerializeDeserialize, DispatchError}; mod reservable; pub use reservable::{NamedReservableCurrency, ReservableCurrency}; diff --git a/substrate/frame/support/src/traits/tokens/currency/reservable.rs b/substrate/frame/support/src/traits/tokens/currency/reservable.rs index 79129cecdd6969d56ca9cab0e7fa752469a5c4e1..ff8b0c6eea838e8ec3cd5869190bf741ca140d65 100644 --- a/substrate/frame/support/src/traits/tokens/currency/reservable.rs +++ b/substrate/frame/support/src/traits/tokens/currency/reservable.rs @@ -22,9 +22,10 @@ use sp_core::Get; use super::{super::misc::BalanceStatus, Currency}; use crate::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, traits::{ExistenceRequirement, SignedImbalance, WithdrawReasons}, }; +use sp_runtime::DispatchError; /// A currency where funds can be reserved from the user. pub trait ReservableCurrency: Currency { diff --git a/substrate/frame/support/src/traits/tokens/fungible/conformance_tests/mod.rs b/substrate/frame/support/src/traits/tokens/fungible/conformance_tests/mod.rs index 88ba56a6fed0200c7b1616f0422f8a42de12610e..56166436003f3ad24e342166d67f38ff3ebe6edd 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/conformance_tests/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/conformance_tests/mod.rs @@ -1 +1,18 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod inspect_mutate; diff --git a/substrate/frame/support/src/traits/tokens/fungible/freeze.rs b/substrate/frame/support/src/traits/tokens/fungible/freeze.rs index 1ec3a5fadf555cdc06d76c675a6fe770238cfba7..bc8f22b959cb99166300a9f09d7fe1a43185e89b 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/freeze.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/freeze.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungible/hold.rs b/substrate/frame/support/src/traits/tokens/fungible/hold.rs index aa15e9df63a48f886883554687d13150c4c4a78d..15c046fbe9a2e99364b990dacc1f6fd8942457cf 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/hold.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/hold.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungible/item_of.rs b/substrate/frame/support/src/traits/tokens/fungible/item_of.rs index cf2d96ef28791aa1eef17f621045311c2e61a8af..88b9de7fdbf6461e3c89029a4d6d20734d95f9e9 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/item_of.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/item_of.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungible/mod.rs b/substrate/frame/support/src/traits/tokens/fungible/mod.rs index 8ab63ad366f08318ebbd996d18d897f4a4e9e200..2205fd5dc589b0f0d85cb9542bc8f79af1a954d1 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungible/regular.rs b/substrate/frame/support/src/traits/tokens/fungible/regular.rs index 2838bed540aa261e1c4b5c7a985f4b294e20dd81..fe2a1f2a14a6604bee2aaa85f80a3349d3b80043 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/regular.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/regular.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,6 @@ //! `Inspect` and `Mutate` traits for working with regular balances. use crate::{ - dispatch::DispatchError, ensure, traits::{ tokens::{ @@ -36,7 +35,7 @@ use crate::{ }, }; use sp_arithmetic::traits::{CheckedAdd, CheckedSub, One}; -use sp_runtime::{traits::Saturating, ArithmeticError, TokenError}; +use sp_runtime::{traits::Saturating, ArithmeticError, DispatchError, TokenError}; use sp_std::marker::PhantomData; use super::{Credit, Debt, HandleImbalanceDrop, Imbalance}; diff --git a/substrate/frame/support/src/traits/tokens/fungibles/freeze.rs b/substrate/frame/support/src/traits/tokens/fungibles/freeze.rs index 08549c2d4b74410737984e4ce5bf9e935a06f8a7..88f083b0a210a7b82f1999329b10143c41c7c598 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/freeze.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/freeze.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungibles/hold.rs b/substrate/frame/support/src/traits/tokens/fungibles/hold.rs index c751a836d1f4335e406ea584f5f74c85798aef68..4f86704df1685227c865b4c7cd1792ef8ca9cb99 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/hold.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/hold.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungibles/lifetime.rs b/substrate/frame/support/src/traits/tokens/fungibles/lifetime.rs index 9e2c306f6f38acae211004a5b9baa63ed34b6a4d..0e195a52318b7ddb34aef57e3d8742cd36952e06 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/lifetime.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/lifetime.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungibles/mod.rs b/substrate/frame/support/src/traits/tokens/fungibles/mod.rs index 697eff39ff7489c964328a23317871f01a137c83..4fd6ef43a15fafe91730fd1c5e01b2ca14bfd817 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/mod.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/support/src/traits/tokens/fungibles/regular.rs b/substrate/frame/support/src/traits/tokens/fungibles/regular.rs index b6cea15284d396e3f3432581671f75124eb92b8a..7c39acdf42416d47cb27b880477e52136a97a2e6 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/regular.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/regular.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,6 @@ use sp_std::marker::PhantomData; use crate::{ - dispatch::DispatchError, ensure, traits::{ tokens::{ @@ -38,7 +37,7 @@ use crate::{ }, }; use sp_arithmetic::traits::{CheckedAdd, CheckedSub, One}; -use sp_runtime::{traits::Saturating, ArithmeticError, TokenError}; +use sp_runtime::{traits::Saturating, ArithmeticError, DispatchError, TokenError}; use super::{Credit, Debt, HandleImbalanceDrop, Imbalance}; diff --git a/substrate/frame/support/src/traits/tokens/nonfungibles.rs b/substrate/frame/support/src/traits/tokens/nonfungibles.rs index e9538d14f5471aa2877fbfdf6cd2a43442180383..615e79c29c85f4ccef502e2e50a0ecfd56a3c909 100644 --- a/substrate/frame/support/src/traits/tokens/nonfungibles.rs +++ b/substrate/frame/support/src/traits/tokens/nonfungibles.rs @@ -27,9 +27,9 @@ //! Implementations of these traits may be converted to implementations of corresponding //! `nonfungible` traits by using the `nonfungible::ItemOf` type adapter. -use crate::dispatch::{DispatchError, DispatchResult}; +use crate::dispatch::DispatchResult; use codec::{Decode, Encode}; -use sp_runtime::TokenError; +use sp_runtime::{DispatchError, TokenError}; use sp_std::prelude::*; /// Trait for providing an interface to many read-only NFT-like sets of items. diff --git a/substrate/frame/support/src/traits/tokens/nonfungibles_v2.rs b/substrate/frame/support/src/traits/tokens/nonfungibles_v2.rs index 345cce237b67b1955b14d2090f5a6ce07039f86c..ec064bdebf62ac2a356787f8fc302f275448116b 100644 --- a/substrate/frame/support/src/traits/tokens/nonfungibles_v2.rs +++ b/substrate/frame/support/src/traits/tokens/nonfungibles_v2.rs @@ -27,9 +27,9 @@ //! Implementations of these traits may be converted to implementations of corresponding //! `nonfungible` traits by using the `nonfungible::ItemOf` type adapter. -use crate::dispatch::{DispatchError, DispatchResult, Parameter}; +use crate::dispatch::{DispatchResult, Parameter}; use codec::{Decode, Encode}; -use sp_runtime::TokenError; +use sp_runtime::{DispatchError, TokenError}; use sp_std::prelude::*; /// Trait for providing an interface to many read-only NFT-like sets of items. diff --git a/substrate/frame/support/src/traits/voting.rs b/substrate/frame/support/src/traits/voting.rs index 4201b8d48d157634b5cd7793dee94abd6d9483aa..f5c9e285ef3a6fb49cb7eadeffea4d44d7a813f3 100644 --- a/substrate/frame/support/src/traits/voting.rs +++ b/substrate/frame/support/src/traits/voting.rs @@ -18,10 +18,10 @@ //! Traits and associated data structures concerned with voting, and moving between tokens and //! votes. -use crate::dispatch::{DispatchError, Parameter}; +use crate::dispatch::Parameter; use codec::{HasCompact, MaxEncodedLen}; use sp_arithmetic::Perbill; -use sp_runtime::traits::Member; +use sp_runtime::{traits::Member, DispatchError}; use sp_std::prelude::*; pub trait VoteTally { diff --git a/substrate/frame/support/test/Cargo.toml b/substrate/frame/support/test/Cargo.toml index 1519d3f5cc3ef0791ea1416b1ca4d625bf1c8b11..8b8912799142e02fe914f7320de32c7cea8a21e9 100644 --- a/substrate/frame/support/test/Cargo.toml +++ b/substrate/frame/support/test/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] static_assertions = "1.1.0" -serde = { version = "1.0.163", default-features = false, features = ["derive"] } +serde = { version = "1.0.188", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } frame-metadata = { version = "16.0.0", default-features = false, features = ["current"] } diff --git a/substrate/frame/support/test/pallet/Cargo.toml b/substrate/frame/support/test/pallet/Cargo.toml index 8aae80362d39a9e0c60d4b68abbe87b34b8e8bde..8db2e9ba7c4975d5e0e5b1d24a3357b35653ef09 100644 --- a/substrate/frame/support/test/pallet/Cargo.toml +++ b/substrate/frame/support/test/pallet/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive"] } +serde = { version = "1.0.188", default-features = false, features = ["derive"] } frame-support = { path = "../..", default-features = false} frame-system = { path = "../../../system", default-features = false} sp-runtime = { path = "../../../../primitives/runtime", default-features = false} diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.rs index 657e481a9430a51fdc04a01abfaad3306f4502df..17a3aa4a9eee42b39805474e10913dc19fb49c44 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.stderr index 4e2d63a6b5030f7a42a922ac95e1ee43d2032d11..c7deb67112117c0374dad30a401dc098ae24724b 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name.stderr @@ -1,5 +1,5 @@ error: Benchmark parameter names must consist of a single lowercase letter (a-z) and no other characters. - --> tests/benchmark_ui/bad_param_name.rs:10:11 + --> tests/benchmark_ui/bad_param_name.rs:27:11 | -10 | fn bench(winton: Linear<1, 2>) { +27 | fn bench(winton: Linear<1, 2>) { | ^^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.rs index f970126d12e7e6a0e2f984173309fa54a894ca19..9c3aff9ff05f097566b586d3382a96626dd9c267 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.stderr index 32f6bf8e47d09f7e8ce9d79e50f38eaa0498c7e0..bed3bc9c4b1e8b6fdfb032ffa1e7a87f718c73e8 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_too_long.stderr @@ -1,5 +1,5 @@ error: Benchmark parameter names must consist of a single lowercase letter (a-z) and no other characters. - --> tests/benchmark_ui/bad_param_name_too_long.rs:8:11 - | -8 | fn bench(xx: Linear<1, 2>) { - | ^^ + --> tests/benchmark_ui/bad_param_name_too_long.rs:25:11 + | +25 | fn bench(xx: Linear<1, 2>) { + | ^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.rs index 9970f3230167244f9bbba2f705e7243f3a784a9e..dad9ee9fd1246598d990634e2bd1f13e752eb8c0 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.stderr index 48dd41d3262d75642d991e36c032ef2bdea2eb3d..43fd9d9804e0ba542c6fdbcad1571fc67e1f4bee 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_param_name_upper_case.stderr @@ -1,5 +1,5 @@ error: Benchmark parameter names must consist of a single lowercase letter (a-z) and no other characters. - --> tests/benchmark_ui/bad_param_name_upper_case.rs:8:11 - | -8 | fn bench(D: Linear<1, 2>) { - | ^ + --> tests/benchmark_ui/bad_param_name_upper_case.rs:25:11 + | +25 | fn bench(D: Linear<1, 2>) { + | ^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_params.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_params.rs index 5049f2eae2c2edfe92777c5274a9bf551355f268..e92e3d2f25335c691ab618d88bcf57860f4788fb 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_params.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_params.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_params.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_params.stderr index 068eaedd531b9db0e867e57fa6fe462be5c23843..16aabbff15335759e49e5d37e20b391c5b534d5f 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_params.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_params.stderr @@ -1,5 +1,5 @@ error: Invalid benchmark function param. A valid example would be `x: Linear<5, 10>`. - --> tests/benchmark_ui/bad_params.rs:10:31 + --> tests/benchmark_ui/bad_params.rs:27:31 | -10 | fn bench(y: Linear<1, 2>, x: u32) { +27 | fn bench(y: Linear<1, 2>, x: u32) { | ^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.rs index 5e332801df8307ee1a9c3c23e21a02edf37a15bf..4e70aef50ee96c0197b51f9d81c203f98ffb9468 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.stderr index ab0bff54a8a0333bd0e80d9aedb16e2c771b3a4f..f80fe997a00668e88f7ca5786ac001de597d7156 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_benchmark_err.stderr @@ -1,5 +1,5 @@ error: expected `BenchmarkError` - --> tests/benchmark_ui/bad_return_non_benchmark_err.rs:10:27 + --> tests/benchmark_ui/bad_return_non_benchmark_err.rs:27:27 | -10 | fn bench() -> Result<(), BenchmarkException> { +27 | fn bench() -> Result<(), BenchmarkException> { | ^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.rs index a4b0d007eeecb218daf7cbbceabca52c2afbdf83..f424fb1f9266c66c092ea0a13ecaef55abc83b3d 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.stderr index 69d61b4229155e7092ef072d6fe4e8010de50df6..405fb473090f0cba2013cc748a40e5d7e8630abe 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_type_path.stderr @@ -1,5 +1,5 @@ error: Only `Result<(), BenchmarkError>` or a blank return type is allowed on benchmark function definitions - --> tests/benchmark_ui/bad_return_non_type_path.rs:10:16 + --> tests/benchmark_ui/bad_return_non_type_path.rs:27:16 | -10 | fn bench() -> (String, u32) { +27 | fn bench() -> (String, u32) { | ^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.rs index 15289c298aec1558419a6ba9b41b8f36e9905eb9..e204e66c1294c1822b28b8f97ae500d4fb6829b6 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.stderr index 4181ea099a14ffdfa4814a1d1b05d7d74a659c82..cae0a7a0584bafda47e832de790a72eac22e19a0 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_non_unit_t.stderr @@ -1,5 +1,5 @@ error: expected `()` - --> tests/benchmark_ui/bad_return_non_unit_t.rs:8:23 - | -8 | fn bench() -> Result { - | ^^^ + --> tests/benchmark_ui/bad_return_non_unit_t.rs:25:23 + | +25 | fn bench() -> Result { + | ^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.rs index a6a2c61127fa2c03d11268db9659ec8a659c4bd0..dd3ea73951ea0f07b4f0893a17f83708dbcb8b9e 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.stderr index 601bbd20fb73d404350205926c3d5f5f14b0e95e..7e0a02be649b4755edac171619b4808b739844a4 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_blank_with_question.stderr @@ -1,10 +1,10 @@ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> tests/benchmark_ui/bad_return_type_blank_with_question.rs:15:14 + --> tests/benchmark_ui/bad_return_type_blank_with_question.rs:32:14 | -5 | #[benchmarks] +22 | #[benchmarks] | ------------- this function should return `Result` or `Option` to accept `?` ... -15 | something()?; +32 | something()?; | ^ cannot use the `?` operator in a function that returns `()` | = help: the trait `FromResidual>` is not implemented for `()` diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.rs index 76f1299005309832dd834327ccdd60b26e6d85a9..cf4605406fa66e9cbaa8b4525aac6ae933c41e88 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.stderr index ff501a620fe33fad0b67eac73d16396cfc9f6107..9ec5a17118e94c79de9df997e7bb107a9a3a26bd 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_no_last_stmt.stderr @@ -1,9 +1,9 @@ error: Benchmark `#[block]` or `#[extrinsic_call]` item cannot be the last statement of your benchmark function definition if you have defined a return type. You should return something compatible with Result<(), BenchmarkError> (i.e. `Ok(())`) as the last statement or change your signature to a blank return type. - --> tests/benchmark_ui/bad_return_type_no_last_stmt.rs:10:43 + --> tests/benchmark_ui/bad_return_type_no_last_stmt.rs:27:43 | -10 | fn bench() -> Result<(), BenchmarkError> { +27 | fn bench() -> Result<(), BenchmarkError> { | ______________________________________________^ -11 | | #[block] -12 | | {} -13 | | } +28 | | #[block] +29 | | {} +30 | | } | |_____^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.rs index c206ec36a151e24f4a91d62680e6436a01e8c032..5a434aac55ce6bac3cc7b73287f0c9a9aeb264d2 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.stderr index b830b8eb59c636fe5a517271b9bd4919cc47bd8f..ff813df375db0e38af06550f65ecf5d631f8b5f2 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_non_result.stderr @@ -1,5 +1,5 @@ error: expected `Result` - --> tests/benchmark_ui/bad_return_type_non_result.rs:10:31 + --> tests/benchmark_ui/bad_return_type_non_result.rs:27:31 | -10 | fn bench(y: Linear<1, 2>) -> String { +27 | fn bench(y: Linear<1, 2>) -> String { | ^^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.rs b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.rs index 4b55885939747113ae1c715779c881148d142ce5..1a831e6e679bcbc1301b00b202114477d7b953a5 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.stderr b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.stderr index 050da1676735a55c849650b84ed821f216d50ac3..6b2f73bd666d2096c811f482c04eb5a117b0b884 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/bad_return_type_option.stderr @@ -1,5 +1,5 @@ error: expected `Result` - --> tests/benchmark_ui/bad_return_type_option.rs:10:16 + --> tests/benchmark_ui/bad_return_type_option.rs:27:16 | -10 | fn bench() -> Option { +27 | fn bench() -> Option { | ^^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/dup_block.rs b/substrate/frame/support/test/tests/benchmark_ui/dup_block.rs index 2c2ef9db9a45c327d2f0aeedaf1bad42bc2b43a3..cba310adb26be511e3c2da9b7727c75106832118 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/dup_block.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/dup_block.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/dup_block.stderr b/substrate/frame/support/test/tests/benchmark_ui/dup_block.stderr index 3d73c3d6609b15fafa543328a5a6e31f2d59fd26..f17cec0fbdfeae9551fa0f8a92f018cfee6f0ecc 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/dup_block.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/dup_block.stderr @@ -1,5 +1,5 @@ error: Only one #[extrinsic_call] or #[block] attribute is allowed per benchmark. - --> tests/benchmark_ui/dup_block.rs:14:3 + --> tests/benchmark_ui/dup_block.rs:31:3 | -14 | #[block] +31 | #[block] | ^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.rs b/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.rs index 4d135d1a04f527841b4dcd8793a15fd602f37c3b..e82f6ec3d90d974161532f5b54962e52eaeb9b6a 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.stderr b/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.stderr index 593f7072bfa512f958e8106ec8f6a55fe60c1c5c..6512c7535906cfd49d1cb85eb505df355eaecf29 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/dup_extrinsic_call.stderr @@ -1,5 +1,5 @@ error: Only one #[extrinsic_call] or #[block] attribute is allowed per benchmark. - --> tests/benchmark_ui/dup_extrinsic_call.rs:14:3 + --> tests/benchmark_ui/dup_extrinsic_call.rs:31:3 | -14 | #[extrinsic_call] +31 | #[extrinsic_call] | ^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/empty_function.rs b/substrate/frame/support/test/tests/benchmark_ui/empty_function.rs index bc04101dd384a04409b7d2ab26a413d05435afd4..7fcd45d1bc4fcbe47b8972a62a57533d39979ba4 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/empty_function.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/empty_function.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/empty_function.stderr b/substrate/frame/support/test/tests/benchmark_ui/empty_function.stderr index 69d75303613d9ae5d88d71414eb626d5d3f6169a..4d73fa1835a5276ab2d192b04c2ce599d20ed0d4 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/empty_function.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/empty_function.stderr @@ -1,5 +1,5 @@ error: No valid #[extrinsic_call] or #[block] annotation could be found in benchmark function body. - --> tests/benchmark_ui/empty_function.rs:10:13 + --> tests/benchmark_ui/empty_function.rs:27:13 | -10 | fn bench() {} +27 | fn bench() {} | ^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/extra_extra.rs b/substrate/frame/support/test/tests/benchmark_ui/extra_extra.rs index 1aa6c9ecb7526cd8f40b88118266863e9d96c18f..d94c427451c2e5c86d5795b584722e571cdd8b37 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extra_extra.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/extra_extra.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/extra_extra.stderr b/substrate/frame/support/test/tests/benchmark_ui/extra_extra.stderr index bf36b4f08054a7b78b6ebc98805b0eb2907e1c05..17c67d21be1d33f6153c186895c45e967aedfe53 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extra_extra.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/extra_extra.stderr @@ -1,5 +1,5 @@ error: unexpected end of input, `extra` can only be specified once - --> tests/benchmark_ui/extra_extra.rs:9:26 - | -9 | #[benchmark(extra, extra)] - | ^ + --> tests/benchmark_ui/extra_extra.rs:26:26 + | +26 | #[benchmark(extra, extra)] + | ^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.rs b/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.rs index 3418c7af73748f431278c154c7ca1c6699bd8614..37693c4b718bc4b25dddfe6c6dd23bdf881a329c 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.stderr b/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.stderr index 4d48a8ad77a45a66d52cd05bd6b3046bbd2adac9..e17eba963a11fbb2114aaaee4073c7d3c5ceb64d 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/extra_skip_meta.stderr @@ -1,5 +1,5 @@ error: unexpected end of input, `skip_meta` can only be specified once - --> tests/benchmark_ui/extra_skip_meta.rs:9:34 - | -9 | #[benchmark(skip_meta, skip_meta)] - | ^ + --> tests/benchmark_ui/extra_skip_meta.rs:26:34 + | +26 | #[benchmark(skip_meta, skip_meta)] + | ^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.rs b/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.rs index ce360ee7577f5f0503af2e9b87eb293166a7d66b..101ba73488fad7f1d1a54b0f409014c0dc5943f1 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[extrinsic_call] diff --git a/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.stderr b/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.stderr index c5194d7a66502cc980a6832d4bfe1fc407976f77..530754b723a0eb9a69582fe639611df315e56a01 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/extrinsic_call_out_of_fn.stderr @@ -1,7 +1,7 @@ error: `#[extrinsic_call]` must be in a benchmark function definition labeled with `#[benchmark]`. - --> tests/benchmark_ui/extrinsic_call_out_of_fn.rs:3:1 - | -3 | #[extrinsic_call] - | ^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the attribute macro `extrinsic_call` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/benchmark_ui/extrinsic_call_out_of_fn.rs:20:1 + | +20 | #[extrinsic_call] + | ^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the attribute macro `extrinsic_call` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.rs b/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.rs index cfb00e88c00c0e07abd0180386b73c2d58bca02a..ce7693fc71b5b9ae90869ee7b5fd0922694679d4 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.stderr b/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.stderr index 115a8206f58a3683037f74fc0ce591db299327f2..87d4f476a60d1be358a31f965d9d01772082e450 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/invalid_origin.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `::RuntimeOrigin: From<{integer}>` is not satisfied - --> tests/benchmark_ui/invalid_origin.rs:6:1 - | -6 | #[benchmarks] - | ^^^^^^^^^^^^^ the trait `From<{integer}>` is not implemented for `::RuntimeOrigin` - | - = note: required for `{integer}` to implement `Into<::RuntimeOrigin>` - = note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/benchmark_ui/invalid_origin.rs:23:1 + | +23 | #[benchmarks] + | ^^^^^^^^^^^^^ the trait `From<{integer}>` is not implemented for `::RuntimeOrigin` + | + = note: required for `{integer}` to implement `Into<::RuntimeOrigin>` + = note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/benchmark_ui/missing_call.rs b/substrate/frame/support/test/tests/benchmark_ui/missing_call.rs index f39e74286b5cbe84e9cfa16ee3526f552730621d..0e65f6867a413ac79b63a1634642a9595895a003 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/missing_call.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/missing_call.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/missing_call.stderr b/substrate/frame/support/test/tests/benchmark_ui/missing_call.stderr index 908d9704392271d02b136237b53859dae8ab8e78..fd4d43d0a3d329c0e8fc30a55a9ff5cb734a006a 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/missing_call.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/missing_call.stderr @@ -1,8 +1,8 @@ error: No valid #[extrinsic_call] or #[block] annotation could be found in benchmark function body. - --> tests/benchmark_ui/missing_call.rs:10:13 + --> tests/benchmark_ui/missing_call.rs:27:13 | -10 | fn bench() { +27 | fn bench() { | ________________^ -11 | | assert_eq!(2 + 2, 4); -12 | | } +28 | | assert_eq!(2 + 2, 4); +29 | | } | |_____^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/missing_origin.rs b/substrate/frame/support/test/tests/benchmark_ui/missing_origin.rs index 2aaed756b9a46e894ee3f412b141dfa4d102ae17..15fb850dfbc5c7b85109d0feb00536cb949f9181 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/missing_origin.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/missing_origin.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/missing_origin.stderr b/substrate/frame/support/test/tests/benchmark_ui/missing_origin.stderr index 0e72bff4747a3f4deadb96eaa0dfb19a60923749..c72f2734db52418828c655619575f45b92aee592 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/missing_origin.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/missing_origin.stderr @@ -1,5 +1,5 @@ error: Single-item extrinsic calls must specify their origin as the first argument. - --> tests/benchmark_ui/missing_origin.rs:12:3 + --> tests/benchmark_ui/missing_origin.rs:29:3 | -12 | thing(); +29 | thing(); | ^^^^^ diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_basic.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_basic.rs index 450ce4f9c50da5eb1eb5457cff8092fe12c76d70..126cee8fa6c535f5651e083e181d58ffa13c1e73 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_basic.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_basic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_complex_path_benchmark_result.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_complex_path_benchmark_result.rs index 4930aedd6011e6b63848a825ae368935e71b0b6e..5cbc4aa23f19639bcf3bc2aaa378dd99c4308e2e 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_complex_path_benchmark_result.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_complex_path_benchmark_result.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_const_expr.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_const_expr.rs index bead3bf277be269eb74aa6d17220f032cd6e1269..b1ef44be8b09dcb5e55a998b49cf38ffde7e91b3 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_const_expr.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_const_expr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; use frame_support_test::Config; use frame_support::parameter_types; diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_no_last_stmt.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_no_last_stmt.rs index ce09b437a83bd42eb023a321d9ea1e913011a327..0bbd412423a9f3f8d253c6a848ddcdf95e65ac35 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_no_last_stmt.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_no_last_stmt.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_path_result_benchmark_error.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_path_result_benchmark_error.rs index 4930aedd6011e6b63848a825ae368935e71b0b6e..5cbc4aa23f19639bcf3bc2aaa378dd99c4308e2e 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_path_result_benchmark_error.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_path_result_benchmark_error.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_result.rs b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_result.rs index 33d71ece4a01812e61a7489d7cce72790050fd64..2948a2b7ebcd20397f899081f08c5c6e32cf2a4c 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/pass/valid_result.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/pass/valid_result.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.rs b/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.rs index 18cae4d5d5c8efacc49019710b4a6ec0260f2da6..0b007741f11ef9cf8484810762ab6eb32c680d0a 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.rs +++ b/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_benchmarking::v2::*; #[allow(unused_imports)] use frame_support_test::Config; diff --git a/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.stderr b/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.stderr index 5cebe9eab05e905e7b0a958884427ffd9e361bc5..bea770b634e25495a9207be51d41c363848fdc1f 100644 --- a/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.stderr +++ b/substrate/frame/support/test/tests/benchmark_ui/unrecognized_option.stderr @@ -1,5 +1,5 @@ error: expected `extra` or `skip_meta` - --> tests/benchmark_ui/unrecognized_option.rs:9:32 - | -9 | #[benchmark(skip_meta, extra, bad)] - | ^^^ + --> tests/benchmark_ui/unrecognized_option.rs:26:32 + | +26 | #[benchmark(skip_meta, extra, bad)] + | ^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime.rs b/substrate/frame/support/test/tests/construct_runtime.rs index a14276fa4d2ff5661663b9cc6a919c20f1d09d6d..9ad51ad530ebd2606f6b5cb6858b57e164b68830 100644 --- a/substrate/frame/support/test/tests/construct_runtime.rs +++ b/substrate/frame/support/test/tests/construct_runtime.rs @@ -578,14 +578,14 @@ fn call_weight_should_attach_to_call_enum() { #[test] fn call_name() { - use frame_support::dispatch::GetCallName; + use frame_support::traits::GetCallName; let name = module3::Call::::aux_4 {}.get_call_name(); assert_eq!("aux_4", name); } #[test] fn call_metadata() { - use frame_support::dispatch::{CallMetadata, GetCallMetadata}; + use frame_support::traits::{CallMetadata, GetCallMetadata}; let call = RuntimeCall::Module3(module3::Call::::aux_4 {}); let metadata = call.get_call_metadata(); let expected = CallMetadata { function_name: "aux_4".into(), pallet_name: "Module3".into() }; @@ -594,14 +594,14 @@ fn call_metadata() { #[test] fn get_call_names() { - use frame_support::dispatch::GetCallName; + use frame_support::traits::GetCallName; let call_names = module3::Call::::get_call_names(); assert_eq!(["fail", "aux_1", "aux_2", "aux_3", "aux_4", "operational"], call_names); } #[test] fn get_module_names() { - use frame_support::dispatch::GetCallMetadata; + use frame_support::traits::GetCallMetadata; let module_names = RuntimeCall::get_module_names(); assert_eq!( [ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui.rs b/substrate/frame/support/test/tests/construct_runtime_ui.rs index ec6758f4b295fd9ced4c70e4f5cc27ce1ddbd3a6..c3197c99a72bf94bbe134b89d24fced5063c15c4 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui.rs @@ -27,6 +27,9 @@ fn ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. std::env::set_var("SKIP_WASM_BUILD", "1"); + // Deny all warnings since we emit warnings as part of a Runtime's UI. + std::env::set_var("RUSTFLAGS", "--deny warnings"); + let t = trybuild::TestCases::new(); t.compile_fail("tests/construct_runtime_ui/*.rs"); } diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.rs b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.rs index ab55c22e9fbf19c10befe81585c322eeede4d0aa..fddb6408ea7b3ad71e696bba3b16a2ed60f0550e 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr index b622adbfe65b417865827af90ab13397ddad0a85..8fd67547af933f282b6537f54cac8d1ec3cbb086 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr @@ -1,5 +1,5 @@ error: `Block` was declared above. Please use exactly one declaration for `Block`. - --> $DIR/abundant_where_param.rs:7:3 - | -7 | Block = Block1, - | ^^^^^ + --> tests/construct_runtime_ui/abundant_where_param.rs:24:3 + | +24 | Block = Block1, + | ^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.rs b/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.rs index 4cb249714650e8b7dcee376e0342b13c5d273a39..d5d8553725aea1ced00f0d00e7cf18b0f40b36cc 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.stderr index 1ea62b7d6fd653faee0f8d111b757512047a6df1..732b8edb8211d5d4db46f658ce44a73f80a64196 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/both_use_and_excluded_parts.stderr @@ -1,22 +1,22 @@ error: Unexpected tokens, expected one of `=`, `,` - --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:26:43 + --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:43:43 | -26 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet }, +43 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet }, | ^^^^^^^^^ error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:18:64 + --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:35:64 | -18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +35 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | ^^^^^^^^^^^ not found in this scope | help: you might be missing a type parameter | -18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +35 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | +++++++++++++ error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:20:25 + --> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:37:25 | -20 | impl pallet::Config for Runtime {} +37 | impl pallet::Config for Runtime {} | ^^^^^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.rs b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.rs index 712452d1a3a43c43daa641b78b532d3ce4bfdf30..c94d092579de98acabd7e1abf92ce4e428e529e4 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.stderr index 2e2028fd1b862bb40c7854ed8b11137f426403b7..ef4fb8beba8a1468eb7ed9b4501d1b9fc640ec31 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index.stderr @@ -1,11 +1,11 @@ error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0 - --> $DIR/conflicting_index.rs:9:3 - | -9 | System: system::{}, - | ^^^^^^ + --> tests/construct_runtime_ui/conflicting_index.rs:26:3 + | +26 | System: system::{}, + | ^^^^^^ error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0 - --> $DIR/conflicting_index.rs:10:3 + --> tests/construct_runtime_ui/conflicting_index.rs:27:3 | -10 | Pallet1: pallet1::{} = 0, +27 | Pallet1: pallet1::{} = 0, | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.rs b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.rs index 6bc6bc5402e9aa0ee7d9f7483d5beb176ddf3245..3ba427f993cdff68da22591d52fe165c1c60c656 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.stderr index bfa3706a456a4540d6e20631d43542f1099cd6ca..d771119f221b3e72eb6c9d6384f28433c390cb72 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_index_2.stderr @@ -1,11 +1,11 @@ error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5 - --> $DIR/conflicting_index_2.rs:9:3 - | -9 | System: system::{} = 5, - | ^^^^^^ + --> tests/construct_runtime_ui/conflicting_index_2.rs:26:3 + | +26 | System: system::{} = 5, + | ^^^^^^ error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5 - --> $DIR/conflicting_index_2.rs:12:3 + --> tests/construct_runtime_ui/conflicting_index_2.rs:29:3 | -12 | Pallet3: pallet3::{}, +29 | Pallet3: pallet3::{}, | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.rs b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.rs index 513fbcfb5135402d7c34e4e0d4391f093eb4d4ef..133e8b1ca48b9499077c5db58b0188f9c7d0640c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr index 6fb983f03a9610e66779b2d8e9011797a0b87948..20051949b2d7a1f35336f1c809496842a0f8014a 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr @@ -1,11 +1,11 @@ error: Two pallets with the same name! - --> tests/construct_runtime_ui/conflicting_module_name.rs:7:3 - | -7 | Balance: balances::{Pallet}, - | ^^^^^^^ + --> tests/construct_runtime_ui/conflicting_module_name.rs:24:3 + | +24 | Balance: balances::{Pallet}, + | ^^^^^^^ error: Two pallets with the same name! - --> tests/construct_runtime_ui/conflicting_module_name.rs:8:3 - | -8 | Balance: balances::{Pallet}, - | ^^^^^^^ + --> tests/construct_runtime_ui/conflicting_module_name.rs:25:3 + | +25 | Balance: balances::{Pallet}, + | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.rs b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.rs index c0e325085b5e5b0a32c7a37cc35b81ceae11ef5b..5fd7822e8c37d412d60888a6e7f297aeed4954b6 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr index ec004fcf9534c388b926b0ca06b4b5f8fc9dafd5..cc2c2e160095dc83ff5ecd13eb4983967fdbc72a 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr @@ -5,30 +5,30 @@ error: use of deprecated constant `WhereSection::_w`: For more info see: - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | / construct_runtime! { -4 | | pub struct Runtime where -5 | | Block = Block, -6 | | NodeBlock = Block, +20 | / construct_runtime! { +21 | | pub struct Runtime where +22 | | Block = Block, +23 | | NodeBlock = Block, ... | -10 | | } -11 | | } +27 | | } +28 | | } | |_^ | = note: `-D deprecated` implied by `-D warnings` = note: this error originates in the macro `frame_support::match_and_insert` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | @@ -40,28 +40,28 @@ note: required by a bound in `frame_system::Event` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | note: required because it appears within the type `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Clone` @@ -72,28 +72,28 @@ note: required by a bound in `Clone` = note: this error originates in the derive macro `Clone` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | note: required because it appears within the type `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `EncodeLike` @@ -104,28 +104,28 @@ note: required by a bound in `EncodeLike` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | note: required because it appears within the type `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Decode` @@ -136,15 +136,15 @@ note: required by a bound in `Decode` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `frame_system::Event` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | @@ -157,15 +157,15 @@ note: required by a bound in `From` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `frame_system::Event` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | @@ -178,38 +178,38 @@ note: required by a bound in `TryInto` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 - | -3 | construct_runtime! { - | ^ the trait `Config` is not implemented for `Runtime` - | - = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 + | +20 | construct_runtime! { + | ^ the trait `Config` is not implemented for `Runtime` + | + = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `RawOrigin<_>: TryFrom` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | @@ -217,15 +217,15 @@ error[E0277]: the trait bound `RawOrigin<_>: TryFrom` is not satis = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | @@ -234,29 +234,29 @@ error[E0277]: the trait bound `Runtime: Config` is not satisfied = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | = note: required for `Pallet` to implement `Callable` note: required because it appears within the type `RuntimeCall` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Clone` @@ -267,29 +267,29 @@ note: required by a bound in `Clone` = note: this error originates in the derive macro `Clone` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | = note: required for `Pallet` to implement `Callable` note: required because it appears within the type `RuntimeCall` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `EncodeLike` @@ -300,29 +300,29 @@ note: required by a bound in `EncodeLike` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | = note: required for `Pallet` to implement `Callable` note: required because it appears within the type `RuntimeCall` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Decode` @@ -333,40 +333,40 @@ note: required by a bound in `Decode` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:9:3 - | -9 | System: frame_system::{Pallet, Call, Storage, Config, Event}, - | ^^^^^^ the trait `Config` is not implemented for `Runtime` - | + --> tests/construct_runtime_ui/deprecated_where_block.rs:26:3 + | +26 | System: frame_system::{Pallet, Call, Storage, Config, Event}, + | ^^^^^^ the trait `Config` is not implemented for `Runtime` + | note: required by a bound in `frame_system::GenesisConfig` - --> $WORKSPACE/substrate/frame/system/src/lib.rs - | - | pub struct GenesisConfig { - | ^^^^^^ required by this bound in `GenesisConfig` + --> $WORKSPACE/substrate/frame/system/src/lib.rs + | + | pub struct GenesisConfig { + | ^^^^^^ required by this bound in `GenesisConfig` error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | note: required because it appears within the type `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Result` @@ -377,28 +377,28 @@ note: required by a bound in `Result` = note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | note: required because it appears within the type `RuntimeEvent` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `TryInto` @@ -409,29 +409,29 @@ note: required by a bound in `TryInto` = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Runtime: Config` is not satisfied - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | | = note: required for `Pallet` to implement `Callable` note: required because it appears within the type `RuntimeCall` - --> tests/construct_runtime_ui/deprecated_where_block.rs:3:1 + --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 | -3 | // construct_runtime! { -4 | || pub struct Runtime where -5 | || Block = Block, -6 | || NodeBlock = Block, +20 | // construct_runtime! { +21 | || pub struct Runtime where +22 | || Block = Block, +23 | || NodeBlock = Block, ... || -10 | || } -11 | || } +27 | || } +28 | || } | ||_- in this macro invocation ... | note: required by a bound in `Result` diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.rs b/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.rs index 68a2523d3bcb2f8accc4c611bec0bb082096c431..ac5cf22ce1d8a0486cd2dec2b72cbb90aacc3112 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.stderr index e3f694781441ff4e4dc55c95cbbcd05f282c5dbf..51459614ebe094d5cce24f06191efc3090764ccb 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/double_module_parts.stderr @@ -1,5 +1,5 @@ error: `Config` was already declared before. Please remove the duplicate declaration - --> tests/construct_runtime_ui/double_module_parts.rs:7:37 - | -7 | Balance: balances::{Config, Call, Config, Origin}, - | ^^^^^^ + --> tests/construct_runtime_ui/double_module_parts.rs:24:37 + | +24 | Balance: balances::{Config, Call, Config, Origin}, + | ^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.rs b/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.rs index 83e708841aaf2dcaf69180dac7177381c362f791..ea169c8ff24de515528d75116faf69ca44f97eb7 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.stderr index 75de56076528b220c630477ff466dea2258e3765..e6d2fd4938d4b73e926a480be550f3f59517ca0c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/duplicate_exclude.stderr @@ -1,5 +1,5 @@ error: `Call` was already declared before. Please remove the duplicate declaration - --> $DIR/duplicate_exclude.rs:9:46 - | -9 | System: frame_system exclude_parts { Call, Call }, - | ^^^^ + --> tests/construct_runtime_ui/duplicate_exclude.rs:26:46 + | +26 | System: frame_system exclude_parts { Call, Call }, + | ^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.rs b/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.rs index 23badd76276e21b780067126f74dc1a01c4bcc31..3b8497fcc2413265eb643a36aade9b0a40ebd471 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.stderr index f0c0f17779d6756ce345569d4cbc6be351ddd81c..b76fa8b2fc829edd38d11801ef3c755ea37d4aff 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/empty_pallet_path.stderr @@ -1,5 +1,5 @@ error: expected one of: `crate`, `self`, `super`, identifier - --> tests/construct_runtime_ui/empty_pallet_path.rs:6:11 - | -6 | system: , - | ^ + --> tests/construct_runtime_ui/empty_pallet_path.rs:23:11 + | +23 | system: , + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.rs b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.rs index 441e9c75040c530ae856855a24fe99cbb29317a9..2619b680fcf699c206d761f587db61c7fd5348d6 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.stderr index 82e6aa6c8e3089a745b2581bba6907e7471a53f5..243e6618eaaab1d779db0faed43fd1c431331337 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_missspell.stderr @@ -1,5 +1,5 @@ error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` - --> $DIR/exclude_missspell.rs:9:24 - | -9 | System: frame_system exclude_part { Call }, - | ^^^^^^^^^^^^ + --> tests/construct_runtime_ui/exclude_missspell.rs:26:24 + | +26 | System: frame_system exclude_part { Call }, + | ^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.rs index 10cda7b4e7e8a50f3f7ad1ff2eea295620868045..b4cea16d1a566a93f8057fc30ec14a63ab7a433f 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.stderr index 4b85613838ab5e127a740946c6e37cd6e8a53539..a6a630cf8cb80e0ef9cea858b63407d848086b24 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/exclude_undefined_part.stderr @@ -1,22 +1,22 @@ error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`. - --> tests/construct_runtime_ui/exclude_undefined_part.rs:31:34 + --> tests/construct_runtime_ui/exclude_undefined_part.rs:48:34 | -31 | Pallet: pallet exclude_parts { Call }, +48 | Pallet: pallet exclude_parts { Call }, | ^^^^ error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/exclude_undefined_part.rs:23:64 + --> tests/construct_runtime_ui/exclude_undefined_part.rs:40:64 | -23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | ^^^^^^^^^^^ not found in this scope | help: you might be missing a type parameter | -23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | +++++++++++++ error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/exclude_undefined_part.rs:25:25 + --> tests/construct_runtime_ui/exclude_undefined_part.rs:42:25 | -25 | impl pallet::Config for Runtime {} +42 | impl pallet::Config for Runtime {} | ^^^^^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.rs b/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.rs index 35d49a4d8a23b172244e6ded301df7fc9f786e97..fbb6cad39d4481328f5bb37064309b1247223081 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.stderr index 6a6c4b415888935d9a122a84881ae5bb3ebd8b4f..9e7578fdac2585e00c1d2ea8ae99e19f37027817 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.stderr @@ -1,5 +1,5 @@ error: `System` pallet declaration is feature gated, please remove any `#[cfg]` attributes - --> tests/construct_runtime_ui/feature_gated_system_pallet.rs:7:3 - | -7 | System: frame_system::{Pallet, Call, Storage, Config, Event}, - | ^^^^^^ + --> tests/construct_runtime_ui/feature_gated_system_pallet.rs:24:3 + | +24 | System: frame_system::{Pallet, Call, Storage, Config, Event}, + | ^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.rs b/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.rs index 1ad1f8e0b1d5f6af667974aa67b8088d5754fbb3..3f6cb19ba6bccfef4b50402baad2493c6ab6d0c3 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.stderr index a6adb37d0494999b13e0dbfd66aa48a058f2bce2..bf53f43b9ba7bccdc6e1ec0cf720bc6725a6717c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.stderr @@ -1,5 +1,5 @@ error: `Call` is not allowed to have generics. Only the following pallets are allowed to have generics: `Event`, `Error`, `Origin`, `Config`. - --> tests/construct_runtime_ui/generics_in_invalid_module.rs:7:36 - | -7 | Balance: balances::::{Call, Origin}, - | ^^^^ + --> tests/construct_runtime_ui/generics_in_invalid_module.rs:24:36 + | +24 | Balance: balances::::{Call, Origin}, + | ^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs index bce87c51336eb26d0ecbe05fab6a9d4440bf204b..526dd50fb7ddd627c64d387227f78fd12b704c9c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.stderr index bfee2910cd2a465ca8bb9c834a705e6cc7d7a3d7..dfb49b149461b50ee256c9f9de1427a8a9d1ceaa 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.stderr @@ -1,6 +1,6 @@ error: feature = 1 ^ expected one of ``, `all`, `any`, `not` here - --> tests/construct_runtime_ui/invalid_meta_literal.rs:7:3 - | -7 | #[cfg(feature = 1)] - | ^ + --> tests/construct_runtime_ui/invalid_meta_literal.rs:24:3 + | +24 | #[cfg(feature = 1)] + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.rs index bf6919f5a58ef51e03e09656d8e8c60a1a42f7a4..c7fcb54cd41a3b43e677370b8662077452dd9d54 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr index 1f9277c3f0a8ee1a639f59d701210ce5051be251..5656e2ba4dc82446fffe3b366bb7ad10bf5d0e4b 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr @@ -1,5 +1,5 @@ error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` - --> tests/construct_runtime_ui/invalid_module_details.rs:6:17 - | -6 | system: System::(), - | ^ + --> tests/construct_runtime_ui/invalid_module_details.rs:23:17 + | +23 | system: System::(), + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.rs index 51f14e6883e4ac5dd641e143237d9c2d9fe9d2a0..c5dc80acfcd7e3b1b129010a5febf2c4e013ceda 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.stderr index dfcc9b8be42c605fc5c56dac8acb3c50cc295665..ad631de204e6766cc5d0d61106c23fc4f3fdbcb9 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.stderr @@ -1,5 +1,5 @@ error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `LockId`, `SlashReason` - --> tests/construct_runtime_ui/invalid_module_details_keyword.rs:6:20 - | -6 | system: System::{enum}, - | ^^^^ + --> tests/construct_runtime_ui/invalid_module_details_keyword.rs:23:20 + | +23 | system: System::{enum}, + | ^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.rs index 607741d7823d4fbc390884b2ab2ec7c949e5e3ec..9a8a6c17b7cf952be4cb0105e9572cc85ff4c8d5 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.stderr index 9dd849ff0412eb6a052145ccfcb317bc9a3a0020..b5b89a5a270c903b0e61198a8c05a0781cd2c7a5 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_module_entry.stderr @@ -1,5 +1,5 @@ error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `LockId`, `SlashReason` - --> tests/construct_runtime_ui/invalid_module_entry.rs:7:23 - | -7 | Balance: balances::{Unexpected}, - | ^^^^^^^^^^ + --> tests/construct_runtime_ui/invalid_module_entry.rs:24:23 + | +24 | Balance: balances::{Unexpected}, + | ^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.rs index c132fa01b2297273c86f1b4a58c0702a3c89535c..ddd1bada35ced5889466a4fdb65a80e9c7907670 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.stderr index 80be1b8dd42fd242524e67d29060566e60b912e4..5a28b42efe0a8aac277375589f25b9a7654bf2ad 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.stderr @@ -1,5 +1,5 @@ error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` - --> tests/construct_runtime_ui/invalid_token_after_module.rs:6:18 - | -6 | system: System ? - | ^ + --> tests/construct_runtime_ui/invalid_token_after_module.rs:23:18 + | +23 | system: System ? + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.rs index 42e7759f87f2bce6a552bef4e10eb7811c0b9302..07b86180ccf61f425b1612abf9e0d1cde6911993 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.stderr index 8988f8a35b0a4bd1f84fa9b13a25d56ed0d963f7..bafde9b1f3ec0b33b0b1bf26459d80fc938f442c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.stderr @@ -1,5 +1,5 @@ error: expected `:` - --> tests/construct_runtime_ui/invalid_token_after_name.rs:6:10 - | -6 | system ? - | ^ + --> tests/construct_runtime_ui/invalid_token_after_name.rs:23:10 + | +23 | system ? + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs index 091f0644494f6e509b21cd0268b41124acaedd25..23e0b34406702a366198b76ca507b6ea04f0f9d6 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.stderr index 9e358b6a21fab0f7022c11f697042299a5357c6f..02a0bb645bbd49636d93158a9cbd6fb88fe966ce 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.stderr @@ -1,5 +1,5 @@ error: expected one of: `Block`, `NodeBlock`, `UncheckedExtrinsic` - --> $DIR/invalid_where_param.rs:7:3 - | -7 | TypeX = Block, - | ^^^^^ + --> tests/construct_runtime_ui/invalid_where_param.rs:24:3 + | +24 | TypeX = Block, + | ^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs b/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs index bc2039c4e8180ee382e600acdf9c5b9c89ae80a1..985bef03a2f212ab8ba1c52b78aa6bd29b908aec 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.stderr index 30fcba4c710d05d7a496d09047997c397737a149..facd83a10869424781cd1338e76301fa6152aa0c 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.stderr @@ -1,5 +1,5 @@ error: Instantiable pallet with no generic `Event` cannot be constructed: pallet `Balance` must have generic `Event` - --> tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs:7:3 - | -7 | Balance: balances:: expanded::{}::{Event}, - | ^^^^^^^ + --> tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs:24:3 + | +24 | Balance: balances:: expanded::{}::{Event}, + | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.rs b/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.rs index afd96a04854f28a30adaa9e034373818040ac4bb..42041419028a8b6372351b15ec3ac1f67482b290 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.stderr index 5072f718db12efc3831fd2f4888435282b8c9b0a..6138a2d400831abe01a3829ae0ba9f082e6172d5 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_module_instance.stderr @@ -1,5 +1,5 @@ error: expected identifier - --> tests/construct_runtime_ui/missing_module_instance.rs:6:20 - | -6 | system: System::<>, - | ^ + --> tests/construct_runtime_ui/missing_module_instance.rs:23:20 + | +23 | system: System::<>, + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs b/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs index 42db63ae90a3a961530529d31d9a94db25b34538..32fc906fd052e70b39c8501ddda8080c5a38dfef 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.stderr index 6c076d7b49fc04a229112756eb7e4de6b0574332..e688d80e028939feb55a1f4a1e7470e3cec7a2bf 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.stderr @@ -1,5 +1,5 @@ error: Instantiable pallet with no generic `Origin` cannot be constructed: pallet `Balance` must have generic `Origin` - --> tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs:7:3 - | -7 | Balance: balances:: expanded::{}::{Origin}, - | ^^^^^^^ + --> tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs:24:3 + | +24 | Balance: balances:: expanded::{}::{Origin}, + | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.rs b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.rs index 685f9059b1be2c77fcb26e507924ca3ffdf667e1..fbf30cf4fe7874a5518ac1af90c7ac2be7ed89f2 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr index c8631f44051ca5a8bdb8cd1bfe683358e2cfb894..11ec6f33d204304bbfb1f25cc6b586e5dca9ede6 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr @@ -1,6 +1,6 @@ error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},` - --> tests/construct_runtime_ui/missing_system_module.rs:5:2 - | -5 | / { -6 | | } - | |_____^ + --> tests/construct_runtime_ui/missing_system_module.rs:22:2 + | +22 | / { +23 | | } + | |_____^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.rs b/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.rs index 4d2225a4afbc9e677c0f46aad7ded3d579f4c38d..249c7ba7edc14dad45f9a75dbf50971aea4ee1fd 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr index fb7e38b53dcd6b311ad288454ba48b0214ab1fba..92075a650b069892ec3227a64d2d51e617338137 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr @@ -1,5 +1,5 @@ error: Missing associated type for `UncheckedExtrinsic`. Add `UncheckedExtrinsic` = ... to where section. - --> tests/construct_runtime_ui/missing_where_param.rs:7:2 - | -7 | {} - | ^ + --> tests/construct_runtime_ui/missing_where_param.rs:24:2 + | +24 | {} + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.rs b/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.rs index 7dcbdb9aa4fba17321685b54aa144227496490a4..f04ac1c25f31d135d19769c6c71c013d21beb939 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.stderr index 2e055f5d3726a1657f471fb4d7492537295d38b1..def06573d74dcc44f255ce312aca1e66a54f02be 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/more_than_256_modules.stderr @@ -1,5 +1,5 @@ error: Pallet index doesn't fit into u8, index is 256 - --> $DIR/more_than_256_modules.rs:10:3 + --> tests/construct_runtime_ui/more_than_256_modules.rs:27:3 | -10 | Pallet256: pallet256::{}, +27 | Pallet256: pallet256::{}, | ^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.rs b/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.rs index 499f9a5cdcd5424102d5a71faa41a73e4df92d44..5442634a7ac08786bd215a37d0ad226c35256938 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.stderr index caf4a7401b08ecdcd6589fa60627eeedd0aac132..5b53e455c9cea2300bfcccd7b1ebb47abe253b50 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/no_comma_after_where.stderr @@ -1,5 +1,5 @@ error: Expected `,` or `{` - --> $DIR/no_comma_after_where.rs:6:3 - | -6 | Block = Block, - | ^^^^^ + --> tests/construct_runtime_ui/no_comma_after_where.rs:23:3 + | +23 | Block = Block, + | ^^^^^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs index 0d6afbcdc2c65aa0c4a86ba893158784528170f4..ea52293a6732534923485afbb720621dc2ba1d5e 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr index 75d0ce0546583fb2901dbf5eeba0ee4b40fc19d0..af9069edc80df8592d12aa23bde384a053bb93a7 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr @@ -1,63 +1,63 @@ error: The number of pallets exceeds the maximum number of tuple elements. To increase this limit, enable the tuples-96 feature of [frame_support]. - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:49:2 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:66:2 | -49 | pub struct Runtime +66 | pub struct Runtime | ^^^ error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:18:64 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:35:64 | -18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +35 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | ^^^^^^^^^^^ not found in this scope | help: you might be missing a type parameter | -18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +35 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | +++++++++++++ error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:20:25 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:37:25 | -20 | impl pallet::Config for Runtime {} +37 | impl pallet::Config for Runtime {} | ^^^^^^^ not found in this scope error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:22:31 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:39:31 | -22 | impl frame_system::Config for Runtime { +39 | impl frame_system::Config for Runtime { | ^^^^^^^ not found in this scope error[E0412]: cannot find type `RuntimeOrigin` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:24:23 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:41:23 | -24 | type RuntimeOrigin = RuntimeOrigin; +41 | type RuntimeOrigin = RuntimeOrigin; | ^^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeOrigin` error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:26:21 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:43:21 | -26 | type RuntimeCall = RuntimeCall; +43 | type RuntimeCall = RuntimeCall; | ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall` error[E0412]: cannot find type `RuntimeEvent` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:32:22 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:49:22 | -32 | type RuntimeEvent = RuntimeEvent; +49 | type RuntimeEvent = RuntimeEvent; | ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent` error[E0412]: cannot find type `PalletInfo` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:38:20 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:55:20 | -38 | type PalletInfo = PalletInfo; +55 | type PalletInfo = PalletInfo; | ^^^^^^^^^^ | help: you might have meant to use the associated type | -38 | type PalletInfo = Self::PalletInfo; +55 | type PalletInfo = Self::PalletInfo; | ~~~~~~~~~~~~~~~~ help: consider importing one of these items | -1 + use frame_benchmarking::__private::traits::PalletInfo; +18 + use frame_benchmarking::__private::traits::PalletInfo; | -1 + use frame_support::traits::PalletInfo; +18 + use frame_support::traits::PalletInfo; | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs index 8b3e26bc5e2e42b9f320239b3998e7275306cdbb..2834b5b8f2a8bc9c0fe6dcb58d01ff8bb778b2d4 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr index 47504573515a22f09c8942ef6bd67e1324de3b39..0ad408b812306f1df7487768e7e6339a5e7553eb 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of constant value failed - --> tests/construct_runtime_ui/pallet_error_too_large.rs:73:1 + --> tests/construct_runtime_ui/pallet_error_too_large.rs:90:1 | -73 | / construct_runtime! { -74 | | pub struct Runtime -75 | | { -76 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -77 | | Pallet: pallet::{Pallet}, -78 | | } -79 | | } - | |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:73:1 +90 | / construct_runtime! { +91 | | pub struct Runtime +92 | | { +93 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +94 | | Pallet: pallet::{Pallet}, +95 | | } +96 | | } + | |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:90:1 | = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs index 25cb5e93f652e0ef23632f0b69d71d6d786d855b..62c4b1327e0a16b4ee6e6efe3715f2b9efab38e3 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr index f3f29e4c6955491dfd81694af8916fcf46ec999e..c6dfeb792b8e83aa39fb4bbd68a9243980515fc2 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr @@ -1,16 +1,16 @@ error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove `Call` from construct_runtime? - --> tests/construct_runtime_ui/undefined_call_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_call_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet::{Pallet, Call}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet::{Pallet, Call}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_call_check::is_call_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs index c44cceef81a123ea31ae8c5a774f65fd18669527..893690501a8351d07e78f9b4fa9b7daab7413790 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr index 81e42cec3b97a171402f3b3cb2295969ce71cd98..6dd332630adaae8971eb01ba0dccb1509071045e 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr @@ -1,36 +1,36 @@ error: `Pallet` does not have #[pallet::event] defined, perhaps you should remove `Event` from construct_runtime? - --> tests/construct_runtime_ui/undefined_event_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_event_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Event}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Event}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_event_check::is_event_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Event` in module `pallet` - --> tests/construct_runtime_ui/undefined_event_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_event_part.rs:65:1 | -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Event}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Event}, +70 | | } +71 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing one of these items | -1 + use frame_support_test::Event; +18 + use frame_support_test::Event; | -1 + use frame_system::Event; +18 + use frame_system::Event; | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs index 4436202f04fc7db4783e76990060b9df10e0c8cd..a3501ca31a3714ca129070df05695076df728c7e 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr index 920785fc962911594d45c2a3c737a1bce7facd9e..00b5a1370036239fe45a9b7f7058544e62decc8f 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr @@ -1,36 +1,36 @@ error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you should remove `Config` from construct_runtime? - --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Config}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Config}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_genesis_config_check::is_genesis_config_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `GenesisConfig` in module `pallet` - --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:65:1 | -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Config}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Config}, +70 | | } +71 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing one of these items | -1 + use frame_system::GenesisConfig; +18 + use frame_system::GenesisConfig; | -1 + use test_pallet::GenesisConfig; +18 + use test_pallet::GenesisConfig; | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs index 8b48c4d0d6af7c1f84f4a5958b2b478c9c150627..e22745930d69a00c789075092d7a5aff11f09fb8 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr index 659d43b151006e894f8a468f3548a1bd8ef279fe..749d2d9c159ee174e8b53a1f7782308f37e96172 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr @@ -1,34 +1,34 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should remove `Inherent` from construct_runtime? - --> tests/construct_runtime_ui/undefined_inherent_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_inherent_check::is_inherent_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `create_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `create_inherent` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | _^ -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -37,19 +37,19 @@ error[E0599]: no function or associated item named `create_inherent` found for s = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `is_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | _^ -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -58,19 +58,19 @@ error[E0599]: no function or associated item named `is_inherent` found for struc = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `check_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `check_inherent` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | _^ -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -79,19 +79,19 @@ error[E0599]: no function or associated item named `check_inherent` found for st = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | _^ -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_^ associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -100,19 +100,19 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `p = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `is_inherent_required` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent_required` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | _^ -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -53 | | } -54 | | } +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +70 | | } +71 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs index 974928785f748620cfc4b8fb642b84aa16a7e789..656365279b8867867b7ff2d2b64b055b77eead0a 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr index c41dbe79421eae92da3134ae96f4cce1728bbc34..13612233e86888deb91ae92b53ab2f34c7aea929 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr @@ -1,36 +1,36 @@ error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remove `Origin` from construct_runtime? - --> tests/construct_runtime_ui/undefined_origin_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_origin_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Origin}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Origin}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_origin_check::is_origin_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Origin` in module `pallet` - --> tests/construct_runtime_ui/undefined_origin_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_origin_part.rs:65:1 | -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet expanded::{}::{Pallet, Origin}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet expanded::{}::{Pallet, Origin}, +70 | | } +71 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing one of these items | -1 + use frame_support_test::Origin; +18 + use frame_support_test::Origin; | -1 + use frame_system::Origin; +18 + use frame_system::Origin; | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs index 505b249d92d58897a32af2cf3b2b312cc6351dd1..05545821ab0283faafae8734b2344e9fe3aad811 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr index 007b77250736ec7f83159f6c965b18919bada40d..64677728c8b7c161c16b5beeff8804a0bef9dbcc 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr @@ -1,49 +1,49 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you should remove `ValidateUnsigned` from construct_runtime? - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:5:1 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:22:1 | -5 | #[frame_support::pallet] +22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -48 | / construct_runtime! { -49 | | pub struct Runtime -50 | | { -51 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -52 | | Pallet: pallet::{Pallet, ValidateUnsigned}, -53 | | } -54 | | } +65 | / construct_runtime! { +66 | | pub struct Runtime +67 | | { +68 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +69 | | Pallet: pallet::{Pallet, ValidateUnsigned}, +70 | | } +71 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_validate_unsigned_check::is_validate_unsigned_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:52:3 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:69:3 | -48 | // construct_runtime! { -49 | || pub struct Runtime -50 | || { -51 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -52 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +65 | // construct_runtime! { +66 | || pub struct Runtime +67 | || { +68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, | || -^^^^^^ variant or associated item not found in `RuntimeCall` | ||________| | | ... | error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `pre_dispatch` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | __^ | | _| | || -49 | || pub struct Runtime -50 | || { -51 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -52 | || Pallet: pallet::{Pallet, ValidateUnsigned}, -53 | || } -54 | || } +66 | || pub struct Runtime +67 | || { +68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +70 | || } +71 | || } | ||_- in this macro invocation ... | | @@ -54,21 +54,21 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `validate_unsigned` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:48:1 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1 | -11 | pub struct Pallet(_); +28 | pub struct Pallet(_); | -------------------- function or associated item `validate_unsigned` not found for this struct ... -48 | construct_runtime! { +65 | construct_runtime! { | __^ | | _| | || -49 | || pub struct Runtime -50 | || { -51 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -52 | || Pallet: pallet::{Pallet, ValidateUnsigned}, -53 | || } -54 | || } +66 | || pub struct Runtime +67 | || { +68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +70 | || } +71 | || } | ||_- in this macro invocation ... | | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs index e4e2d3dca021ea74401e9512553ba4ef5ac6003b..30715bb04922fc4b53b074ae80794f78f2c5f0c3 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.stderr index 34637269db617c7edb52091455593f45e0bda079..efaed3e97b91ec19609d1377eadc62f30917c852 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.stderr @@ -1,6 +1,6 @@ error: feature(test) ^ expected one of `=`, `,`, `)` here - --> tests/construct_runtime_ui/unsupported_meta_structure.rs:7:3 - | -7 | #[cfg(feature(test))] - | ^ + --> tests/construct_runtime_ui/unsupported_meta_structure.rs:24:3 + | +24 | #[cfg(feature(test))] + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs index 491cc2c90533de4e1b08ed22070307e7d827b93b..d3af4a53ef0b7c2cb67f286d4e76a0b1185ad343 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.stderr index da1b61b1c30782f8f3fbc2e078e49fe44595d5b8..52fbe6d466e5c0751af4b54cffe43b0a09d3e356 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.stderr @@ -1,5 +1,5 @@ error: Unsupported attribute, only #[cfg] is supported on pallet declarations in `construct_runtime` - --> tests/construct_runtime_ui/unsupported_pallet_attr.rs:7:3 - | -7 | #[attr] - | ^ + --> tests/construct_runtime_ui/unsupported_pallet_attr.rs:24:3 + | +24 | #[attr] + | ^ diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.rs index 8563be1008cd93473f978cd043dcbad8f2d89848..36dde76d5046c9e0eb4f5e4acb196b0ab6973173 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.stderr index 4058ccab2c5d7da5a836f9a5c90d89f22f285a88..802a966c02cf64d7bf4938cd1e3eb36075928cec 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/use_undefined_part.stderr @@ -1,22 +1,22 @@ error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`. - --> tests/construct_runtime_ui/use_undefined_part.rs:31:30 + --> tests/construct_runtime_ui/use_undefined_part.rs:48:30 | -31 | Pallet: pallet use_parts { Call }, +48 | Pallet: pallet use_parts { Call }, | ^^^^ error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/use_undefined_part.rs:23:64 + --> tests/construct_runtime_ui/use_undefined_part.rs:40:64 | -23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | ^^^^^^^^^^^ not found in this scope | help: you might be missing a type parameter | -23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; | +++++++++++++ error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/use_undefined_part.rs:25:25 + --> tests/construct_runtime_ui/use_undefined_part.rs:42:25 | -25 | impl pallet::Config for Runtime {} +42 | impl pallet::Config for Runtime {} | ^^^^^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.rs b/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.rs index 3b27916933865325144e02bfe7d86bfaba63f484..332e1e78730e526491b8d448858ab3ffbafab2d9 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::*; pub trait Animal { diff --git a/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.stderr b/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.stderr index 735fd7a628e77872f62a535915d9b3c2aeb978e5..1dc575bbffa3c7422eb8b2e5f98d751b5edc794a 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/attached_to_non_impl.stderr @@ -1,5 +1,5 @@ error: expected `impl` - --> tests/derive_impl_ui/attached_to_non_impl.rs:39:1 + --> tests/derive_impl_ui/attached_to_non_impl.rs:56:1 | -39 | struct Something {} +56 | struct Something {} | ^^^^^^ diff --git a/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.rs b/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.rs index 2badd1830033bdf877dd19764ba738321c953486..bc118acdf1e69745a8b890ea27fbd3f4e7375704 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::*; pub trait Animal { diff --git a/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.stderr b/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.stderr index 1cac1662462767fc1139006041ed683eaddcb5ad..5cfbd8c88624971b205c587d70106e3e398581e4 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/bad_default_impl_path.stderr @@ -1,7 +1,7 @@ error: cannot find macro `__export_tokens_tt_tiger` in this scope - --> tests/derive_impl_ui/bad_default_impl_path.rs:42:1 + --> tests/derive_impl_ui/bad_default_impl_path.rs:59:1 | -42 | #[derive_impl(Tiger as Animal)] +59 | #[derive_impl(Tiger as Animal)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `frame_support::macro_magic::forward_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.rs b/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.rs index adc5df23a759a0cdb43495d44261cc9e9c0f2657..9535ac3deda6b46f85178b7c9062d8cea7adfe94 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::*; pub trait Animal { diff --git a/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.stderr b/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.stderr index 6fd4e431beb52c62c5ea2b98648f625627ab0825..664146302d299963f56999662ce567e613031c81 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/bad_disambiguation_path.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Insect` in this scope - --> tests/derive_impl_ui/bad_disambiguation_path.rs:38:35 + --> tests/derive_impl_ui/bad_disambiguation_path.rs:55:35 | -38 | #[derive_impl(FourLeggedAnimal as Insect)] +55 | #[derive_impl(FourLeggedAnimal as Insect)] | ^^^^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs index 0d8dc8eb1d4720ed542c6a4d95bf74e932848552..7e5df20a963c8f803545e01b33aed283710eeb83 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::{*, pallet_prelude::inject_runtime_type}; use static_assertions::assert_type_eq_all; diff --git a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.stderr b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.stderr index 683131cceb8dce24e5a7947bc367243e58014ab8..79b50a940b80246451e22096293ec723a75e19a7 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.stderr @@ -1,10 +1,10 @@ error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs:13:10 + --> tests/derive_impl_ui/inject_runtime_type_fails_when_type_not_in_scope.rs:30:10 | -13 | type RuntimeCall = (); +30 | type RuntimeCall = (); | ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall` ... -18 | #[derive_impl(Pallet)] // Injects type RuntimeCall = RuntimeCall; +35 | #[derive_impl(Pallet)] // Injects type RuntimeCall = RuntimeCall; | ---------------------- in this macro invocation | = note: this error originates in the macro `__export_tokens_tt_pallet` which comes from the expansion of the macro `frame_support::macro_magic::forward_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.rs b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.rs index 60ec710d0154c368a222bf358a2382b4dc94665b..cb541091a97636715654d61a3259b444558cab45 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::{*, pallet_prelude::inject_runtime_type}; use static_assertions::assert_type_eq_all; diff --git a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.stderr b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.stderr index c3382510744a7a1912fed107abbcf29922971905..501aad0419f8e85a67f1b9cde11d5c5452feaff0 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/inject_runtime_type_invalid.stderr @@ -1,14 +1,14 @@ error: `#[inject_runtime_type]` can only be attached to `RuntimeCall`, `RuntimeEvent`, `RuntimeOrigin` or `PalletInfo` - --> tests/derive_impl_ui/inject_runtime_type_invalid.rs:15:5 + --> tests/derive_impl_ui/inject_runtime_type_invalid.rs:32:5 | -15 | type RuntimeInfo = (); +32 | type RuntimeInfo = (); | ^^^^^^^^^^^^^^^^^^^^^^ error[E0046]: not all trait items implemented, missing: `RuntimeInfo` - --> tests/derive_impl_ui/inject_runtime_type_invalid.rs:13:1 + --> tests/derive_impl_ui/inject_runtime_type_invalid.rs:30:1 | -5 | type RuntimeInfo; +22 | type RuntimeInfo; | ---------------- `RuntimeInfo` from trait ... -13 | impl Config for Pallet { +30 | impl Config for Pallet { | ^^^^^^^^^^^^^^^^^^^^^^ missing `RuntimeInfo` in implementation diff --git a/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.rs b/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.rs index 21f1cc32009a5d27a6196e99caff6b2f718af8d4..f26c28313e5154a3f0a4e66d458375d0ecf59761 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::*; pub trait Animal { diff --git a/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.stderr b/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.stderr index 85cd94ae08ae7ee72a6a67b0c0cd113abd7b70ff..365df0331ae73a5b238cbf6437939c7cea998702 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.stderr +++ b/substrate/frame/support/test/tests/derive_impl_ui/missing_disambiguation_path.stderr @@ -1,7 +1,7 @@ error: unexpected end of input, expected identifier - --> tests/derive_impl_ui/missing_disambiguation_path.rs:38:1 + --> tests/derive_impl_ui/missing_disambiguation_path.rs:55:1 | -38 | #[derive_impl(FourLeggedAnimal as)] +55 | #[derive_impl(FourLeggedAnimal as)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the attribute macro `derive_impl` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/derive_impl_ui/pass/basic_overriding.rs b/substrate/frame/support/test/tests/derive_impl_ui/pass/basic_overriding.rs index 336ddc315f8cb3f7387db6894db1106113698822..37c0742f195d786ded121a631dbd384e48aff137 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/pass/basic_overriding.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/pass/basic_overriding.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::*; use static_assertions::assert_type_eq_all; diff --git a/substrate/frame/support/test/tests/derive_impl_ui/pass/macro_magic_working.rs b/substrate/frame/support/test/tests/derive_impl_ui/pass/macro_magic_working.rs index ec09bd15e01731b5c5cf544928e4dea264c8831b..e4cb94e74bd62473124bd75673aac7ab8f2cc3aa 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/pass/macro_magic_working.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/pass/macro_magic_working.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::macro_magic::export_tokens] struct MyCoolStruct { field: u32, diff --git a/substrate/frame/support/test/tests/derive_impl_ui/pass/runtime_type_working.rs b/substrate/frame/support/test/tests/derive_impl_ui/pass/runtime_type_working.rs index 04ad008944682cc0705ed04c8b239838e67286c7..93b7309cf97146cad41c5af62e781c8c5320dc9c 100644 --- a/substrate/frame/support/test/tests/derive_impl_ui/pass/runtime_type_working.rs +++ b/substrate/frame/support/test/tests/derive_impl_ui/pass/runtime_type_working.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::{*, pallet_prelude::inject_runtime_type}; use static_assertions::assert_type_eq_all; diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/clone.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/clone.rs index 2bc1cc492d171f695fa22334c3d53e1c4f30cae6..9da7d66fe1bd8d4453d1e3003b9dc041f4ca870d 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/clone.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/clone.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/clone.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/clone.stderr index 7744586e56bf4757994f2a92d373b763a3643df1..e0294d3c2fde715c7e9a65d078b4c3aa4868bd8b 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/clone.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/clone.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `::C: Clone` is not satisfied - --> tests/derive_no_bound_ui/clone.rs:7:2 - | -7 | c: T::C, - | ^ the trait `Clone` is not implemented for `::C` + --> tests/derive_no_bound_ui/clone.rs:24:2 + | +24 | c: T::C, + | ^ the trait `Clone` is not implemented for `::C` diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/debug.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/debug.rs index 6016c3e6d98b8ca71eadc645382fd997071ec22d..02215cb8d57a5011e310442d1b5078c8c50e5b50 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/debug.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/debug.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/debug.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/debug.stderr index acc7f80b376634e46e3301f9f76d061c9b329526..d86292d71b7a1d77a27322bed069cc077f5ba101 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/debug.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/debug.stderr @@ -1,8 +1,8 @@ error[E0277]: `::C` doesn't implement `std::fmt::Debug` - --> tests/derive_no_bound_ui/debug.rs:7:2 - | -7 | c: T::C, - | ^ `::C` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` - | - = help: the trait `std::fmt::Debug` is not implemented for `::C` - = note: required for the cast from `::C` to the object type `dyn std::fmt::Debug` + --> tests/derive_no_bound_ui/debug.rs:24:2 + | +24 | c: T::C, + | ^ `::C` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` + | + = help: the trait `std::fmt::Debug` is not implemented for `::C` + = note: required for the cast from `::C` to the object type `dyn std::fmt::Debug` diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/default.rs index 0780a88e6753daf9719aa98204b9e583f16c1b31..1a66c3b79fcf96a6a10488b0a1e4aadb7b87b0c1 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/default.stderr index d56dd438f2a7fa2bf100920cab12151d8737fdd6..90e976d9f6a345d729e80a8052d0ddd442dc1b02 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `::C: std::default::Default` is not satisfied - --> tests/derive_no_bound_ui/default.rs:7:2 - | -7 | c: T::C, - | ^ the trait `std::default::Default` is not implemented for `::C` + --> tests/derive_no_bound_ui/default.rs:24:2 + | +24 | c: T::C, + | ^ the trait `std::default::Default` is not implemented for `::C` diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.rs index 51b6137c0075537bc249424ddce61125db8bd495..48f276df68b85df0cefaf4b2c34ada8605225039 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[derive(frame_support::DefaultNoBound)] enum Empty {} diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.stderr index 9c93b515adce51bc891f86d1fe765f9ca6ba8a5d..246fe67586b9852e0ba751e01b44f8f7923604d3 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_empty_enum.stderr @@ -1,5 +1,5 @@ error: cannot derive Default for an empty enum - --> tests/derive_no_bound_ui/default_empty_enum.rs:2:6 - | -2 | enum Empty {} - | ^^^^^ + --> tests/derive_no_bound_ui/default_empty_enum.rs:19:6 + | +19 | enum Empty {} + | ^^^^^ diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.rs index 185df01fe2b842341c417ba327e0fd11fb7942e8..1d40eac4c7193cb1c91268f9ccf26673f7c8149a 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.stderr index 12e0023671587784b0c00accd57f501fb05d5f02..d0c4401e8c582f62a4552ce8c098d7d463bf00aa 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_no_attribute.stderr @@ -1,5 +1,5 @@ error: no default declared, make a variant default by placing `#[default]` above it - --> tests/derive_no_bound_ui/default_no_attribute.rs:6:6 - | -6 | enum Foo { - | ^^^ + --> tests/derive_no_bound_ui/default_no_attribute.rs:23:6 + | +23 | enum Foo { + | ^^^ diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.rs index c3d175da6c056f917ebd33cc3fb7c70b7aaafe22..808223f2ff076083a75d7f093a8ec8beefa07ca9 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.stderr index 5430ef142c5c864581167a0db87fb78f68de02ef..775964ea42deb2a179b18309b9c18684e291f1b1 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.stderr @@ -1,21 +1,21 @@ error: multiple declared defaults - --> tests/derive_no_bound_ui/default_too_many_attributes.rs:5:10 - | -5 | #[derive(frame_support::DefaultNoBound)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `frame_support::DefaultNoBound` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/derive_no_bound_ui/default_too_many_attributes.rs:22:10 + | +22 | #[derive(frame_support::DefaultNoBound)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `frame_support::DefaultNoBound` (in Nightly builds, run with -Z macro-backtrace for more info) error: first default - --> tests/derive_no_bound_ui/default_too_many_attributes.rs:7:2 - | -7 | / #[default] -8 | | Bar(T::C), - | |_____________^ + --> tests/derive_no_bound_ui/default_too_many_attributes.rs:24:2 + | +24 | / #[default] +25 | | Bar(T::C), + | |_____________^ error: additional default - --> tests/derive_no_bound_ui/default_too_many_attributes.rs:9:2 + --> tests/derive_no_bound_ui/default_too_many_attributes.rs:26:2 | -9 | / #[default] -10 | | Baz, +26 | / #[default] +27 | | Baz, | |_______^ diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.rs index 5822cda1aa64df30f604df3a8438d1daacebc36e..74e4b61df72d346199d704abb0eefbda1321f425 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[derive(frame_support::DefaultNoBound)] union Foo { field1: u32, diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.stderr index 1e01e1baaf8ac1793beb5b178864a5c7c32514bb..177fcce7fe1282eade894f4739e9cdfee5ce7c56 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/default_union.stderr @@ -1,5 +1,5 @@ error: Union type not supported by `derive(DefaultNoBound)` - --> tests/derive_no_bound_ui/default_union.rs:2:1 - | -2 | union Foo { - | ^^^^^ + --> tests/derive_no_bound_ui/default_union.rs:19:1 + | +19 | union Foo { + | ^^^^^ diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/eq.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/eq.rs index a48452626368c08dd9d0df1265a344caccce86e7..12636c94e69277237c3ce3f887012ae626709e87 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/eq.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/eq.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/eq.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/eq.stderr index eb3345eede508649c5bdaa977edf15024cd5627a..c8430210e82143aefd343c5639de6ce629edf1f9 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/eq.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/eq.stderr @@ -1,12 +1,12 @@ error[E0277]: can't compare `Foo` with `Foo` - --> tests/derive_no_bound_ui/eq.rs:6:8 - | -6 | struct Foo { - | ^^^^^^^^^^^^^^ no implementation for `Foo == Foo` - | - = help: the trait `PartialEq` is not implemented for `Foo` + --> tests/derive_no_bound_ui/eq.rs:23:8 + | +23 | struct Foo { + | ^^^^^^^^^^^^^^ no implementation for `Foo == Foo` + | + = help: the trait `PartialEq` is not implemented for `Foo` note: required by a bound in `std::cmp::Eq` - --> $RUST/core/src/cmp.rs - | - | pub trait Eq: PartialEq { - | ^^^^^^^^^^^^^^^ required by this bound in `Eq` + --> $RUST/core/src/cmp.rs + | + | pub trait Eq: PartialEq { + | ^^^^^^^^^^^^^^^ required by this bound in `Eq` diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.rs b/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.rs index 7bd6b7ef6a2e3c5fec0ee6488356c66a76b5593d..23a910a24ea0d0121c3ec821985af65fd3a1bf3e 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + trait Config { type C; } diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.stderr b/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.stderr index 1c230db376a49e000f848fc0e130580f7b2a7a3e..b46df2369b451237bb99e8acdb34da3cf9b41ed0 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.stderr +++ b/substrate/frame/support/test/tests/derive_no_bound_ui/partial_eq.stderr @@ -1,5 +1,5 @@ error[E0369]: binary operation `==` cannot be applied to type `::C` - --> tests/derive_no_bound_ui/partial_eq.rs:7:2 - | -7 | c: T::C, - | ^ + --> tests/derive_no_bound_ui/partial_eq.rs:24:2 + | +24 | c: T::C, + | ^ diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index 8c85cd56959533f0e35cdebc35d7b48b03a6b225..88aad32225a0bbc47987bbc587abfa2036911ada 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -17,10 +17,7 @@ use frame_support::{ assert_ok, - dispatch::{ - DispatchClass, DispatchInfo, Dispatchable, GetDispatchInfo, Parameter, Pays, - UnfilteredDispatchable, - }, + dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Parameter, Pays}, dispatch_context::with_context, pallet_prelude::{StorageInfoTrait, ValueQuery}, parameter_types, @@ -28,6 +25,7 @@ use frame_support::{ traits::{ ConstU32, GetCallIndex, GetCallName, GetStorageVersion, OnFinalize, OnGenesis, OnInitialize, OnRuntimeUpgrade, PalletError, PalletInfoAccess, StorageVersion, + UnfilteredDispatchable, }, weights::{RuntimeDbWeight, Weight}, }; @@ -37,7 +35,7 @@ use sp_io::{ TestExternalities, }; use sp_runtime::{ - traits::{Extrinsic as ExtrinsicT, SignaturePayload as SignaturePayloadT}, + traits::{Dispatchable, Extrinsic as ExtrinsicT, SignaturePayload as SignaturePayloadT}, DispatchError, ModuleError, }; diff --git a/substrate/frame/support/test/tests/pallet_instance.rs b/substrate/frame/support/test/tests/pallet_instance.rs index be675a562cec5d40c7cf468c5a6b04b08202b998..8d2d52d18852afe5eb2f5b9de059cd7d2ea25b4f 100644 --- a/substrate/frame/support/test/tests/pallet_instance.rs +++ b/substrate/frame/support/test/tests/pallet_instance.rs @@ -16,11 +16,14 @@ // limitations under the License. use frame_support::{ - dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Pays, UnfilteredDispatchable}, + dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Pays}, pallet_prelude::ValueQuery, parameter_types, storage::unhashed, - traits::{ConstU32, GetCallName, OnFinalize, OnGenesis, OnInitialize, OnRuntimeUpgrade}, + traits::{ + ConstU32, GetCallName, OnFinalize, OnGenesis, OnInitialize, OnRuntimeUpgrade, + UnfilteredDispatchable, + }, weights::Weight, }; use sp_io::{ diff --git a/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.rs b/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.rs index 5173d983bbd8e37a6df18ba4b0b7953b6a3c9e94..fb3d1a742471e9fde9ac587f0cf9f6357af10be6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.rs +++ b/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet [foo]] mod foo { } diff --git a/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.stderr b/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.stderr index 9eac5de35db802320915c3b76a0367c03d1040f7..1a54d76c97dc65c2213b56234885891117c02981 100644 --- a/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/attr_non_empty.stderr @@ -1,5 +1,5 @@ error: Invalid pallet macro call: unexpected attribute. Macro call must be bare, such as `#[frame_support::pallet]` or `#[pallet]`, or must specify the `dev_mode` attribute, such as `#[frame_support::pallet(dev_mode)]` or #[pallet(dev_mode)]. - --> tests/pallet_ui/attr_non_empty.rs:1:26 - | -1 | #[frame_support::pallet [foo]] - | ^^^ + --> tests/pallet_ui/attr_non_empty.rs:18:26 + | +18 | #[frame_support::pallet [foo]] + | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.rs b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.rs index 4f18f7281817afca45d6846339185821c4013705..06a111150172bd255648b281e80c2e7d479742fb 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.stderr b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.stderr index d10bf1359019adb1197c9bbb2c4cbd48f66fb817..c86930f8a64e3a287a45ac15ae127982dc184d10 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound.stderr @@ -4,17 +4,17 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_argument_invalid_bound.rs:19:20 + --> tests/pallet_ui/call_argument_invalid_bound.rs:36:20 | -19 | #[pallet::weight(0)] +36 | #[pallet::weight(0)] | ^ | = note: `-D deprecated` implied by `-D warnings` error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` - --> tests/pallet_ui/call_argument_invalid_bound.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ `::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `::Bar` @@ -22,13 +22,13 @@ error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` = note: required for the cast from `&::Bar` to the object type `dyn std::fmt::Debug` error[E0277]: the trait bound `::Bar: Clone` is not satisfied - --> tests/pallet_ui/call_argument_invalid_bound.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ the trait `Clone` is not implemented for `::Bar` error[E0369]: binary operation `==` cannot be applied to type `&::Bar` - --> tests/pallet_ui/call_argument_invalid_bound.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.rs b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.rs index 20568908e72b22a1486ac968c32b7bd37ab561db..3ce76180081b4757989b21ef8b1a92eb71d6f552 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr index 7173cdcd47361651ca3fa4b5ae887ab9b1c94a92..1b04f44c78febbf7232b26dedfd35021ea6e1981 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.stderr @@ -4,17 +4,17 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:19:20 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:36:20 | -19 | #[pallet::weight(0)] +36 | #[pallet::weight(0)] | ^ | = note: `-D deprecated` implied by `-D warnings` error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ `::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `::Bar` @@ -22,32 +22,32 @@ error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` = note: required for the cast from `&::Bar` to the object type `dyn std::fmt::Debug` error[E0277]: the trait bound `::Bar: Clone` is not satisfied - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ the trait `Clone` is not implemented for `::Bar` error[E0369]: binary operation `==` cannot be applied to type `&::Bar` - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36 | -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ error[E0277]: the trait bound `::Bar: WrapperTypeEncode` is not satisfied - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:21:36 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36 | -1 | #[frame_support::pallet] +18 | #[frame_support::pallet] | ------------------------ required by a bound introduced by this call ... -21 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { +38 | pub fn foo(origin: OriginFor, _bar: T::Bar) -> DispatchResultWithPostInfo { | ^^^^ the trait `WrapperTypeEncode` is not implemented for `::Bar` | = note: required for `::Bar` to implement `Encode` error[E0277]: the trait bound `::Bar: WrapperTypeDecode` is not satisfied - --> tests/pallet_ui/call_argument_invalid_bound_2.rs:17:12 + --> tests/pallet_ui/call_argument_invalid_bound_2.rs:34:12 | -17 | #[pallet::call] +34 | #[pallet::call] | ^^^^ the trait `WrapperTypeDecode` is not implemented for `::Bar` | = note: required for `::Bar` to implement `Decode` diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs index 64b6642b0a8787111de9454ff91c0afaedb1c131..22507b196e46b9df824b2347ccefe14907b2c07a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use codec::{Decode, Encode}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr index 4cbed3709626c0fda8178e637ee02eb9fa0872c4..7429bce050c28bd0d2e9f372ed1c773646ae1acf 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr @@ -4,17 +4,17 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_argument_invalid_bound_3.rs:21:20 + --> tests/pallet_ui/call_argument_invalid_bound_3.rs:38:20 | -21 | #[pallet::weight(0)] +38 | #[pallet::weight(0)] | ^ | = note: `-D deprecated` implied by `-D warnings` error[E0277]: `Bar` doesn't implement `std::fmt::Debug` - --> tests/pallet_ui/call_argument_invalid_bound_3.rs:23:36 + --> tests/pallet_ui/call_argument_invalid_bound_3.rs:40:36 | -23 | pub fn foo(origin: OriginFor, _bar: Bar) -> DispatchResultWithPostInfo { +40 | pub fn foo(origin: OriginFor, _bar: Bar) -> DispatchResultWithPostInfo { | ^^^^ `Bar` cannot be formatted using `{:?}` | = help: the trait `std::fmt::Debug` is not implemented for `Bar` @@ -23,6 +23,6 @@ error[E0277]: `Bar` doesn't implement `std::fmt::Debug` = note: required for the cast from `&Bar` to the object type `dyn std::fmt::Debug` help: consider annotating `Bar` with `#[derive(Debug)]` | -17 + #[derive(Debug)] -18 | struct Bar; +34 + #[derive(Debug)] +35 | struct Bar; | diff --git a/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.rs b/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.rs index 395766c7cd331febcc15ed9a6ea04a0cbaad3693..061f551e54c223b71033533496e6354c12c12f5d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResultWithPostInfo; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.stderr b/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.stderr index 5d0c90609c2a189486fb46043fe79f201ff28a00..99970f3094e16da70c4b69a6e36a346d36b6617c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_conflicting_indices.stderr @@ -1,11 +1,11 @@ error: Call indices are conflicting: Both functions foo and bar are at index 10 - --> tests/pallet_ui/call_conflicting_indices.rs:15:10 + --> tests/pallet_ui/call_conflicting_indices.rs:32:10 | -15 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} +32 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} | ^^^ error: Call indices are conflicting: Both functions foo and bar are at index 10 - --> tests/pallet_ui/call_conflicting_indices.rs:19:10 + --> tests/pallet_ui/call_conflicting_indices.rs:36:10 | -19 | pub fn bar(origin: OriginFor) -> DispatchResultWithPostInfo {} +36 | pub fn bar(origin: OriginFor) -> DispatchResultWithPostInfo {} | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.rs b/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.rs index abe4dc199bf515e08187c192ee95f7afb42e6430..6e45aba406a6b74dd789be4711e9f3d766ef4f05 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResultWithPostInfo; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.stderr b/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.stderr index 2f4cead6cf70c960af51dcd72be7da239522196a..9ee626f2fcc2dcf9e56b0d0587235dde06577356 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_index_has_suffix.stderr @@ -1,5 +1,5 @@ error: Number literal must not have a suffix - --> tests/pallet_ui/call_index_has_suffix.rs:14:30 + --> tests/pallet_ui/call_index_has_suffix.rs:31:30 | -14 | #[pallet::call_index(0something)] +31 | #[pallet::call_index(0something)] | ^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.rs index 118d3c92f360d65d8f2c79171b3d04047ac23ba2..059bea886eb1750150998a20e400e05a71836f0c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResultWithPostInfo; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.stderr index 3f680203a262f73e6803316622c5a104a312b6df..eec5e33ccbd937d370cf379c38f8a4fcecfa526d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_attr.stderr @@ -1,5 +1,5 @@ error: expected `weight` or `call_index` - --> tests/pallet_ui/call_invalid_attr.rs:14:13 + --> tests/pallet_ui/call_invalid_attr.rs:31:13 | -14 | #[pallet::weird_attr] +31 | #[pallet::weird_attr] | ^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.rs index 1a28bc32e65c6eee61fe071561bd9ca9f180c3b5..78de6a433b9bae27dd1dd7b45852addad2f87195 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.stderr index 0acb3e864a51209be716cb573af0cad9e1fceacb..152a1bdc83b22762d4958947b1328523321b18ce 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_const.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, only method accepted - --> $DIR/call_invalid_const.rs:17:3 + --> tests/pallet_ui/call_invalid_const.rs:34:3 | -17 | const Foo: u8 = 3u8; +34 | const Foo: u8 = 3u8; | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.rs index 0b40691ca43a37905c8ed660d70f91f133a7feec..64d1eac20d4bf55cb8ea1e9c3e51325e1cd94c53 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResultWithPostInfo; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.stderr index 1e07a4974bf695eff67167adae5e22307719078a..78656db0ebd72dff6c383df9fc8a4f7d4b289d63 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_index.stderr @@ -1,5 +1,5 @@ error: number too large to fit in target type - --> tests/pallet_ui/call_invalid_index.rs:15:24 + --> tests/pallet_ui/call_invalid_index.rs:32:24 | -15 | #[pallet::call_index(256)] +32 | #[pallet::call_index(256)] | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.rs index 2502506fa6aa4a72a44376784f44c1c1fe1fada2..ee574bbbe58e8cb9a2a05d94e5991a6b7403a528 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.stderr index f17cd9016a6e4b200b2a6fc767e451d5667676f1..99146c0563a98ad9c1b89ad5109849dacdab3cf2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_origin_type.stderr @@ -1,11 +1,11 @@ error: Invalid type: expected `OriginFor` - --> $DIR/call_invalid_origin_type.rs:17:22 + --> tests/pallet_ui/call_invalid_origin_type.rs:34:22 | -17 | pub fn foo(origin: u8) {} +34 | pub fn foo(origin: u8) {} | ^^ error: expected `OriginFor` - --> $DIR/call_invalid_origin_type.rs:17:22 + --> tests/pallet_ui/call_invalid_origin_type.rs:34:22 | -17 | pub fn foo(origin: u8) {} +34 | pub fn foo(origin: u8) {} | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.rs index 1ccdff5d07374d936f426731ab8dc546aa854765..5cce3f5a6da0ff7de7ae27d0639976214f408423 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.stderr index 8803bbba01326b6b33c19eb1fab9fad561ff559b..4752a1be55e6970fed2793ede71914e4b4dd60ff 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_return.stderr @@ -1,5 +1,5 @@ error: expected `DispatchResultWithPostInfo` or `DispatchResult` - --> tests/pallet_ui/call_invalid_return.rs:17:39 + --> tests/pallet_ui/call_invalid_return.rs:34:39 | -17 | pub fn foo(origin: OriginFor) -> ::DispatchResult { todo!() } +34 | pub fn foo(origin: OriginFor) -> ::DispatchResult { todo!() } | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.rs index fe1c5aee453d4474104dcd6a83ff24453c6a9bf6..0f153e47e085dbf2a5131a12426edc4799c6f214 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.stderr index 321828a1ae28ef1645b4fdc2553cc01e900b83b0..eaac9a44df8889b3dc0a32942e38e5d467ce03a6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, dispatchable function must be public: `pub fn` - --> $DIR/call_invalid_vis.rs:20:3 + --> tests/pallet_ui/call_invalid_vis.rs:37:3 | -20 | fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { +37 | fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.rs b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.rs index fb25e9876dc8d89c799933fa583c7f8860be4d16..9f36083ee632727c3aa7dfd8fed1d17867cd97f2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.stderr b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.stderr index 7d3113474af73db528c63ef3801d7438fe5f07c1..24bb848a478716173e8b0feb080c5fa6f9227603 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_invalid_vis_2.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, dispatchable function must be public: `pub fn` - --> $DIR/call_invalid_vis_2.rs:20:3 + --> tests/pallet_ui/call_invalid_vis_2.rs:37:3 | -20 | pub(crate) fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { +37 | pub(crate) fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_missing_index.rs b/substrate/frame/support/test/tests/pallet_ui/call_missing_index.rs index 98c49f493e50d33dc6ff8d96af6da80761070491..a0c5c6ce4d11e89a415ea7c4acdc244c97e085c5 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_missing_index.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_missing_index.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResult; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_missing_index.stderr b/substrate/frame/support/test/tests/pallet_ui/call_missing_index.stderr index 82dbe1d24c28e78aa62d3166418ed92aaf823b89..4d55ef798569bbd6dfa013dec3de081c6bbfa246 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_missing_index.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_missing_index.stderr @@ -5,9 +5,9 @@ error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_0::_w`: For more info see: - --> tests/pallet_ui/call_missing_index.rs:15:10 + --> tests/pallet_ui/call_missing_index.rs:32:10 | -15 | pub fn foo(_: OriginFor) -> DispatchResult { +32 | pub fn foo(_: OriginFor) -> DispatchResult { | ^^^ | = note: `-D deprecated` implied by `-D warnings` @@ -19,9 +19,9 @@ error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_1::_w`: For more info see: - --> tests/pallet_ui/call_missing_index.rs:20:10 + --> tests/pallet_ui/call_missing_index.rs:37:10 | -20 | pub fn bar(_: OriginFor) -> DispatchResult { +37 | pub fn bar(_: OriginFor) -> DispatchResult { | ^^^ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: @@ -30,9 +30,9 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_missing_index.rs:14:20 + --> tests/pallet_ui/call_missing_index.rs:31:20 | -14 | #[pallet::weight(0)] +31 | #[pallet::weight(0)] | ^ error: use of deprecated constant `pallet::warnings::ConstantWeight_1::_w`: @@ -41,7 +41,7 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_1::_w`: For more info see: - --> tests/pallet_ui/call_missing_index.rs:19:20 + --> tests/pallet_ui/call_missing_index.rs:36:20 | -19 | #[pallet::weight(0)] +36 | #[pallet::weight(0)] | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.rs b/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.rs index 4cdb85502b57fbe9fd0fedb8794218ab059cda7b..9845bc012dc9af210fda7b3e96caac6e2207ac98 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.stderr b/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.stderr index 0a6cf16571f95cc92956f6682130e22b61e4e01c..555dd426fe2912bb44c37763b5ac0a83f1853a58 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_missing_weight.stderr @@ -1,7 +1,7 @@ error: A pallet::call requires either a concrete `#[pallet::weight($expr)]` or an inherited weight from the `#[pallet:call(weight($type))]` attribute, but none were given. - --> tests/pallet_ui/call_missing_weight.rs:17:7 + --> tests/pallet_ui/call_missing_weight.rs:34:7 | -17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} +34 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.rs b/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.rs index 5753ecd076c807875c500268877967fa144fca6f..f2b068e0765459ced13e6a9b0d74d92826162b51 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResultWithPostInfo; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.stderr b/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.stderr index ba22b012745c19d82542d339007c4680dfd3cdc3..14af3c7995d70be81ba70939ad3302635a7ee1f9 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_multiple_call_index.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, too many call_index attributes given - --> tests/pallet_ui/call_multiple_call_index.rs:17:7 + --> tests/pallet_ui/call_multiple_call_index.rs:34:7 | -17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} +34 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_no_origin.rs b/substrate/frame/support/test/tests/pallet_ui/call_no_origin.rs index 231c75f43f4ad8b4fccce287273b02a4098369d9..a0c18b873833b327d51279ee8a0538cd7d45a979 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_no_origin.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_no_origin.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_no_origin.stderr b/substrate/frame/support/test/tests/pallet_ui/call_no_origin.stderr index 97574ea1b644c0fe017d25eddd8a96f230492b27..d7aa4ea763fb969fbfa6e051ca94da8cd8e9baf6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_no_origin.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_no_origin.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, must have at least origin arg - --> $DIR/call_no_origin.rs:17:7 + --> tests/pallet_ui/call_no_origin.rs:34:7 | -17 | pub fn foo() {} +34 | pub fn foo() {} | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_no_return.rs b/substrate/frame/support/test/tests/pallet_ui/call_no_return.rs index 68a883c52c0722204b8c7da046a7b9e2a0a3a2d4..87b47c8b4d8f9fff5366737c9bcb37c97a4c6bee 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_no_return.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_no_return.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_no_return.stderr b/substrate/frame/support/test/tests/pallet_ui/call_no_return.stderr index 18ebbaff76d9d6044cffe0accabe5d637379d4c8..e73b4c28e493263a7ef91a6567186b55f3bce2e9 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_no_return.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_no_return.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::call, require return type DispatchResultWithPostInfo - --> $DIR/call_no_return.rs:17:7 + --> tests/pallet_ui/call_no_return.rs:34:7 | -17 | pub fn foo(origin: OriginFor) {} +34 | pub fn foo(origin: OriginFor) {} | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.rs index c122877e8a0757d0244e0ed71f5899032469379a..8584b5f0aacd88640380353cca9c1832dc46034f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResult; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.stderr index 0651f003b9e23f7dccb7d7959ef64b4056f8ca7c..cf23a76f8ea055ce4c4b0e55f228185fc4a2961b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_argument_has_suffix.stderr @@ -1,7 +1,7 @@ error: invalid suffix `something` for number literal - --> tests/pallet_ui/call_weight_argument_has_suffix.rs:15:26 + --> tests/pallet_ui/call_weight_argument_has_suffix.rs:32:26 | -15 | #[pallet::weight(10_000something)] +32 | #[pallet::weight(10_000something)] | ^^^^^^^^^^^^^^^ invalid suffix `something` | = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) @@ -12,9 +12,9 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_weight_argument_has_suffix.rs:15:26 + --> tests/pallet_ui/call_weight_argument_has_suffix.rs:32:26 | -15 | #[pallet::weight(10_000something)] +32 | #[pallet::weight(10_000something)] | ^^^^^^^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.rs index 2e5dc2a649e709f148adfce1ff2d0c3212176cc7..e371c423ea4f60fa944027f90e9caadfb860a50f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResult; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.stderr index b04c3ec395ce67ab5d6616d8f9acc0756fd65faa..ccd5a935773c31d69b0b9043cf3d56d3150c7000 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning.stderr @@ -4,9 +4,9 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_weight_const_warning.rs:15:26 + --> tests/pallet_ui/call_weight_const_warning.rs:32:26 | -15 | #[pallet::weight(123_u64)] +32 | #[pallet::weight(123_u64)] | ^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.rs index 798911dba33d9d466f80ea55131e17131580e2e0..bb880eabcd3b202f0f014b42b4e147698e755e16 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::DispatchResult; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.stderr index c656790207504df0144187a7d00daa23dc6d867e..aadb939b6454f76e042437b2427d5c950dfb3b08 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_const_warning_twice.stderr @@ -1,7 +1,7 @@ error: invalid suffix `custom_prefix` for number literal - --> tests/pallet_ui/call_weight_const_warning_twice.rs:19:26 + --> tests/pallet_ui/call_weight_const_warning_twice.rs:36:26 | -19 | #[pallet::weight(123_custom_prefix)] +36 | #[pallet::weight(123_custom_prefix)] | ^^^^^^^^^^^^^^^^^ invalid suffix `custom_prefix` | = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) @@ -12,9 +12,9 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/call_weight_const_warning_twice.rs:15:26 + --> tests/pallet_ui/call_weight_const_warning_twice.rs:32:26 | -15 | #[pallet::weight(123)] +32 | #[pallet::weight(123)] | ^^^ | = note: `-D deprecated` implied by `-D warnings` @@ -25,7 +25,7 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_1::_w`: For more info see: - --> tests/pallet_ui/call_weight_const_warning_twice.rs:19:26 + --> tests/pallet_ui/call_weight_const_warning_twice.rs:36:26 | -19 | #[pallet::weight(123_custom_prefix)] +36 | #[pallet::weight(123_custom_prefix)] | ^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.rs index ff235e986099f4f91c3e7a029686c8bdf6fda125..f5be788ba36ad4d846c913b123f32cec47987dbb 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::pallet_prelude::*; pub trait WeightInfo { diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.stderr index 7eed646e7b1909ecbddaab8f84bcfe899504e048..6b30716a938b4cd3bc423fe170c346c003dbbcb6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid.stderr @@ -1,11 +1,11 @@ error: expected `weight` - --> tests/pallet_ui/call_weight_inherited_invalid.rs:19:17 + --> tests/pallet_ui/call_weight_inherited_invalid.rs:36:17 | -19 | #[pallet::call(invalid)] +36 | #[pallet::call(invalid)] | ^^^^^^^ error: expected parentheses - --> tests/pallet_ui/call_weight_inherited_invalid.rs:40:17 + --> tests/pallet_ui/call_weight_inherited_invalid.rs:57:17 | -40 | #[pallet::call = invalid] +57 | #[pallet::call = invalid] | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.rs index 76ccf5db220194ff9c27ea38ea1a287162c9b950..771cfb5157251a8b7b5d6a786472ac9e01b222ff 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Weight is an ident instead of a type. use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.stderr index 29f3b6bfd2b0dd942b04f662b45c9a282ffb9616..e84b0b6f3fd2d9d9b0fbd390c84112c3d94dc249 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid2.stderr @@ -1,11 +1,11 @@ error[E0412]: cannot find type `prefix` in this scope - --> tests/pallet_ui/call_weight_inherited_invalid2.rs:22:24 + --> tests/pallet_ui/call_weight_inherited_invalid2.rs:39:24 | -22 | #[pallet::call(weight(prefix))] +39 | #[pallet::call(weight(prefix))] | ^^^^^^ not found in this scope error[E0412]: cannot find type `prefix` in this scope - --> tests/pallet_ui/call_weight_inherited_invalid2.rs:43:26 + --> tests/pallet_ui/call_weight_inherited_invalid2.rs:60:26 | -43 | #[pallet::call(weight = prefix)] +60 | #[pallet::call(weight = prefix)] | ^^^^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.rs index b31bc0ae234b27dbfa60fa254d78c353760f7345..70e57a29184c3812489fe578dccc5553a47d7a9e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Call weight is an LitInt instead of a type. use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.stderr index fab7acb90deafde9a61d7192efae3bcdfeeac597..e8e6f2fe6df06dec235227b06001ab191be4bb46 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid3.stderr @@ -1,19 +1,19 @@ error: expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime - --> tests/pallet_ui/call_weight_inherited_invalid3.rs:22:24 + --> tests/pallet_ui/call_weight_inherited_invalid3.rs:39:24 | -22 | #[pallet::call(weight(123))] +39 | #[pallet::call(weight(123))] | ^^^ error: expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime - --> tests/pallet_ui/call_weight_inherited_invalid3.rs:43:26 + --> tests/pallet_ui/call_weight_inherited_invalid3.rs:60:26 | -43 | #[pallet::call(weight = 123)] +60 | #[pallet::call(weight = 123)] | ^^^ error: unused import: `frame_system::pallet_prelude::*` - --> tests/pallet_ui/call_weight_inherited_invalid3.rs:4:5 - | -4 | use frame_system::pallet_prelude::*; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-imports` implied by `-D warnings` + --> tests/pallet_ui/call_weight_inherited_invalid3.rs:21:5 + | +21 | use frame_system::pallet_prelude::*; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `-D unused-imports` implied by `-D warnings` diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.rs index 39c0929d603ad1f362243c4ededcb6af00bc31ca..c7b312b2f2ef707d4062ac9713db3f1833079058 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Function does not exist in the trait. use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr index fbde5c691c5a08c50a9a5a83b34e1107fc9a2f54..b4c0885507cfd6525ad22196654c842524939d35 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid4.stderr @@ -1,11 +1,11 @@ error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope - --> tests/pallet_ui/call_weight_inherited_invalid4.rs:24:10 + --> tests/pallet_ui/call_weight_inherited_invalid4.rs:41:10 | -24 | pub fn foo(_: OriginFor) -> DispatchResult { +41 | pub fn foo(_: OriginFor) -> DispatchResult { | ^^^ function or associated item not found in `::WeightInfo` error[E0599]: no function or associated item named `foo` found for associated type `::WeightInfo` in the current scope - --> tests/pallet_ui/call_weight_inherited_invalid4.rs:45:10 + --> tests/pallet_ui/call_weight_inherited_invalid4.rs:62:10 | -45 | pub fn foo(_: OriginFor) -> DispatchResult { +62 | pub fn foo(_: OriginFor) -> DispatchResult { | ^^^ function or associated item not found in `::WeightInfo` diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.rs b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.rs index a5b2f5c7f6aa6ad32b5ab872cdcbe3004983f848..dc6c43fb7a20ff63c8e43c84f78b2244caaed1be 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Stray tokens after good input. #[frame_support::pallet] diff --git a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.stderr b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.stderr index c0e9ef2d9e9d82dc4d7889fc8d27a85ee4c9cddd..e12fbfcf4b48ce82fcc0863878158f707a22d130 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_weight_inherited_invalid5.stderr @@ -1,11 +1,11 @@ error: unexpected token - --> tests/pallet_ui/call_weight_inherited_invalid5.rs:14:50 + --> tests/pallet_ui/call_weight_inherited_invalid5.rs:31:50 | -14 | #[pallet::call(weight(::WeightInfo straycat))] +31 | #[pallet::call(weight(::WeightInfo straycat))] | ^^^^^^^^ error: unexpected token - --> tests/pallet_ui/call_weight_inherited_invalid5.rs:34:52 + --> tests/pallet_ui/call_weight_inherited_invalid5.rs:51:52 | -34 | #[pallet::call(weight = ::WeightInfo straycat)] +51 | #[pallet::call(weight = ::WeightInfo straycat)] | ^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.rs b/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.rs index e417c619fc45f3c623668bb15766c5ba49d0e3df..840a6dee20ccc7a836619a1ef334cca6e22e7887 100644 --- a/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.rs +++ b/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.stderr b/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.stderr index e75aa5226153886f2e8b7c91f05b430fa9c8c5ff..1b48197cc9ed1049ea0f52bb011fbc95654c59c0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/compare_unset_storage_version.stderr @@ -1,7 +1,7 @@ error[E0369]: binary operation `!=` cannot be applied to type `NoStorageVersionSet` - --> tests/pallet_ui/compare_unset_storage_version.rs:15:39 + --> tests/pallet_ui/compare_unset_storage_version.rs:32:39 | -15 | if Self::current_storage_version() != Self::on_chain_storage_version() { +32 | if Self::current_storage_version() != Self::on_chain_storage_version() { | ------------------------------- ^^ -------------------------------- StorageVersion | | | NoStorageVersionSet diff --git a/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.rs b/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.rs index 74692ee94efd24d7662ad9020493dd1ded50b913..ca755ff9c2ba9a1c4b1c1300e9ce086a5d021743 100644 --- a/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.rs +++ b/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.stderr b/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.stderr index 902e8923759b2226d296272b81c559eaccfa41c6..cdc8f623142b16118d23d87165ea80562dd79900 100644 --- a/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/composite_enum_unsupported_identifier.stderr @@ -1,5 +1,5 @@ error: expected one of: `FreezeReason`, `HoldReason`, `LockId`, `SlashReason` - --> tests/pallet_ui/composite_enum_unsupported_identifier.rs:10:11 + --> tests/pallet_ui/composite_enum_unsupported_identifier.rs:27:11 | -10 | pub enum HoldReasons {} +27 | pub enum HoldReasons {} | ^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.rs b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.rs index 026b74c914a136cb73466d5b5926307ce1d3c8d0..aeee038fb0dcb03c591952b53264ee27af35cc73 100644 --- a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.rs +++ b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr index 17d818113567439a60ed7db1167c6ff9c954d5f9..a86fd96ea28dcd1e9926dde8e64fe645ca3748e0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/default_config_with_no_default_in_system.stderr @@ -1,5 +1,5 @@ error[E0220]: associated type `Block` not found for `Self` - --> tests/pallet_ui/default_config_with_no_default_in_system.rs:8:31 - | -8 | type MyGetParam2: Get; - | ^^^^^ there is a similarly named associated type `Block` in the trait `frame_system::Config` + --> tests/pallet_ui/default_config_with_no_default_in_system.rs:25:31 + | +25 | type MyGetParam2: Get; + | ^^^^^ there is a similarly named associated type `Block` in the trait `frame_system::Config` diff --git a/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.rs b/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.rs index 0799a3fce8d58bc5beeb1ba8020204d239eccb2a..72ad7896dfec572014cb6b10dcc39bc417a275b6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr index 5d2734b4db601f4e1bf3035536e766ba33f283ef..942db0ab4699f779f8ec83b5e932a818483fe508 100644 --- a/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr @@ -1,9 +1,9 @@ error: use of deprecated struct `pallet::_::Store`: Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023. Check https://github.com/paritytech/substrate/pull/13535 for more details. - --> tests/pallet_ui/deprecated_store_attr.rs:7:3 - | -7 | #[pallet::generate_store(trait Store)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D deprecated` implied by `-D warnings` + --> tests/pallet_ui/deprecated_store_attr.rs:24:3 + | +24 | #[pallet::generate_store(trait Store)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `-D deprecated` implied by `-D warnings` diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.rs b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.rs index 2a413eea9b4aac70f299bac1c853dd43900abdb9..b75b9729d0e6f30960cb83cc04da7b09a900434a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.rs +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] #[frame_support::pallet] diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.stderr b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.stderr index 1e2011b2a30cfce1d33689c9206d7cbdffb6fe40..5aea7d83a61cacd20c3c7e24152a0cd4e4602752 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg.stderr @@ -1,7 +1,7 @@ error: A pallet::call requires either a concrete `#[pallet::weight($expr)]` or an inherited weight from the `#[pallet:call(weight($type))]` attribute, but none were given. - --> tests/pallet_ui/dev_mode_without_arg.rs:22:7 + --> tests/pallet_ui/dev_mode_without_arg.rs:39:7 | -22 | pub fn my_call(_origin: OriginFor) -> DispatchResult { +39 | pub fn my_call(_origin: OriginFor) -> DispatchResult { | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.rs b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.rs index 1920b6799de25f9f5e8a9fb7cb19d8ae1a38738c..06c657f2e357b93644bea9dd62b5be0ce4f69734 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.rs +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.stderr b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.stderr index b75edff1ab5f3b1e633e7472445f19d678b70f8e..bcfe43d008f8c43045a90f45cdd27ae031a4e12a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.stderr @@ -5,9 +5,9 @@ error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_0::_w`: For more info see: - --> tests/pallet_ui/dev_mode_without_arg_call_index.rs:22:10 + --> tests/pallet_ui/dev_mode_without_arg_call_index.rs:39:10 | -22 | pub fn my_call(_origin: OriginFor) -> DispatchResult { +39 | pub fn my_call(_origin: OriginFor) -> DispatchResult { | ^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` @@ -18,7 +18,7 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/dev_mode_without_arg_call_index.rs:21:20 + --> tests/pallet_ui/dev_mode_without_arg_call_index.rs:38:20 | -21 | #[pallet::weight(0)] +38 | #[pallet::weight(0)] | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.rs b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.rs index fb1139479566affb94bb2ddf6d326f20cf269238..60945cabc47402f98a1d57c95cf556c1847db732 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.rs +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.stderr b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.stderr index e0dbc8c953b4e9054371eddfb4871f6b77daa240..81d0257ca6c675aa9401faca48ed44dfb53397d6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.stderr @@ -1,11 +1,11 @@ error: `_` can only be used in dev_mode. Please specify an appropriate hasher. - --> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:21:47 + --> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:38:47 | -21 | type MyStorageMap = StorageMap<_, _, u32, u64>; +38 | type MyStorageMap = StorageMap<_, _, u32, u64>; | ^ error[E0432]: unresolved import `pallet` - --> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:3:9 - | -3 | pub use pallet::*; - | ^^^^^^ help: a similar path exists: `test_pallet::pallet` + --> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:20:9 + | +20 | pub use pallet::*; + | ^^^^^^ help: a similar path exists: `test_pallet::pallet` diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs index f6efcc3fc3d7240a48857c3b046bfe582dc56571..092e06b08e3e04efa97d13a6f5b030a7616f4496 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.stderr b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.stderr index cf502ac5be475e31f3ea1184138d0af5b93da678..74ee0e4aeba5cc359174c8aa017d77c6a26a0e29 100644 --- a/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/dev_mode_without_arg_max_encoded_len.stderr @@ -5,9 +5,9 @@ error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_0::_w`: For more info see: - --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:25:10 + --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:42:10 | -25 | pub fn my_call(_origin: OriginFor) -> DispatchResult { +42 | pub fn my_call(_origin: OriginFor) -> DispatchResult { | ^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` @@ -18,15 +18,15 @@ error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: For more info see: - --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:24:20 + --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:41:20 | -24 | #[pallet::weight(0)] +41 | #[pallet::weight(0)] | ^ error[E0277]: the trait bound `Vec: MaxEncodedLen` is not satisfied - --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:11:12 + --> tests/pallet_ui/dev_mode_without_arg_max_encoded_len.rs:28:12 | -11 | #[pallet::pallet] +28 | #[pallet::pallet] | ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Vec` | = help: the following other types implement trait `MaxEncodedLen`: diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.rs b/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.rs index 6d781a19e6742cdc814353f9467afa257177ad83..76a64842105f61e8eec4a8801a7fdfc345bd10d8 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.stderr index 2b03f410243511a37764220493f7281dfae2ccb3..fcaa576f8c5689d401d369b3c41bce909339ba2d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_call_attr.stderr @@ -1,5 +1,5 @@ error: Invalid duplicated attribute - --> $DIR/duplicate_call_attr.rs:22:12 + --> tests/pallet_ui/duplicate_call_attr.rs:39:12 | -22 | #[pallet::call] +39 | #[pallet::call] | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.rs b/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.rs index 543c15bd06905fc40f427410413b5b5e815846ee..d649ae300b49a91a2253bd1781e936452e13ad71 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.rs +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.stderr b/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.stderr index 75297dc5a7f79f36a7d897fdb2743c47023dec4b..1e046d85f7bef1649435f336a1c4f1a73570b5d3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_storage_prefix.stderr @@ -1,47 +1,47 @@ error: Duplicate storage prefixes found for `Foo` - --> $DIR/duplicate_storage_prefix.rs:15:29 + --> tests/pallet_ui/duplicate_storage_prefix.rs:32:29 | -15 | #[pallet::storage_prefix = "Foo"] +32 | #[pallet::storage_prefix = "Foo"] | ^^^^^ error: Duplicate storage prefixes found for `Foo` - --> $DIR/duplicate_storage_prefix.rs:12:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:29:7 | -12 | type Foo = StorageValue<_, u8>; +29 | type Foo = StorageValue<_, u8>; | ^^^ error: Duplicate storage prefixes found for `CounterForBar`, used for counter associated to counted storage map - --> $DIR/duplicate_storage_prefix.rs:22:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:39:7 | -22 | type Bar = CountedStorageMap<_, Twox64Concat, u16, u16>; +39 | type Bar = CountedStorageMap<_, Twox64Concat, u16, u16>; | ^^^ error: Duplicate storage prefixes found for `CounterForBar` - --> $DIR/duplicate_storage_prefix.rs:19:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:36:7 | -19 | type CounterForBar = StorageValue<_, u16>; +36 | type CounterForBar = StorageValue<_, u16>; | ^^^^^^^^^^^^^ error[E0412]: cannot find type `_GeneratedPrefixForStorageFoo` in this scope - --> $DIR/duplicate_storage_prefix.rs:12:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:29:7 | -12 | type Foo = StorageValue<_, u8>; +29 | type Foo = StorageValue<_, u8>; | ^^^ not found in this scope error[E0412]: cannot find type `_GeneratedPrefixForStorageNotFoo` in this scope - --> $DIR/duplicate_storage_prefix.rs:16:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:33:7 | -16 | type NotFoo = StorageValue<_, u16>; +33 | type NotFoo = StorageValue<_, u16>; | ^^^^^^ not found in this scope error[E0412]: cannot find type `_GeneratedPrefixForStorageCounterForBar` in this scope - --> $DIR/duplicate_storage_prefix.rs:19:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:36:7 | -19 | type CounterForBar = StorageValue<_, u16>; +36 | type CounterForBar = StorageValue<_, u16>; | ^^^^^^^^^^^^^ not found in this scope error[E0412]: cannot find type `_GeneratedPrefixForStorageBar` in this scope - --> $DIR/duplicate_storage_prefix.rs:22:7 + --> tests/pallet_ui/duplicate_storage_prefix.rs:39:7 | -22 | type Bar = CountedStorageMap<_, Twox64Concat, u16, u16>; +39 | type Bar = CountedStorageMap<_, Twox64Concat, u16, u16>; | ^^^ not found in this scope diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.rs b/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.rs index ab318034aca054564964cfcd3356719bbe8142f0..334fd8a46af2e14ef175acfbbdbc6a895b890595 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr index 1c13ee17eb75105701f330e0dd4c8ce0685abfe7..864b399326e19ea96afa8d76ccf9815b057ceef6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr @@ -1,5 +1,5 @@ error: Unexpected duplicated attribute - --> tests/pallet_ui/duplicate_store_attr.rs:12:3 + --> tests/pallet_ui/duplicate_store_attr.rs:29:3 | -12 | #[pallet::generate_store(trait Store)] +29 | #[pallet::generate_store(trait Store)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs index 254d65866774fee7efba978b2479d7f1bc9b4621..2e92f5358eabc368fe01b517b3c90274869a079e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs +++ b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr index 7edb55a62d401a3c43dd3d589482ae9f1c94122d..cfa0d465990a242f2c2ca2f65377b50d9e5c20bd 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `MyError: PalletError` is not satisfied - --> tests/pallet_ui/error_does_not_derive_pallet_error.rs:1:1 - | -1 | #[frame_support::pallet] - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PalletError` is not implemented for `MyError` - | - = help: the following other types implement trait `PalletError`: - () - (TupleElement0, TupleElement1) - (TupleElement0, TupleElement1, TupleElement2) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) - and 36 others - = note: this error originates in the derive macro `frame_support::PalletError` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/pallet_ui/error_does_not_derive_pallet_error.rs:18:1 + | +18 | #[frame_support::pallet] + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PalletError` is not implemented for `MyError` + | + = help: the following other types implement trait `PalletError`: + () + (TupleElement0, TupleElement1) + (TupleElement0, TupleElement1, TupleElement2) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) + and $N others + = note: this error originates in the derive macro `frame_support::PalletError` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/pallet_ui/error_where_clause.rs b/substrate/frame/support/test/tests/pallet_ui/error_where_clause.rs index 29d7435bc4bc850b8642c2912f79b1997d42c81c..32e74b940a2b21716cad74cd764c6c1ef859f43f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_where_clause.rs +++ b/substrate/frame/support/test/tests/pallet_ui/error_where_clause.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/error_where_clause.stderr b/substrate/frame/support/test/tests/pallet_ui/error_where_clause.stderr index 8e9d0e60692d8af48d8b9fbc8c7403428c4e7ca5..f9bcb61786b0011152a4a4d20ba59650ac4c633b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_where_clause.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/error_where_clause.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::error, where clause is not allowed on pallet error item - --> $DIR/error_where_clause.rs:19:20 + --> tests/pallet_ui/error_where_clause.rs:36:20 | -19 | pub enum Error where u32: From {} +36 | pub enum Error where u32: From {} | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.rs b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.rs index 50e66dc8c0dce0bb0da8137f2652855540820f9f..fce7267224d09b74f331f9858330d97d28442132 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.stderr b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.stderr index 8c0496782fb168e7392aac73ae49b0ef3c5a2e66..cbaac7b5d4fcc1021a8cc629857120164df64b72 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::error, expected item enum - --> $DIR/error_wrong_item.rs:19:2 + --> tests/pallet_ui/error_wrong_item.rs:36:2 | -19 | pub struct Foo; +36 | pub struct Foo; | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.rs b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.rs index 14107fafb06eaf6591218c33c367b701d99e468a..ba4d43955af53d24a6a178a77adbad7fdc06337d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.rs +++ b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.stderr b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.stderr index d7e54ad8a75163097bd9253456544788ef2525a3..784ae4631af0956ed4edf52d210c165328669c37 100644 --- a/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/error_wrong_item_name.stderr @@ -1,5 +1,5 @@ error: expected `Error` - --> $DIR/error_wrong_item_name.rs:19:11 + --> tests/pallet_ui/error_wrong_item_name.rs:36:11 | -19 | pub enum Foo {} +36 | pub enum Foo {} | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs index 2b45a971788fb9b6b5ed11e5b184527b59729f93..a7e6d213318fb5e0fc00d5062f7561db9c0cf4fc 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, IsType}; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr index 1161f4a190231eb17eb23db90e9d76e09b0f867c..4df6deafa0df667a4299f348eb90c12ae860ae06 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_field_not_member.stderr @@ -1,19 +1,19 @@ error[E0277]: the trait bound `::Bar: Clone` is not satisfied - --> tests/pallet_ui/event_field_not_member.rs:23:7 + --> tests/pallet_ui/event_field_not_member.rs:40:7 | -23 | B { b: T::Bar }, +40 | B { b: T::Bar }, | ^ the trait `Clone` is not implemented for `::Bar` error[E0369]: binary operation `==` cannot be applied to type `&::Bar` - --> tests/pallet_ui/event_field_not_member.rs:23:7 + --> tests/pallet_ui/event_field_not_member.rs:40:7 | -23 | B { b: T::Bar }, +40 | B { b: T::Bar }, | ^ error[E0277]: `::Bar` doesn't implement `std::fmt::Debug` - --> tests/pallet_ui/event_field_not_member.rs:23:7 + --> tests/pallet_ui/event_field_not_member.rs:40:7 | -23 | B { b: T::Bar }, +40 | B { b: T::Bar }, | ^ `::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `::Bar` diff --git a/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.rs b/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.rs index 94151ba4c3d9d7efbc901eec9d7a5f84c058ee81..405faeb6de0505c3572af72ed6692576b62d2ff4 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.stderr b/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.stderr index 2eda72eb5f72f86851af25ee2c26251a93e4ec77..eef17ffab4fef6f7d34302c0914cb17766c8e684 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_not_in_trait.stderr @@ -1,7 +1,7 @@ error: Invalid usage of RuntimeEvent, `Config` contains no associated type `RuntimeEvent`, but enum `Event` is declared (in use of `#[pallet::event]`). An RuntimeEvent associated type must be declare on trait `Config`. - --> $DIR/event_not_in_trait.rs:1:1 - | -1 | #[frame_support::pallet] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/pallet_ui/event_not_in_trait.rs:18:1 + | +18 | #[frame_support::pallet] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.rs b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.rs index a02cc9b9de883e2204b22a413969e217c4a00d49..665d2a984cf04801ef4c3c3712e053a075c1ae07 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.stderr b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.stderr index d54149d719a3bfc8cfa335992faaf2bae6bef8c1..e9e4c1269f29ded8534b5ea79a7f3bd3589a7e35 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound.stderr @@ -1,5 +1,5 @@ error: Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must bound: `IsType<::RuntimeEvent>` - --> $DIR/event_type_invalid_bound.rs:9:3 - | -9 | type RuntimeEvent; - | ^^^^ + --> tests/pallet_ui/event_type_invalid_bound.rs:26:3 + | +26 | type RuntimeEvent; + | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.rs b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.rs index 99df89d67278ce786c094a48404aed3c5a52b2dd..23d5a3b449ec8c2cba07e8f8e504f7719a298537 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, IsType}; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.stderr b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.stderr index ea8b2ff000cebf66408e06de26d48126dfc804a1..436a8651bb80d671985095130287ba612d225b29 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.stderr @@ -1,5 +1,5 @@ error: Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must bound: `From` or `From>` or `From>` - --> $DIR/event_type_invalid_bound_2.rs:9:3 - | -9 | type RuntimeEvent: IsType<::RuntimeEvent>; - | ^^^^ + --> tests/pallet_ui/event_type_invalid_bound_2.rs:26:3 + | +26 | type RuntimeEvent: IsType<::RuntimeEvent>; + | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.rs b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.rs index d6690557c39d85445f8f93d2f2b0cf7094015c84..4b4654cf59075efaf17f5b68fc2cab485890d262 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.stderr b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.stderr index 0ef150dfd62e1a3a7ba40b44d3829c99cf09eb0f..155391f11edf3da7fe97cad64798fed40fd85c7a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::event, expected enum item - --> $DIR/event_wrong_item.rs:19:2 + --> tests/pallet_ui/event_wrong_item.rs:36:2 | -19 | pub struct Foo; +36 | pub struct Foo; | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.rs b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.rs index d828965c5173c548c9bee3b0e6d36225241c7135..3588760c3bfdacc11c9e1e26c6bf5660848d6dad 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.rs +++ b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.stderr b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.stderr index 14e8615c5619950efd4807a9fa589ba110cb978a..b70e560e69a0c6892cb443c45240aeb7b400311a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/event_wrong_item_name.stderr @@ -1,5 +1,5 @@ error: expected `Event` - --> $DIR/event_wrong_item_name.rs:19:11 + --> tests/pallet_ui/event_wrong_item_name.rs:36:11 | -19 | pub enum Foo {} +36 | pub enum Foo {} | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.rs b/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.rs deleted file mode 100644 index a4a0eb832c9c0a8de91a76682dbbb54dcd1e4e1e..0000000000000000000000000000000000000000 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.rs +++ /dev/null @@ -1,26 +0,0 @@ -#[frame_support::pallet] -mod pallet { - use frame_support::pallet_prelude::{BuildGenesisConfig, Hooks}; - use frame_system::pallet_prelude::BlockNumberFor; - - #[pallet::config] - pub trait Config: frame_system::Config {} - - #[pallet::pallet] - pub struct Pallet(core::marker::PhantomData); - - #[pallet::hooks] - impl Hooks> for Pallet {} - - #[pallet::call] - impl Pallet {} - - #[pallet::genesis_config] - pub struct GenesisConfig; - - #[pallet::genesis_build] - impl BuildGenesisConfig for GenesisConfig {} -} - -fn main() { -} diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.stderr b/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.stderr deleted file mode 100644 index 67cbe80be0da37c7d8d177e85b55aea4d8928663..0000000000000000000000000000000000000000 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the trait bound `pallet::GenesisConfig: std::default::Default` is not satisfied - --> tests/pallet_ui/genesis_default_not_satisfied.rs:22:30 - | -22 | impl BuildGenesisConfig for GenesisConfig {} - | ^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `pallet::GenesisConfig` - | -note: required by a bound in `BuildGenesisConfig` - --> $WORKSPACE/substrate/frame/support/src/traits/hooks.rs - | - | pub trait BuildGenesisConfig: Default + sp_runtime::traits::MaybeSerializeDeserialize { - | ^^^^^^^ required by this bound in `BuildGenesisConfig` -help: consider annotating `pallet::GenesisConfig` with `#[derive(Default)]` - | -19 + #[derive(Default)] -20 | pub struct GenesisConfig; - | diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.rs b/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.rs index 9ae851005acb3b7cf24846a6c4d455d90f30064e..b55620329a6a89ff7db7a4c393d181fd0eaaabaf 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.rs +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.stderr b/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.stderr index 9afc1037a48ae3c27f4221ac46c4da0952dcbded..d515547ec3a0695b56db1f6be6cbf9f5e28cb13a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.stderr @@ -1,5 +1,5 @@ error: `#[pallet::genesis_config]` and `#[pallet::genesis_build]` attributes must be either both used or both not used, instead genesis_config is unused and genesis_build is used - --> $DIR/genesis_inconsistent_build_config.rs:2:1 - | -2 | mod pallet { - | ^^^ + --> tests/pallet_ui/genesis_inconsistent_build_config.rs:19:1 + | +19 | mod pallet { + | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.rs b/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.rs index f1eae16f496009a1df92a252b793982972a96d9d..b65216f1e6b6d019b4d8a42d7131fa6e9469c758 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.rs +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.stderr b/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.stderr index f57b4a61c80c5bb7ddcd8a0f6e25d028d0c2fc18..e3dd0b7aa1d3434f873240154758bf73a59adf25 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_invalid_generic.stderr @@ -1,13 +1,13 @@ error: Invalid genesis builder: expected `GenesisBuild` or `GenesisBuild` - --> $DIR/genesis_invalid_generic.rs:19:7 + --> tests/pallet_ui/genesis_invalid_generic.rs:36:7 | -19 | impl GenesisBuild for GenesisConfig {} +36 | impl GenesisBuild for GenesisConfig {} | ^^^^^^^^^^^^ error: expected `<` - --> $DIR/genesis_invalid_generic.rs:1:1 - | -1 | #[frame_support::pallet] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/pallet_ui/genesis_invalid_generic.rs:18:1 + | +18 | #[frame_support::pallet] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.rs b/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.rs index 5e8b297ba4ccfbd8653181506fbaaf374a6dba55..d04465321f509e8e35ce5b38645fa4bcd8bcdc50 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.rs +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.stderr b/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.stderr index dd2e65588f56b62f22322547f3e161a9e97ac8b6..4d1c09ec5edf5bc51a75b2bdb3f1f6c15f11dafd 100644 --- a/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/genesis_wrong_name.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::genesis_build, expected impl<..> GenesisBuild<..> for GenesisConfig<..> - --> $DIR/genesis_wrong_name.rs:19:2 + --> tests/pallet_ui/genesis_wrong_name.rs:36:2 | -19 | impl Foo {} +36 | impl Foo {} | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.rs b/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.rs index 8008c465e61ad0f80192f4c920a2024e28cbb066..45ec8f334f223e030c693e3f261d634cd901b46c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.rs +++ b/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.stderr b/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.stderr index 7d86b8d4f1bd52bf283fcd889f6acc5998d65f2e..45351f368796f3eaf48f5cf5d365fa1313409d54 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/hold_reason_non_enum.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::composite_enum, expected enum item - --> tests/pallet_ui/hold_reason_non_enum.rs:10:2 + --> tests/pallet_ui/hold_reason_non_enum.rs:27:2 | -10 | pub struct HoldReason; +27 | pub struct HoldReason; | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.rs b/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.rs index 626dad74113194f86520f93bcfff1c18d83638e7..5c6e7415436256236195d7c5c7c468adf8b59fb3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.rs +++ b/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.stderr b/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.stderr index e8b0c14e967dd1f4b31564dae27e1f5d1c2b4dbc..75834ad8b899ea567239e041bb7534252a8981ef 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/hold_reason_not_pub.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::composite_enum, `HoldReason` must be public - --> tests/pallet_ui/hold_reason_not_pub.rs:10:5 + --> tests/pallet_ui/hold_reason_not_pub.rs:27:5 | -10 | enum HoldReason {} +27 | enum HoldReason {} | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.rs b/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.rs index 7c66b3e6cecc1f45ca75d99afa770e1baaec2e8d..2b317b4b325e628fbd64d75432c13deaf969973c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.stderr b/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.stderr index d0af35197f1d689cf38a455e85cc1f3b18c80dd3..b7327943ee20e66433326e7922a50919c530ef7c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/hooks_invalid_item.stderr @@ -1,7 +1,7 @@ error[E0107]: missing generics for trait `Hooks` - --> tests/pallet_ui/hooks_invalid_item.rs:12:18 + --> tests/pallet_ui/hooks_invalid_item.rs:29:18 | -12 | impl Hooks for Pallet {} +29 | impl Hooks for Pallet {} | ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `BlockNumber` @@ -11,5 +11,5 @@ note: trait defined here, with 1 generic parameter: `BlockNumber` | ^^^^^ ----------- help: add missing generic argument | -12 | impl Hooks for Pallet {} +29 | impl Hooks for Pallet {} | +++++++++++++ diff --git a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.rs b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.rs index 00b57a01235c37a851bb7889afb519d9bb2cbefb..4dc3e9bc745b272352efef47168c32b7a8fc9d9b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.rs +++ b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.stderr b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.stderr index 06c7941a0bcb99ddc7512abce6ebf697b0d1f825..89f0be401ab2fbbf1c13326fa8fd00b34534e40a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_1.stderr @@ -1,29 +1,29 @@ error: Invalid generic declaration, trait is defined with instance but generic use none - --> $DIR/inconsistent_instance_1.rs:10:20 + --> tests/pallet_ui/inconsistent_instance_1.rs:27:20 | -10 | pub struct Pallet(core::marker::PhantomData); +27 | pub struct Pallet(core::marker::PhantomData); | ^ error: Invalid generic declaration, trait is defined with instance but generic use none - --> $DIR/inconsistent_instance_1.rs:16:7 + --> tests/pallet_ui/inconsistent_instance_1.rs:33:7 | -16 | impl Pallet {} +33 | impl Pallet {} | ^ error: Invalid generic declaration, trait is defined with instance but generic use none - --> $DIR/inconsistent_instance_1.rs:16:18 + --> tests/pallet_ui/inconsistent_instance_1.rs:33:18 | -16 | impl Pallet {} +33 | impl Pallet {} | ^^^^^^ error: Invalid generic declaration, trait is defined with instance but generic use none - --> $DIR/inconsistent_instance_1.rs:13:47 + --> tests/pallet_ui/inconsistent_instance_1.rs:30:47 | -13 | impl Hooks> for Pallet {} +30 | impl Hooks> for Pallet {} | ^^^^^^ error: Invalid generic declaration, trait is defined with instance but generic use none - --> $DIR/inconsistent_instance_1.rs:13:7 + --> tests/pallet_ui/inconsistent_instance_1.rs:30:7 | -13 | impl Hooks> for Pallet {} +30 | impl Hooks> for Pallet {} | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.rs b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.rs index e7b51cb5ebef51975792de25686f01711ab55ac8..e05ff6cd5ed455de993c4ec9d74a03480c9f0bd8 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.stderr b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.stderr index 9d61f2976b75a273e0dc11c7c0824e830e354aa9..703f5396b8ae204b9ac292ee3037b9d8c20dd8ee 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/inconsistent_instance_2.stderr @@ -1,29 +1,29 @@ error: Invalid generic declaration, trait is defined without instance but generic use some - --> $DIR/inconsistent_instance_2.rs:10:20 + --> tests/pallet_ui/inconsistent_instance_2.rs:27:20 | -10 | pub struct Pallet(core::marker::PhantomData<(T, I)>); +27 | pub struct Pallet(core::marker::PhantomData<(T, I)>); | ^ error: Invalid generic declaration, trait is defined without instance but generic use some - --> $DIR/inconsistent_instance_2.rs:16:7 + --> tests/pallet_ui/inconsistent_instance_2.rs:33:7 | -16 | impl, I: 'static> Pallet {} +33 | impl, I: 'static> Pallet {} | ^ error: Invalid generic declaration, trait is defined without instance but generic use some - --> $DIR/inconsistent_instance_2.rs:16:33 + --> tests/pallet_ui/inconsistent_instance_2.rs:33:33 | -16 | impl, I: 'static> Pallet {} +33 | impl, I: 'static> Pallet {} | ^^^^^^ error: Invalid generic declaration, trait is defined without instance but generic use some - --> $DIR/inconsistent_instance_2.rs:13:62 + --> tests/pallet_ui/inconsistent_instance_2.rs:30:62 | -13 | impl, I: 'static> Hooks> for Pallet {} +30 | impl, I: 'static> Hooks> for Pallet {} | ^^^^^^ error: Invalid generic declaration, trait is defined without instance but generic use some - --> $DIR/inconsistent_instance_2.rs:13:7 + --> tests/pallet_ui/inconsistent_instance_2.rs:30:7 | -13 | impl, I: 'static> Hooks> for Pallet {} +30 | impl, I: 'static> Hooks> for Pallet {} | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.rs b/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.rs index 9704a7e1a442e19771437906b6ef2a2fbf619bb0..1bb92eaf9e8de2e3c7432298d68cca3c6a4f47d2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.rs +++ b/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, ProvideInherent}; diff --git a/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.stderr b/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.stderr index bc34c55241a7649d898be6266e6058f49cc7943a..3a26d1c0495418658df96cd902f263155cc4fd45 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/inherent_check_inner_span.stderr @@ -1,7 +1,7 @@ error[E0046]: not all trait items implemented, missing: `Call`, `Error`, `INHERENT_IDENTIFIER`, `create_inherent`, `is_inherent` - --> $DIR/inherent_check_inner_span.rs:19:2 + --> tests/pallet_ui/inherent_check_inner_span.rs:36:2 | -19 | impl ProvideInherent for Pallet {} +36 | impl ProvideInherent for Pallet {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Call`, `Error`, `INHERENT_IDENTIFIER`, `create_inherent`, `is_inherent` in implementation | = help: implement the missing item: `type Call = Type;` diff --git a/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.rs b/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.rs index 97eda447213074c3012658194f701d869ec351bd..f497ddeb6f0e1b4677474b9467457a4a05f57c0e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.stderr b/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.stderr index b62b1234bdeb01b2c4d6de8b74ddca24544be24d..efafdf8c4f161c5e13e550babb0b5eeffb7342c5 100644 --- a/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/inherent_invalid_item.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::inherent, expected impl<..> ProvideInherent for Pallet<..> - --> $DIR/inherent_invalid_item.rs:19:2 + --> tests/pallet_ui/inherent_invalid_item.rs:36:2 | -19 | impl Foo {} +36 | impl Foo {} | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.rs b/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.rs index 70418efc41421a793c79b1a784829159153a70fd..f350b37a49954d3cad66ae43a3cf471c6785ecb3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.rs +++ b/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.stderr b/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.stderr index 1b7097d0a1095fa9abebe3876d6802f55a9a6804..d298afa341bd44282ef86f02edbec42034ae0f0e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/lock_id_duplicate.stderr @@ -1,5 +1,5 @@ error: Invalid duplicated `LockId` definition - --> tests/pallet_ui/lock_id_duplicate.rs:13:14 + --> tests/pallet_ui/lock_id_duplicate.rs:30:14 | -13 | pub enum LockId {} +30 | pub enum LockId {} | ^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.rs b/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.rs index c74c7f5ef2a2b65b98225eace8b5454207fa142b..abe356edd5fb7027f1931b3a1a4a6875b998bf74 100644 --- a/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.rs +++ b/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod foo; diff --git a/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.stderr b/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.stderr index 9ad93939d8c00f1a956fcd21283d2125a529105e..b9ce5789fd43a93756bf6eaad269613884adf609 100644 --- a/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/mod_not_inlined.stderr @@ -1,13 +1,13 @@ error[E0658]: non-inline modules in proc macro input are unstable - --> $DIR/mod_not_inlined.rs:2:1 - | -2 | mod foo; - | ^^^^^^^^ - | - = note: see issue #54727 for more information + --> tests/pallet_ui/mod_not_inlined.rs:19:1 + | +19 | mod foo; + | ^^^^^^^^ + | + = note: see issue #54727 for more information error: Invalid pallet definition, expected mod to be inlined. - --> $DIR/mod_not_inlined.rs:2:1 - | -2 | mod foo; - | ^^^ + --> tests/pallet_ui/mod_not_inlined.rs:19:1 + | +19 | mod foo; + | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.rs b/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.rs index 123d79141749876ef0bb66b4685ead35b5ad9237..5892940a4cdf8de68c40a5a496795391b8aaac6f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.rs +++ b/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.stderr b/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.stderr index cbed14bca2cd4a86737608bde1cd9504ff647e9a..6e2bc2a74094b93be114c01f8f56fbcadf7cd85b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/no_default_bounds_but_missing_with_default.stderr @@ -1,5 +1,5 @@ error: `#[pallet:no_default_bounds]` can only be used if `#[pallet::config(with_default)]` has been specified - --> tests/pallet_ui/no_default_bounds_but_missing_with_default.rs:9:4 - | -9 | #[pallet::no_default_bounds] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> tests/pallet_ui/no_default_bounds_but_missing_with_default.rs:26:4 + | +26 | #[pallet::no_default_bounds] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.rs b/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.rs index 5ffa13c22243dacd19c7b04f0bebce11364d2d53..292cb367d0961631f71ef2365be259c9a4ef06eb 100644 --- a/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.rs +++ b/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.stderr b/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.stderr index aebde115eb80e14551da03546ea91506ec20e60d..e8df28a3046f23289bb50499d3b334028ac9bcc3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/no_default_but_missing_with_default.stderr @@ -1,5 +1,5 @@ error: `#[pallet:no_default]` can only be used if `#[pallet::config(with_default)]` has been specified - --> tests/pallet_ui/no_default_but_missing_with_default.rs:9:4 - | -9 | #[pallet::no_default] - | ^^^^^^^^^^^^^^^^^^^^ + --> tests/pallet_ui/no_default_but_missing_with_default.rs:26:4 + | +26 | #[pallet::no_default] + | ^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs b/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs index 7d8be8ec0017456bd0c9a75c455e50314907ec30..37ad00e0fdd7275a00f2af840bad08f8d02cd75b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs +++ b/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.stderr b/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.stderr index 68751470a3e2fcb7f5b817bdf5e87e54f9d9b229..6cb3ac9e945b2c4db7fede73435786dc742c6ddc 100644 --- a/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.stderr @@ -1,11 +1,11 @@ error: Invalid pallet::storage, cannot find `Hasher` generic, required for `StorageMap`. - --> tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs:21:43 + --> tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs:38:43 | -21 | type MyStorageMap = StorageMap; +38 | type MyStorageMap = StorageMap; | ^ error[E0432]: unresolved import `pallet` - --> tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs:3:9 - | -3 | pub use pallet::*; - | ^^^^^^ help: a similar path exists: `test_pallet::pallet` + --> tests/pallet_ui/non_dev_mode_storage_map_explicit_key_default_hasher.rs:20:9 + | +20 | pub use pallet::*; + | ^^^^^^ help: a similar path exists: `test_pallet::pallet` diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs index 32df5d61836530c86c72440410fc992d203f56cb..f2fe8de464bd31d4e7cd38be40a222d8b7c59b8f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] // Must receive a string literal pointing to a path #[pallet_doc(X)] diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.stderr index 9a1249dd36f37aaf2becc67c07c8826ac60bd29e..a630380b5946f1fd44608efe93f621e4ff313067 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.stderr @@ -1,5 +1,5 @@ error: The `pallet_doc` received an unsupported argument. Supported format: `pallet_doc("PATH")` - --> tests/pallet_ui/pallet_doc_arg_non_path.rs:3:1 - | -3 | #[pallet_doc(X)] - | ^ + --> tests/pallet_ui/pallet_doc_arg_non_path.rs:20:1 + | +20 | #[pallet_doc(X)] + | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs index 6ff01e9fb44b83922f3f07e1cc212ae45d47dfd9..e3a3679fb4ee11c27d776e1baf4776654a5d857a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] // Expected one argument for the doc path. #[pallet_doc] diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.stderr index a220cbe9e99902790bf2974af2cd1fc3047e2834..0ef0ea9cc72c7c9362e2b26f2daede254ffef0aa 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_empty.stderr @@ -1,5 +1,5 @@ error: The `pallet_doc` received an unsupported argument. Supported format: `pallet_doc("PATH")` - --> tests/pallet_ui/pallet_doc_empty.rs:3:1 - | -3 | #[pallet_doc] - | ^ + --> tests/pallet_ui/pallet_doc_empty.rs:20:1 + | +20 | #[pallet_doc] + | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs index c7d3b556a08e2a229e4638f4ea0f1293076cd7ce..54c5336f78933cff64baac94631b4fb3ec975264 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] // Argument expected as list, not named value. #[pallet_doc = "invalid"] diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.stderr index bee7c708507d229c7866ba1d2d04216e6c44ff67..8a948b1b59ddbc91d686128d7f6907e556b3db58 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.stderr @@ -1,5 +1,5 @@ error: The `pallet_doc` received an unsupported argument. Supported format: `pallet_doc("PATH")` - --> tests/pallet_ui/pallet_doc_invalid_arg.rs:3:1 - | -3 | #[pallet_doc = "invalid"] - | ^ + --> tests/pallet_ui/pallet_doc_invalid_arg.rs:20:1 + | +20 | #[pallet_doc = "invalid"] + | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs index a799879fe4442fadda19bddf008102b32679ba5c..4342cdf39dd9d5251e0c6f93f2879fd86913a273 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] // Supports only one argument. #[pallet_doc("A", "B")] diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.stderr index e769555438e13bd0d5fabf3f7edf369054fb0862..c3e05b38bbee6f792a7f2d8bd703962234fe59f0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.stderr @@ -1,5 +1,5 @@ error: The `pallet_doc` received an unsupported argument. Supported format: `pallet_doc("PATH")` - --> tests/pallet_ui/pallet_doc_multiple_args.rs:3:1 - | -3 | #[pallet_doc("A", "B")] - | ^ + --> tests/pallet_ui/pallet_doc_multiple_args.rs:20:1 + | +20 | #[pallet_doc("A", "B")] + | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.rs index 1fc42f6511cfaf27fbf9d51f01fb3d8c9a7851e6..003b2479f1c5891f774e0ce15f550520a7facb91 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet(foo)] pub mod pallet {} diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.stderr index 234dc07f2ece33c9423f282a9f8e2bf44e8a98e6..8736890f11744018c369787b3cc183d694adab79 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_invalid_arg.stderr @@ -1,5 +1,5 @@ error: Invalid pallet macro call: unexpected attribute. Macro call must be bare, such as `#[frame_support::pallet]` or `#[pallet]`, or must specify the `dev_mode` attribute, such as `#[frame_support::pallet(dev_mode)]` or #[pallet(dev_mode)]. - --> tests/pallet_ui/pallet_invalid_arg.rs:1:25 - | -1 | #[frame_support::pallet(foo)] - | ^^^ + --> tests/pallet_ui/pallet_invalid_arg.rs:18:25 + | +18 | #[frame_support::pallet(foo)] + | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.rs b/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.rs index ac52e75a5f48900e49e62b7d9f6e3175fcb0426b..3d6a5c0b0a5965ff61c5a15ac37a5b9376083c98 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.stderr index 301a73c000f079211da38d5a9ac7bdc0ace40c00..33a2d1da78608c7d97e433d03c403cf4559a79b9 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/pallet_struct_invalid_attr.stderr @@ -1,5 +1,5 @@ error: expected one of: `generate_store`, `without_storage_info`, `storage_version` - --> tests/pallet_ui/pallet_struct_invalid_attr.rs:7:12 - | -7 | #[pallet::generate_storage_info] // invalid - | ^^^^^^^^^^^^^^^^^^^^^ + --> tests/pallet_ui/pallet_struct_invalid_attr.rs:24:12 + | +24 | #[pallet::generate_storage_info] // invalid + | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/default_config.rs b/substrate/frame/support/test/tests/pallet_ui/pass/default_config.rs index 9f90ae67d5779a55464bf1169201b9b23f6e9546..f169ee34c9ab5542071b11c48fa101e1c16e2e95 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/default_config.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/default_config.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs b/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs index ed779da80a1881d024fd34b87f50ec272b4ad298..bf26cfd95b19f861ace29855799925eb725c6aba 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::traits::ConstU32; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs b/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs index 1b6f584af23b9c9c84f425735e53a60fa94b3f57..2e0df1ac398af57a3c1b44fe28175d36ab4d496e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/error_nested_types.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use codec::{Decode, Encode}; use frame_support::PalletError; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight.rs b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight.rs index 355a1c978df06d2783e0ce78cf2da37957122495..fdb9d8c401d1d3ffec38c1393b147b88b4acf2ac 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight2.rs b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight2.rs index ae70c295d8db24da7768a4c8295b74181c8ff460..208c719cdfc81d90c9fa7f56626e7f96adff0f79 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight2.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight3.rs b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight3.rs index 567fd2e5fa032f51734b4931c467faedafd26b7b..f40d1040858f5ba47c2ffb5817a02a1035b3a87b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight3.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight3.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight_dev_mode.rs b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight_dev_mode.rs index 04ce49ee71e99fa72623c5e2052a243e37f86d2a..a78c9d8f36ebf4a506e2d45404adf7a81c340a23 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight_dev_mode.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/inherited_call_weight_dev_mode.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs index 87659a0bab5136ceff1c812f62991e8fa35abd65..9ab486c718c413761f23242a2ea09fa08443255e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use frame_support::construct_runtime; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/trait_constant_valid_bounds.rs b/substrate/frame/support/test/tests/pallet_ui/pass/trait_constant_valid_bounds.rs index 71eb4f2992b39debd98ff43f0e59f28e2fd40295..83b323e3abafdaac013b232deb75e60834570abb 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/trait_constant_valid_bounds.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/trait_constant_valid_bounds.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs b/substrate/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs index 15fff372a1dd13ffac6e3c4bf72c2354a7e0e898..560ebbb8687081bec65b52473a6508fa210dfb58 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { #[pallet::config] diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs index fe4682c401fa047d98fe63495eb60e406533bea4..b767d6b60dfa19c49092ee640bc565c3ed0fb9b2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr index bc6d98b8da84d056bfaa09cb23cf5d6827d33f4f..e290b22a0eaa59b02cf2af5487444cde5924c3b5 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeDecode`: @@ -14,9 +14,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `EncodeLike` is not implemented for `Bar` | = help: the following other types implement trait `EncodeLike`: @@ -34,9 +34,9 @@ error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeEncode`: @@ -55,9 +55,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `TypeInfo` is not implemented for `Bar` | = help: the following other types implement trait `TypeInfo`: @@ -74,9 +74,9 @@ error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeDecode`: @@ -89,9 +89,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `EncodeLike` is not implemented for `Bar` | = help: the following other types implement trait `EncodeLike`: @@ -109,9 +109,9 @@ error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeEncode`: diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs index 82512a89fb15aa7556e38622e5a79fcce84e2314..6c53bc5dc6a0d34d5768e880fcfa45ba0bd5ef11 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr index 1c010d662d07aa34b81fca9cd54eeeaef6f953b3..0e3a7c9f1cbfa0f7ac626eef998824a85b0673bc 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeDecode`: @@ -14,9 +14,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `EncodeLike` is not implemented for `Bar` | = help: the following other types implement trait `EncodeLike`: @@ -34,9 +34,9 @@ error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:27:12 | -10 | #[pallet::without_storage_info] +27 | #[pallet::without_storage_info] | ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeEncode`: @@ -55,9 +55,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `PartialStorageInfoTrait` error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `TypeInfo` is not implemented for `Bar` | = help: the following other types implement trait `TypeInfo`: @@ -74,9 +74,9 @@ error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeDecode`: @@ -89,9 +89,9 @@ error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `EncodeLike` is not implemented for `Bar` | = help: the following other types implement trait `EncodeLike`: @@ -109,9 +109,9 @@ error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageEntryMetadataBuilder` error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied - --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12 + --> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:38:12 | -21 | #[pallet::storage] +38 | #[pallet::storage] | ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar` | = help: the following other types implement trait `WrapperTypeEncode`: diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.rs b/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.rs index e451df8c78a02f97bbd047d87a99889c0f3533e6..df7ecbcee7cdac140244b225126dc241e5e59af6 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.stderr index 57f3ab78a5382e07b824bd89774ab0e1ec12c3cf..9679c3fee8db4536bd3d0b8438c5fae649c4deb8 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_incomplete_item.stderr @@ -1,13 +1,13 @@ error: free type alias without body - --> $DIR/storage_incomplete_item.rs:19:2 + --> tests/pallet_ui/storage_incomplete_item.rs:36:2 | -19 | type Foo; +36 | type Foo; | ^^^^^^^^- | | | help: provide a definition for the type: `= ;` error[E0433]: failed to resolve: use of undeclared crate or module `pallet` - --> $DIR/storage_incomplete_item.rs:18:4 + --> tests/pallet_ui/storage_incomplete_item.rs:35:4 | -18 | #[pallet::storage] +35 | #[pallet::storage] | ^^^^^^ use of undeclared crate or module `pallet` diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.rs b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.rs index 4d43e3a17a9ec80e5a1771f5ff2538e62a2d1f33..a17f85e66ac09878d999f08067ab20d41ae2775a 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.stderr index c17f9eaa03251bd7109fb32e640462823f65d4ee..9a31e4b6bdf46eb0470e7fd90ed329a95b27ec58 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied - --> tests/pallet_ui/storage_info_unsatisfied.rs:9:12 - | -9 | #[pallet::pallet] - | ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar` - | - = help: the following other types implement trait `MaxEncodedLen`: - () - (TupleElement0, TupleElement1) - (TupleElement0, TupleElement1, TupleElement2) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) - (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) - and $N others - = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageInfoTrait` + --> tests/pallet_ui/storage_info_unsatisfied.rs:26:12 + | +26 | #[pallet::pallet] + | ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar` + | + = help: the following other types implement trait `MaxEncodedLen`: + () + (TupleElement0, TupleElement1) + (TupleElement0, TupleElement1, TupleElement2) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) + (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) + and $N others + = note: required for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo, Bar>` to implement `StorageInfoTrait` diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs index dd10bc0723fe129b80dad1eb4bbbc7d394ffa3b6..be0665db7b6717ca8730191c639981f15c7547c8 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::{ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr index c34c796fe59c18bcfdc12b3d6283fbb1cf4ed08f..cdcd1b401f8010e3b619903fc5d11cd16fd5020e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied - --> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:12:12 + --> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:29:12 | -12 | #[pallet::pallet] +29 | #[pallet::pallet] | ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar` | = help: the following other types implement trait `MaxEncodedLen`: diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.rs b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.rs index c6a88c083135d538b0550547f72cc4dec2c1a078..914a8d6cd4de79e954e0dd2d743b1c4bad169f85 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.stderr index 80c6526bbf88897282e4d2deb576f09fe56b238d..7f125526edf26abddf82f2228da9a510200f0735 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_attribute.stderr @@ -1,5 +1,5 @@ error: expected one of: `getter`, `storage_prefix`, `unbounded`, `whitelist_storage` - --> $DIR/storage_invalid_attribute.rs:16:12 + --> tests/pallet_ui/storage_invalid_attribute.rs:33:12 | -16 | #[pallet::generate_store(pub trait Store)] +33 | #[pallet::generate_store(pub trait Store)] | ^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.rs b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.rs index c8df93c9b323d350582e122e30c49b6c7164645b..62367d2da7ecca90a30b611b87dfd365fa13c84e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.stderr index b37f7e57f3552c5745fba93fe780d21b5de14b84..0b1a7273fa8cfeff198696072c7e93ae544d2dc7 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_first_generic.stderr @@ -1,11 +1,11 @@ error: Invalid pallet::storage, for unnamed generic arguments the type first generic argument must be `_`, the argument is then replaced by macro. - --> $DIR/storage_invalid_first_generic.rs:19:29 + --> tests/pallet_ui/storage_invalid_first_generic.rs:36:29 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^ error: expected `_` - --> $DIR/storage_invalid_first_generic.rs:19:29 + --> tests/pallet_ui/storage_invalid_first_generic.rs:36:29 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.rs b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.rs index c3a08e05e2ac7b42c362a63b0f6e1dac79ad013d..336d81c25416ce9f9174353f1dca23370ea93e85 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.stderr index 513970f98a4f7d38d3885afd1b72c5b3391e5ac2..e7cff8b468957b4b8fe322882a2784efca873528 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_invalid_rename_value.stderr @@ -1,5 +1,5 @@ error: `pub` is not a valid identifier - --> $DIR/storage_invalid_rename_value.rs:13:29 + --> tests/pallet_ui/storage_invalid_rename_value.rs:30:29 | -13 | #[pallet::storage_prefix = "pub"] +30 | #[pallet::storage_prefix = "pub"] | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.rs b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.rs index 309b9b24136fadae4fdda89b5283de5a198c21c4..54f0c1ef5370c9347c283d602bc489c25ba3763c 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.stderr index 40f57f16e0df5a8de14ab4efb68d38574a9cc1d3..494205c2690f6f3fa6ea50598156ca2e24419453 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_getters.stderr @@ -1,5 +1,5 @@ error: Invalid attribute: Duplicate attribute - --> $DIR/storage_multiple_getters.rs:20:3 + --> tests/pallet_ui/storage_multiple_getters.rs:37:3 | -20 | #[pallet::getter(fn foo_error)] +37 | #[pallet::getter(fn foo_error)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.rs b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.rs index f3caef80a7ee28a34ca318455c6deb7a389a9616..e338faef5c2798ec06be4559f7aecf0c1accdf2f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.stderr index 52cb7e85adf21c10591ceec5b9df997571ff358b..60720a46a2be139a324cdb7a07fd3ca6bf3f0e06 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_multiple_renames.stderr @@ -1,5 +1,5 @@ error: Invalid attribute: Duplicate attribute - --> $DIR/storage_multiple_renames.rs:20:3 + --> tests/pallet_ui/storage_multiple_renames.rs:37:3 | -20 | #[pallet::storage_prefix = "Baz"] +37 | #[pallet::storage_prefix = "Baz"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.rs b/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.rs index 03eee6fc8ec7d3990b35c7697c38fabb9293b88e..f1eb2bed2a1445f513e844f4bcaf1c0683b07c22 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.stderr index 3358f00151d50dcc65a305b42753765d19187a90..27dd3a1ef4283c048fd193eec35617f9df3673e3 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_not_storage_type.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, expected ident: `StorageValue` or `StorageMap` or `CountedStorageMap` or `StorageDoubleMap` or `StorageNMap` or `CountedStorageNMap` in order to expand metadata, found `u8`. - --> $DIR/storage_not_storage_type.rs:19:16 + --> tests/pallet_ui/storage_not_storage_type.rs:36:16 | -19 | type Foo = u8; +36 | type Foo = u8; | ^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs index a051cc087db5888c98e73902c894212b2306eebf..4171596ddde7b5c7c4d77a58a427ec3ec2cad516 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr index 9e63fd03db52b2e18afa17e78a5a5293bb5c6094..7ca7ec8bbb7d7269fd22d8e6594fc40ee9b2659f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.stderr @@ -1,15 +1,15 @@ error[E0107]: missing generics for enum `pallet::Error` - --> tests/pallet_ui/storage_result_query_missing_generics.rs:17:56 + --> tests/pallet_ui/storage_result_query_missing_generics.rs:34:56 | -17 | type Foo = StorageValue<_, u8, ResultQuery>; +34 | type Foo = StorageValue<_, u8, ResultQuery>; | ^^^^^ expected 1 generic argument | note: enum defined here, with 1 generic parameter: `T` - --> tests/pallet_ui/storage_result_query_missing_generics.rs:12:11 + --> tests/pallet_ui/storage_result_query_missing_generics.rs:29:11 | -12 | pub enum Error { +29 | pub enum Error { | ^^^^^ - help: add missing generic argument | -17 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue>>; +34 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue>>; | +++ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.rs index 9e0da4b62128d85ea122723365e50098afcc3dc7..a1ce60eb21c31ae21f9961629121fc2f7667cc27 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.stderr index 4be2a36eb89e17981a3a431a8d3dbe5c8457f8ff..1e27dac745db6949629d7cb11262085696e77024 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, unexpected number of generic arguments for ResultQuery, expected 1 type argument, found 2 - --> tests/pallet_ui/storage_result_query_multiple_type_args.rs:19:56 + --> tests/pallet_ui/storage_result_query_multiple_type_args.rs:36:56 | -19 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue, SomeOtherError>>; +36 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue, SomeOtherError>>; | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs index 102a2261f83338a4e9a748b515f5f4c48ea657b4..c09d094940323189beffca34a50801a51ee0085d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.stderr index 77a7972a5b5cf7e5ad0a9cf7e2cacd0ac6deb225..1593c9820697c37f433cff7c87b79fd4eefe8477 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, unexpected number of path segments for the generics in ResultQuery, expected a path with at least 2 segments, found 1 - --> tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs:12:56 + --> tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs:29:56 | -12 | type Foo = StorageValue<_, u8, ResultQuery>; +29 | type Foo = StorageValue<_, u8, ResultQuery>; | ^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.rs index f30dc3b6a3cc76070bac729ed3d500ba2eef9ca4..1734a1b625ce16b36627cfbf3eff73f7aca2bd67 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.stderr index 89ddd1599ac971d805777953db879951608a05f9..926f9ad7575f21ebdfd9239b7d212fdfd52a3639 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.stderr @@ -1,5 +1,5 @@ error: expected `,` - --> tests/pallet_ui/storage_result_query_parenthesized_generics.rs:18:55 + --> tests/pallet_ui/storage_result_query_parenthesized_generics.rs:35:55 | -18 | type Foo = StorageValue<_, u8, ResultQuery(NonExistentValue)>; +35 | type Foo = StorageValue<_, u8, ResultQuery(NonExistentValue)>; | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.rs b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.rs index a5065398b397063bd405c341af820294bba76694..30d1b6b48ecd55901e33195a6136a5ccb46fa6f8 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.stderr index 9f333ae28e6aa327532f4a4a562625e545a2300d..b08af8da5a895a73566f2ced47bc8231e56080a1 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, unexpected generic argument kind, expected a type path to a `PalletError` enum variant, found `'static` - --> tests/pallet_ui/storage_result_query_wrong_generic_kind.rs:18:56 + --> tests/pallet_ui/storage_result_query_wrong_generic_kind.rs:35:56 | -18 | type Foo = StorageValue<_, u8, ResultQuery<'static>>; +35 | type Foo = StorageValue<_, u8, ResultQuery<'static>>; | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.rs b/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.rs index 1f076b1ecbfc6b020d9ec1254938375487f8c59c..0104637115561bd12515ba8ca28c8e3336a8d2d0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.stderr index 3def9061fec8a1a1bc011eaf602e717804347599..ab30a9e42bc5f84ce099ae3d2d0676dc69fb5e25 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.stderr @@ -1,11 +1,11 @@ error: Invalid pallet::storage, Duplicated named generic - --> $DIR/storage_value_duplicate_named_generic.rs:19:42 + --> tests/pallet_ui/storage_value_duplicate_named_generic.rs:36:42 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^^^^ error: Invalid pallet::storage, Duplicated named generic - --> $DIR/storage_value_duplicate_named_generic.rs:19:29 + --> tests/pallet_ui/storage_value_duplicate_named_generic.rs:36:29 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.rs b/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.rs index fd0ea4794bc43421da38acbbfb966f5e81fbf55d..8e82daa62709933996fb05be32c80dcc78c7c4ee 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue, OptionQuery}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.stderr index 61c01943cc3f5e1a6fcc004bdfba74ce676705f3..d58c0445188fb4d20636db300c9582d2085a234f 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, invalid generic declaration for storage. Expect only type generics or binding generics, e.g. `` or ``. - --> $DIR/storage_value_generic_named_and_unnamed.rs:19:16 + --> tests/pallet_ui/storage_value_generic_named_and_unnamed.rs:36:16 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.rs b/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.rs index e62bdafaa2643535e436ae26114645c8507e46c3..60f83f3d803f776454da4e809198ae8e213fc430 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.stderr index f7449c5ffda7d9d84a4f3f4c4d1165ed94d34178..688d7cc5ea1e75617bace28acea6c98840c698e2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_no_generic.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, invalid number of generic generic arguments, expect more that 0 generic arguments. - --> $DIR/storage_value_no_generic.rs:19:16 + --> tests/pallet_ui/storage_value_no_generic.rs:36:16 | -19 | type Foo = StorageValue; +36 | type Foo = StorageValue; | ^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.rs b/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.rs index a3e54448e42addc61dae9a1895c3a86dc13e528a..15383c570d1f7e4e228c338381b6d818d67be7aa 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, StorageValue}; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.stderr index f03b71ff5eb6e82434385b4069720382a7b7926e..32e12c89f1b2da81699655ac34b66766e381d8c0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.stderr @@ -1,11 +1,11 @@ error: Invalid pallet::storage, Unexpected generic `P` for `StorageValue`. `StorageValue` expect generics `Value`, and optional generics `QueryKind`, `OnEmpty`. - --> $DIR/storage_value_unexpected_named_generic.rs:19:29 + --> tests/pallet_ui/storage_value_unexpected_named_generic.rs:36:29 | -19 | type Foo = StorageValue

; +36 | type Foo = StorageValue

; | ^ error: Invalid pallet::storage, cannot find `Value` generic, required for `StorageValue`. - --> $DIR/storage_value_unexpected_named_generic.rs:19:28 + --> tests/pallet_ui/storage_value_unexpected_named_generic.rs:36:28 | -19 | type Foo = StorageValue

; +36 | type Foo = StorageValue

; | ^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.rs b/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.rs index 56c4b86f2b35a9fde7b16f37776ebef7ee59bfea..90293497a9b294bb42b32e26785a9313f2d45cc9 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.stderr index d875d8acec66f6b6b91d1f987d5b462883173a98..3856d44d78e8c5cb6c9d18199dea8bec1d1a2f07 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_wrong_item.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::storage, expect item type. - --> $DIR/storage_wrong_item.rs:19:2 + --> tests/pallet_ui/storage_wrong_item.rs:36:2 | -19 | impl Foo {} +36 | impl Foo {} | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.rs b/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.rs index 3ebd1cb9fa608e1526440c6cb6fd6800eb4ccbb1..55dd315fb297cdf55802e25f48b53364b394dd3d 100644 --- a/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.rs +++ b/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr b/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr index a8836bc0482311a2d37eb3872cd724fff951b780..20144d825e83248b97c5c53053276aab002aa4ac 100644 --- a/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr @@ -1,18 +1,18 @@ error: use of deprecated struct `pallet::_::Store`: Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023. Check https://github.com/paritytech/substrate/pull/13535 for more details. - --> tests/pallet_ui/store_trait_leak_private.rs:11:3 + --> tests/pallet_ui/store_trait_leak_private.rs:28:3 | -11 | #[pallet::generate_store(pub trait Store)] +28 | #[pallet::generate_store(pub trait Store)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` error[E0446]: private type `_GeneratedPrefixForStorageFoo` in public interface - --> tests/pallet_ui/store_trait_leak_private.rs:11:37 + --> tests/pallet_ui/store_trait_leak_private.rs:28:37 | -11 | #[pallet::generate_store(pub trait Store)] +28 | #[pallet::generate_store(pub trait Store)] | ^^^^^ can't leak private type ... -20 | #[pallet::storage] +37 | #[pallet::storage] | ------- `_GeneratedPrefixForStorageFoo` declared as private diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.rs b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.rs index ce599d5a31e71b09e711c59f9fb8c41accee9da5..7702de1e39e86774b0de9487db4df92d4bd393f2 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.stderr index 057ec6ffb2c75211a1e34f271815159480b2bc54..a9dbdd23cb4051213ebcfe1f1cac40e0be76775e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.stderr @@ -1,5 +1,5 @@ error: Invalid usage of `#[pallet::constant]`: `Get` trait bound not found - --> $DIR/trait_constant_invalid_bound.rs:9:3 - | -9 | type U; - | ^^^^ + --> tests/pallet_ui/trait_constant_invalid_bound.rs:26:3 + | +26 | type U; + | ^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs index 47303f2b20a023efbeece7e3f3c37d52723b531a..c29259762b2b406af53599753c306b7cbdb456fe 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.stderr index 8d830fed8f392b267a27a74aa2ff5b0a54a1abff..7d14aad6256e5781544b3e0c83c64d587e789c0b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.stderr @@ -1,5 +1,5 @@ error: Invalid usage of `#[pallet::constant]`: Expected a type argument - --> $DIR/trait_constant_invalid_bound_lifetime.rs:9:15 - | -9 | type U: Get<'static>; - | ^^^^^^^ + --> tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs:26:15 + | +26 | type U: Get<'static>; + | ^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.rs b/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.rs index 8537659dcd037e1a488b3f08abce2a35f0cd2a80..af8589ccf64476d7b23ae9554030eb81853b7993 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.stderr index e3409a819114a96f52d52732a1bf93f178fa6ada..bf0000209cf2825ae1b51f57d9d0e6e72daedafb 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_invalid_item.stderr @@ -1,5 +1,5 @@ error: Invalid #[pallet::constant] in #[pallet::config], expected type item - --> tests/pallet_ui/trait_invalid_item.rs:9:3 - | -9 | const U: u8 = 3; - | ^^^^^ + --> tests/pallet_ui/trait_invalid_item.rs:26:3 + | +26 | const U: u8 = 3; + | ^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.rs b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.rs index 8f3d9f3f3e2f956f47632ceda79b627c32d3701c..ad02fe853677989dfb7c9429c83f2f0d9222c776 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.stderr index 3679b67f07b53bc9ccf999b8c737569cfc9bbfa1..75ae829f977b3702947caf15bdf438826b5bb835 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_constant_attr.stderr @@ -1,5 +1,5 @@ error: Duplicate #[pallet::constant] attribute not allowed. - --> tests/pallet_ui/trait_item_duplicate_constant_attr.rs:9:4 - | -9 | #[pallet::constant] - | ^^^^^^^^^^^^^^^^^^ + --> tests/pallet_ui/trait_item_duplicate_constant_attr.rs:26:4 + | +26 | #[pallet::constant] + | ^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.rs b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.rs index d2040ec74dc4edc3e123672f67ff01216990cfde..51498e663cdcfff841fb799f6042d4b181090736 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::*; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.stderr index 77a29c394d62dd1a5ca1cd7cabd8f10f7b5926ad..8162af2ea2bb4d2535c4cfe17b242806ec31a6ff 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_item_duplicate_no_default.stderr @@ -1,5 +1,5 @@ error: Duplicate #[pallet::no_default] attribute not allowed. - --> tests/pallet_ui/trait_item_duplicate_no_default.rs:10:4 + --> tests/pallet_ui/trait_item_duplicate_no_default.rs:27:4 | -10 | #[pallet::no_default] +27 | #[pallet::no_default] | ^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.rs b/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.rs index 0fc987f7bbdd7d45e57b5f79d876f02cab73da1c..da3337a87dfe7e8d95ac3f55d7fb9907128152b0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.rs +++ b/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.stderr b/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.stderr index c38f43d28eb3377725bf0fb1cb15da3d74c47b1f..e18ed29daef5358c7bf741972ad8d34ee17b1f7b 100644 --- a/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/trait_no_supertrait.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::trait, expected explicit `frame_system::Config` as supertrait, found none. (try `pub trait Config: frame_system::Config { ...` or `pub trait Config: frame_system::Config { ...`). To disable this check, use `#[pallet::disable_frame_system_supertrait_check]` - --> $DIR/trait_no_supertrait.rs:7:2 - | -7 | pub trait Config { - | ^^^ + --> tests/pallet_ui/trait_no_supertrait.rs:24:2 + | +24 | pub trait Config { + | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.rs b/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.rs index a13e1c7c5c2d28cad863c3b31dac236b0bdaf636..90e6893bcbb634429b2d642800f2c868fa13f0e0 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.rs +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.stderr b/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.stderr index f46b89a067b061613d07ee37747b8213613ccc77..41dcd273d9620d4151bdd6e7ba65dd9c24174322 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_error_in_block.stderr @@ -1,5 +1,5 @@ error[E0599]: no function or associated item named `new` found for type `u32` in the current scope - --> $DIR/type_value_error_in_block.rs:20:8 + --> tests/pallet_ui/type_value_error_in_block.rs:37:8 | -20 | u32::new() +37 | u32::new() | ^^^ function or associated item not found in `u32` diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.rs b/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.rs index b04d8b894676d0964ed06fd966e94d89cd8650a5..20a444881d55704dc2ae120a99782baf23eb753e 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.rs +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::Hooks; diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr b/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr index d955960c315b021063903e74411cfd03a6a7ade2..93b0caaf8d779f3c36eb98bbd2846773a39bf8fc 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_forgotten_where_clause.stderr @@ -1,53 +1,53 @@ error[E0277]: the trait bound `::AccountId: From` is not satisfied - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:24:34 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:41:34 | -24 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } +41 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } | ^^^^^^ the trait `From` is not implemented for `::AccountId` | note: required by a bound in `pallet::Config` - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:25:51 | -7 | pub trait Config: frame_system::Config +24 | pub trait Config: frame_system::Config | ------ required by a bound in this trait -8 | where ::AccountId: From +25 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type | -24 | #[pallet::type_value] fn Foo() -> u32 where ::AccountId: From { 3u32 } +41 | #[pallet::type_value] fn Foo() -> u32 where ::AccountId: From { 3u32 } | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `::AccountId: From` is not satisfied - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:24:12 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:41:12 | -24 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } +41 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } | ^^^^^^^^^^ the trait `From` is not implemented for `::AccountId` | note: required by a bound in `pallet::Config` - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:25:51 | -7 | pub trait Config: frame_system::Config +24 | pub trait Config: frame_system::Config | ------ required by a bound in this trait -8 | where ::AccountId: From +25 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type | -24 | #[pallet::type_value where ::AccountId: From] fn Foo() -> u32 { 3u32 } +41 | #[pallet::type_value where ::AccountId: From] fn Foo() -> u32 { 3u32 } | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `::AccountId: From` is not satisfied - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:24:12 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:41:12 | -24 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } +41 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } | ^^^^^^^^^^ the trait `From` is not implemented for `::AccountId` | note: required by a bound in `pallet::Config` - --> tests/pallet_ui/type_value_forgotten_where_clause.rs:8:51 + --> tests/pallet_ui/type_value_forgotten_where_clause.rs:25:51 | -7 | pub trait Config: frame_system::Config +24 | pub trait Config: frame_system::Config | ------ required by a bound in this trait -8 | where ::AccountId: From +25 | where ::AccountId: From | ^^^^^^^^^ required by this bound in `Config` help: consider further restricting the associated type | -24 | #[pallet::type_value] fn Foo() -> u32 where ::AccountId: From { 3u32 } +41 | #[pallet::type_value] fn Foo() -> u32 where ::AccountId: From { 3u32 } | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.rs b/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.rs index 1b6c975b09ed1d35e10cdccb22d02a61065a4781..ea13c7f01d4482becebd64ec7bf1fc002c087982 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.rs +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, PhantomData}; diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.stderr b/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.stderr index 5ae618df8837c2a7c4bc734bf5b8b9bb27c5794d..94fe88418e6e6e787c97ffaca2ef8a8f51e63b78 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_invalid_item.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::type_value, expected item fn - --> $DIR/type_value_invalid_item.rs:18:24 + --> tests/pallet_ui/type_value_invalid_item.rs:35:24 | -18 | #[pallet::type_value] struct Foo; +35 | #[pallet::type_value] struct Foo; | ^^^^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.rs b/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.rs index 82eb3b17d0393b8c7bd3bbd729dd28d01f66858f..e9c24b4b8c9454ea969cfc87e9fb0f1096248e01 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.rs +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::pallet] mod pallet { use frame_support::pallet_prelude::{Hooks, PhantomData}; diff --git a/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.stderr b/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.stderr index 65ac0243f9f64eadf1c1f585321d608be15f194b..58c45dfe87929f9bbd36180d9135cfb5ed45ddc7 100644 --- a/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/type_value_no_return.stderr @@ -1,5 +1,5 @@ error: Invalid pallet::type_value, expected return type - --> $DIR/type_value_no_return.rs:18:24 + --> tests/pallet_ui/type_value_no_return.rs:35:24 | -18 | #[pallet::type_value] fn Foo() {} +35 | #[pallet::type_value] fn Foo() {} | ^^ diff --git a/substrate/frame/support/test/tests/split_ui/import_without_pallet.rs b/substrate/frame/support/test/tests/split_ui/import_without_pallet.rs index 874a92e4610986e807370865ab9f4d60f3f4d32f..e62828ddf3ea3eed8f4310181f47e546e8d31a6b 100644 --- a/substrate/frame/support/test/tests/split_ui/import_without_pallet.rs +++ b/substrate/frame/support/test/tests/split_ui/import_without_pallet.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_macros::*; diff --git a/substrate/frame/support/test/tests/split_ui/import_without_pallet.stderr b/substrate/frame/support/test/tests/split_ui/import_without_pallet.stderr index 0d7b5414b10162623db997d5921971066e5ddab0..4db71c5905056ae03f672eb839cfbf68a79e99f2 100644 --- a/substrate/frame/support/test/tests/split_ui/import_without_pallet.stderr +++ b/substrate/frame/support/test/tests/split_ui/import_without_pallet.stderr @@ -1,5 +1,5 @@ error: `#[import_section]` can only be applied to a valid pallet module - --> tests/split_ui/import_without_pallet.rs:12:9 + --> tests/split_ui/import_without_pallet.rs:29:9 | -12 | pub mod pallet { +29 | pub mod pallet { | ^^^^^^ diff --git a/substrate/frame/support/test/tests/split_ui/no_section_found.rs b/substrate/frame/support/test/tests/split_ui/no_section_found.rs index fe12c6dc51b7295c5e6aceea784e9c21852b3b05..95b90a479169f6b9cc3d01794fbc85d214eae898 100644 --- a/substrate/frame/support/test/tests/split_ui/no_section_found.rs +++ b/substrate/frame/support/test/tests/split_ui/no_section_found.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_macros::*; diff --git a/substrate/frame/support/test/tests/split_ui/no_section_found.stderr b/substrate/frame/support/test/tests/split_ui/no_section_found.stderr index e0a9322b188e33372331a2293584744b6898b09f..486543c16eda248b3c214b06749f7cbb75079056 100644 --- a/substrate/frame/support/test/tests/split_ui/no_section_found.stderr +++ b/substrate/frame/support/test/tests/split_ui/no_section_found.stderr @@ -1,13 +1,13 @@ error[E0432]: unresolved import `pallet` - --> tests/split_ui/no_section_found.rs:5:9 - | -5 | pub use pallet::*; - | ^^^^^^ help: a similar path exists: `test_pallet::pallet` + --> tests/split_ui/no_section_found.rs:22:9 + | +22 | pub use pallet::*; + | ^^^^^^ help: a similar path exists: `test_pallet::pallet` error: cannot find macro `__export_tokens_tt_storages_dev` in this scope - --> tests/split_ui/no_section_found.rs:7:1 - | -7 | #[import_section(storages_dev)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `frame_support::macro_magic::forward_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/split_ui/no_section_found.rs:24:1 + | +24 | #[import_section(storages_dev)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the macro `frame_support::macro_magic::forward_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/split_ui/pass/split_valid.rs b/substrate/frame/support/test/tests/split_ui/pass/split_valid.rs index 8b5839ecd28a00c67fa7f8c84186ecdd43e5c413..a3ad7c2bf6f98e6f3187af95d3b29e0abc722567 100644 --- a/substrate/frame/support/test/tests/split_ui/pass/split_valid.rs +++ b/substrate/frame/support/test/tests/split_ui/pass/split_valid.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_macros::*; diff --git a/substrate/frame/support/test/tests/split_ui/pass/split_valid_disambiguation.rs b/substrate/frame/support/test/tests/split_ui/pass/split_valid_disambiguation.rs index 8d8d50422e9ce46ac101bfaf517a149b1f619e83..dba0eb7333a010ea66ac652e3aa85aae14c465d2 100644 --- a/substrate/frame/support/test/tests/split_ui/pass/split_valid_disambiguation.rs +++ b/substrate/frame/support/test/tests/split_ui/pass/split_valid_disambiguation.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_macros::*; diff --git a/substrate/frame/support/test/tests/split_ui/section_not_imported.rs b/substrate/frame/support/test/tests/split_ui/section_not_imported.rs index bcabf66256771696f17ac00bc81457b7ad3713a6..dc1e84ad28bbcf3d4a20c448194aa0acef1894c7 100644 --- a/substrate/frame/support/test/tests/split_ui/section_not_imported.rs +++ b/substrate/frame/support/test/tests/split_ui/section_not_imported.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_macros::*; diff --git a/substrate/frame/support/test/tests/split_ui/section_not_imported.stderr b/substrate/frame/support/test/tests/split_ui/section_not_imported.stderr index 41ac2a5f58d253b0b6a51d8706e3e64a531cfb79..f79ac938a61e65665e1cc242fafa326090f2900e 100644 --- a/substrate/frame/support/test/tests/split_ui/section_not_imported.stderr +++ b/substrate/frame/support/test/tests/split_ui/section_not_imported.stderr @@ -1,7 +1,7 @@ error[E0433]: failed to resolve: use of undeclared type `MyStorageMap` - --> tests/split_ui/section_not_imported.rs:27:4 + --> tests/split_ui/section_not_imported.rs:44:4 | -27 | MyStorageMap::::insert(1, 2); +44 | MyStorageMap::::insert(1, 2); | ^^^^^^^^^^^^ | | | use of undeclared type `MyStorageMap` diff --git a/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.rs b/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.rs index 4ed9d5adfec77f1ea9bb7de1c143a767a3a420bf..362e6ead61e5e0bb5ce65df1a110423d92119878 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.rs +++ b/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::storage_alias] type Ident = StorageValue; diff --git a/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.stderr b/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.stderr index 726efed400715c1d9b4378a52c08056ad989df05..e793aeb85bc739ff0de116aed5b0826221c43aaf 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.stderr +++ b/substrate/frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.stderr @@ -1,5 +1,5 @@ error: If there are no generics, the prefix is only allowed to be an identifier. - --> tests/storage_alias_ui/checks_for_valid_storage_type.rs:2:27 - | -2 | type Ident = StorageValue; - | ^^^^^^^^^^^^ + --> tests/storage_alias_ui/checks_for_valid_storage_type.rs:19:27 + | +19 | type Ident = StorageValue; + | ^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.rs b/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.rs index 59d8004bbe620eed27573dcb3147534f85d988e5..08bc8d6cc478cb08df66d2ee9a882cf5ab14aae0 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.rs +++ b/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::storage_alias] type Ident = CustomStorage; diff --git a/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.stderr b/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.stderr index 3b5e3e9c23cca0353c0f497f6e3eb33ebaa919b4..9f173472a8b9f93e6a58bafe02444eb95879c2b1 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.stderr +++ b/substrate/frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.stderr @@ -1,5 +1,5 @@ error: expected one of: `StorageValue`, `StorageMap`, `CountedStorageMap`, `StorageDoubleMap`, `StorageNMap` - --> tests/storage_alias_ui/forbid_underscore_as_prefix.rs:2:14 - | -2 | type Ident = CustomStorage; - | ^^^^^^^^^^^^^ + --> tests/storage_alias_ui/forbid_underscore_as_prefix.rs:19:14 + | +19 | type Ident = CustomStorage; + | ^^^^^^^^^^^^^ diff --git a/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.rs b/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.rs index 79328268dc925d7f6812474fb59ec53580bef1d6..4b0978f5f96c437b6f1f343e0b907a56cb39da0f 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.rs +++ b/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[frame_support::storage_alias] type NoUnderscore = StorageValue<_, u32>; diff --git a/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.stderr b/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.stderr index abb7bf2518f4f3cb6c158a1d0077f053c25f4141..18810f20d38459bb43296a8ef725765397f48412 100644 --- a/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.stderr +++ b/substrate/frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.stderr @@ -1,5 +1,5 @@ error: `_` is not allowed as prefix by `storage_alias`. - --> tests/storage_alias_ui/prefix_must_be_an_ident.rs:2:34 - | -2 | type NoUnderscore = StorageValue<_, u32>; - | ^ + --> tests/storage_alias_ui/prefix_must_be_an_ident.rs:19:34 + | +19 | type NoUnderscore = StorageValue<_, u32>; + | ^ diff --git a/substrate/frame/support/test/tests/versioned_runtime_upgrade.rs b/substrate/frame/support/test/tests/versioned_migration.rs similarity index 94% rename from substrate/frame/support/test/tests/versioned_runtime_upgrade.rs rename to substrate/frame/support/test/tests/versioned_migration.rs index 93d87df8ca185ae50041f24c8906f8696836c421..a0766f6bec254b7bf5d5d38b82b2f6d3ff67b211 100644 --- a/substrate/frame/support/test/tests/versioned_runtime_upgrade.rs +++ b/substrate/frame/support/test/tests/versioned_migration.rs @@ -15,13 +15,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Tests for VersionedRuntimeUpgrade +//! Tests for [`VersionedMigration`] #![cfg(all(feature = "experimental", feature = "try-runtime"))] use frame_support::{ construct_runtime, derive_impl, - migrations::VersionedRuntimeUpgrade, + migrations::VersionedMigration, parameter_types, traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion}, weights::constants::RocksDbWeight, @@ -90,7 +90,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } -/// A dummy migration for testing the `VersionedRuntimeUpgrade` trait. +/// A dummy migration for testing the `VersionedMigration` trait. /// Sets SomeStorage to S. struct SomeUnversionedMigration(sp_std::marker::PhantomData); @@ -124,13 +124,13 @@ impl OnRuntimeUpgrade for SomeUnversioned } type VersionedMigrationV0ToV1 = - VersionedRuntimeUpgrade<0, 1, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; + VersionedMigration<0, 1, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; type VersionedMigrationV1ToV2 = - VersionedRuntimeUpgrade<1, 2, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; + VersionedMigration<1, 2, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; type VersionedMigrationV2ToV4 = - VersionedRuntimeUpgrade<2, 4, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; + VersionedMigration<2, 4, SomeUnversionedMigration, DummyPallet, RocksDbWeight>; #[test] fn successful_upgrade_path() { diff --git a/substrate/frame/system/Cargo.toml b/substrate/frame/system/Cargo.toml index 32bcc796f60bdf923b7d61223ec497bf4f1e609f..d1d5897ce35524adf1d2b034700bd2fc5505d39b 100644 --- a/substrate/frame/system/Cargo.toml +++ b/substrate/frame/system/Cargo.toml @@ -17,7 +17,7 @@ cfg-if = "1.0" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] } frame-support = { path = "../support", default-features = false} sp-core = { path = "../../primitives/core", default-features = false, features = ["serde"] } sp-io = { path = "../../primitives/io", default-features = false} diff --git a/substrate/frame/tips/Cargo.toml b/substrate/frame/tips/Cargo.toml index 63b5c5cefff5ef999acddc49392fe1290ad35b4e..0e9314a9f97c58f1dc44df2ab696fc263c50fb83 100644 --- a/substrate/frame/tips/Cargo.toml +++ b/substrate/frame/tips/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"], optional = true } +serde = { version = "1.0.188", features = ["derive"], optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/transaction-payment/Cargo.toml b/substrate/frame/transaction-payment/Cargo.toml index 6fe9c7eb7e39e3404ba650dc7b4ec78205419c07..1db63bd134ad87aeae6f1243d6dc19d21bb2db2c 100644 --- a/substrate/frame/transaction-payment/Cargo.toml +++ b/substrate/frame/transaction-payment/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = "derive", ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} sp-core = { path = "../../primitives/core", default-features = false} diff --git a/substrate/frame/transaction-payment/asset-tx-payment/Cargo.toml b/substrate/frame/transaction-payment/asset-tx-payment/Cargo.toml index d89336fbf9fbaa70049917bb2a153629b891cf83..edf05a0533178c0dfc436c3ff2919023902a837f 100644 --- a/substrate/frame/transaction-payment/asset-tx-payment/Cargo.toml +++ b/substrate/frame/transaction-payment/asset-tx-payment/Cargo.toml @@ -27,7 +27,7 @@ frame-benchmarking = { path = "../../benchmarking", default-features = false, op # Other dependencies codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } [dev-dependencies] serde_json = "1.0.85" diff --git a/substrate/frame/transaction-payment/src/payment.rs b/substrate/frame/transaction-payment/src/payment.rs index bc871deafdc8bc2a56987c58c123ca8014deb671..22b0ac7c742403ac068b64a75a89e552ef06c470 100644 --- a/substrate/frame/transaction-payment/src/payment.rs +++ b/substrate/frame/transaction-payment/src/payment.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// ! Traits and default implementation for paying transaction fees. use crate::Config; diff --git a/substrate/frame/transaction-storage/Cargo.toml b/substrate/frame/transaction-storage/Cargo.toml index 1f2773f62850cd365094206f195e80436c8600c4..a1aec7ef65a389b9a2b0e48b7ed58e87daba392d 100644 --- a/substrate/frame/transaction-storage/Cargo.toml +++ b/substrate/frame/transaction-storage/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] array-bytes = { version = "6.1", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", optional = true } +serde = { version = "1.0.188", optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/transaction-storage/src/lib.rs b/substrate/frame/transaction-storage/src/lib.rs index e784d20a0cfd76d607b8327e348dcc25f4b63734..753f5ca0c7b5238c1d51dfbec2da50d1d1b82b1a 100644 --- a/substrate/frame/transaction-storage/src/lib.rs +++ b/substrate/frame/transaction-storage/src/lib.rs @@ -30,10 +30,10 @@ mod tests; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo}, + dispatch::GetDispatchInfo, traits::{Currency, OnUnbalanced, ReservableCurrency}, }; -use sp_runtime::traits::{BlakeTwo256, Hash, One, Saturating, Zero}; +use sp_runtime::traits::{BlakeTwo256, Dispatchable, Hash, One, Saturating, Zero}; use sp_std::{prelude::*, result}; use sp_transaction_storage_proof::{ encode_index, random_chunk, InherentError, TransactionStorageProof, CHUNK_SIZE, diff --git a/substrate/frame/treasury/Cargo.toml b/substrate/frame/treasury/Cargo.toml index f5bcb17b406162858f8cbb067ff1950d6d3d8713..785564cd9888d19fce3834189a55a60107715838 100644 --- a/substrate/frame/treasury/Cargo.toml +++ b/substrate/frame/treasury/Cargo.toml @@ -19,7 +19,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = ] } impl-trait-for-tuples = "0.2.2" scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive"], optional = true } +serde = { version = "1.0.188", features = ["derive"], optional = true } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true} frame-support = { path = "../support", default-features = false} frame-system = { path = "../system", default-features = false} diff --git a/substrate/frame/treasury/src/benchmarking.rs b/substrate/frame/treasury/src/benchmarking.rs index b8a53e06f2092bd4742d8ca1f7f7ab4a2bab5891..24c290ddb665e582800fdacf7838cb67dbb821f5 100644 --- a/substrate/frame/treasury/src/benchmarking.rs +++ b/substrate/frame/treasury/src/benchmarking.rs @@ -23,9 +23,8 @@ use super::{Pallet as Treasury, *}; use frame_benchmarking::v1::{account, benchmarks_instance_pallet, BenchmarkError}; use frame_support::{ - dispatch::UnfilteredDispatchable, ensure, - traits::{EnsureOrigin, OnInitialize}, + traits::{EnsureOrigin, OnInitialize, UnfilteredDispatchable}, }; use frame_system::RawOrigin; diff --git a/substrate/frame/tx-pause/src/benchmarking.rs b/substrate/frame/tx-pause/src/benchmarking.rs index 81595ef9f7280f42e8b50989d3f1109280da7c5d..126c0837949d56553baf5e1a073ab082df3c4dad 100644 --- a/substrate/frame/tx-pause/src/benchmarking.rs +++ b/substrate/frame/tx-pause/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/tx-pause/src/lib.rs b/substrate/frame/tx-pause/src/lib.rs index 36147d32a2f0e477a7bdf8b6e9df5a138ed81164..f8abf678e5a7e24646a6cb6d10c934a8d271ffcb 100644 --- a/substrate/frame/tx-pause/src/lib.rs +++ b/substrate/frame/tx-pause/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/tx-pause/src/mock.rs b/substrate/frame/tx-pause/src/mock.rs index 70c888f3c38da2706c31c8ae775501bb1826c974..706b0a558ba7eb07e5fbf4f11509fdc4282fef34 100644 --- a/substrate/frame/tx-pause/src/mock.rs +++ b/substrate/frame/tx-pause/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/frame/tx-pause/src/tests.rs b/substrate/frame/tx-pause/src/tests.rs index ca259315726b0bed7b99c526ab1a7703d05637d6..48b70f71ccb0837c0cff4ff0ffaa3ffd89b72323 100644 --- a/substrate/frame/tx-pause/src/tests.rs +++ b/substrate/frame/tx-pause/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,8 @@ use super::*; use crate::mock::{RuntimeCall, *}; -use frame_support::{assert_err, assert_noop, assert_ok, dispatch::Dispatchable}; +use frame_support::{assert_err, assert_noop, assert_ok}; +use sp_runtime::DispatchError; // GENERAL SUCCESS/POSITIVE TESTS --------------------- diff --git a/substrate/frame/uniques/src/benchmarking.rs b/substrate/frame/uniques/src/benchmarking.rs index 4e63f69281e5d431c80f21ab609ebf6d65eeeec9..821ca1794b865483d8dc3edbb7298fa15a2dd31c 100644 --- a/substrate/frame/uniques/src/benchmarking.rs +++ b/substrate/frame/uniques/src/benchmarking.rs @@ -24,8 +24,7 @@ use frame_benchmarking::v1::{ account, benchmarks_instance_pallet, whitelist_account, whitelisted_caller, BenchmarkError, }; use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get}, + traits::{EnsureOrigin, Get, UnfilteredDispatchable}, BoundedVec, }; use frame_system::RawOrigin as SystemOrigin; diff --git a/substrate/frame/uniques/src/tests.rs b/substrate/frame/uniques/src/tests.rs index 993552c3a2aaa5b78e734ad4c53e41652d6a0ef2..52f7df3b5efbc29796a77591ac44efd32429796a 100644 --- a/substrate/frame/uniques/src/tests.rs +++ b/substrate/frame/uniques/src/tests.rs @@ -18,8 +18,9 @@ //! Tests for Uniques pallet. use crate::{mock::*, Event, *}; -use frame_support::{assert_noop, assert_ok, dispatch::Dispatchable, traits::Currency}; +use frame_support::{assert_noop, assert_ok, traits::Currency}; use pallet_balances::Error as BalancesError; +use sp_runtime::traits::Dispatchable; use sp_std::prelude::*; fn items() -> Vec<(u64, u32, u32)> { diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index c2fd3a851c3197476a4da10c5c6e24386d9decdf..183853c4e8ac68d3f36767edfa9bc860025b4ce6 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -24,7 +24,7 @@ use super::*; use crate as utility; use frame_support::{ assert_err_ignore_postinfo, assert_noop, assert_ok, - dispatch::{DispatchError, DispatchErrorWithPostInfo, Dispatchable, Pays}, + dispatch::{DispatchErrorWithPostInfo, Pays}, error::BadOrigin, parameter_types, storage, traits::{ConstU32, ConstU64, Contains}, @@ -33,8 +33,8 @@ use frame_support::{ use pallet_collective::{EnsureProportionAtLeast, Instance1}; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, Hash, IdentityLookup}, - BuildStorage, TokenError, + traits::{BlakeTwo256, Dispatchable, Hash, IdentityLookup}, + BuildStorage, DispatchError, TokenError, }; type BlockNumber = u64; diff --git a/substrate/frame/vesting/src/lib.rs b/substrate/frame/vesting/src/lib.rs index eb829121e979717db9af0b96d60adda2f7efbafa..ee67a038e4d7bbbf89ecf11e7d9c91837417aa31 100644 --- a/substrate/frame/vesting/src/lib.rs +++ b/substrate/frame/vesting/src/lib.rs @@ -58,7 +58,7 @@ pub mod weights; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, storage::bounded_vec::BoundedVec, traits::{ @@ -74,7 +74,7 @@ use sp_runtime::{ AtLeast32BitUnsigned, Bounded, Convert, MaybeSerializeDeserialize, One, Saturating, StaticLookup, Zero, }, - RuntimeDebug, + DispatchError, RuntimeDebug, }; use sp_std::{fmt::Debug, marker::PhantomData, prelude::*}; diff --git a/substrate/frame/vesting/src/tests.rs b/substrate/frame/vesting/src/tests.rs index 46afe895f6fcc0de0d25401c22a9ecd07f3f1b57..c35686bd5146c3c951babbe9f044d53566f9766e 100644 --- a/substrate/frame/vesting/src/tests.rs +++ b/substrate/frame/vesting/src/tests.rs @@ -15,7 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::{assert_noop, assert_ok, assert_storage_noop, dispatch::EncodeLike}; +use codec::EncodeLike; +use frame_support::{assert_noop, assert_ok, assert_storage_noop}; use frame_system::RawOrigin; use sp_runtime::{ traits::{BadOrigin, Identity}, diff --git a/substrate/primitives/api/test/tests/ui/adding_self_parameter.rs b/substrate/primitives/api/test/tests/ui/adding_self_parameter.rs index 117fa261886b9f0a740081d5d5b913a26a3d4fd2..dcd680a20793d07a0f2668d1864fae5ff787c1d2 100644 --- a/substrate/primitives/api/test/tests/ui/adding_self_parameter.rs +++ b/substrate/primitives/api/test/tests/ui/adding_self_parameter.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { fn test(&self); diff --git a/substrate/primitives/api/test/tests/ui/adding_self_parameter.stderr b/substrate/primitives/api/test/tests/ui/adding_self_parameter.stderr index 894713d35eef8b1e3cb79ba2c5893bb5560ac031..0260ccda12cba914c2507d8783dbc9e8f91bf280 100644 --- a/substrate/primitives/api/test/tests/ui/adding_self_parameter.stderr +++ b/substrate/primitives/api/test/tests/ui/adding_self_parameter.stderr @@ -1,5 +1,5 @@ error: `self` as argument not supported. - --> $DIR/adding_self_parameter.rs:3:11 - | -3 | fn test(&self); - | ^ + --> tests/ui/adding_self_parameter.rs:20:11 + | +20 | fn test(&self); + | ^ diff --git a/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.rs b/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.rs index a0bb4e2830ca7e370ccca88fc963f8575196d960..08d92b1f3720962f9dc3a2a75cf5d4ea66352afc 100644 --- a/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.rs +++ b/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.stderr b/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.stderr index 2140703a5d2c218948ee135a567bd64eb509394d..67eb3d90d279669f74f1657824b2eb2c0a952da0 100644 --- a/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.stderr +++ b/substrate/primitives/api/test/tests/ui/changed_in_no_default_method.stderr @@ -1,6 +1,6 @@ error: There is no 'default' method with this name (without `changed_in` attribute). The 'default' method is used to call into the latest implementation. - --> tests/ui/changed_in_no_default_method.rs:9:6 - | -9 | fn test(data: u64); - | ^^^^ + --> tests/ui/changed_in_no_default_method.rs:26:6 + | +26 | fn test(data: u64); + | ^^^^ diff --git a/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.rs b/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.rs index 164b91d19422cdcdd31726664a596ea74ae547b9..9ad3b3914bb5ac9e1ac8652478c3f9cc91590c4b 100644 --- a/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.rs +++ b/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.stderr b/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.stderr index d4a03bab552e90294ddd23fa3d972735872482c6..6d17b7a5a2d6ea587e0a723298c54d894cd448f9 100644 --- a/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.stderr +++ b/substrate/primitives/api/test/tests/ui/changed_in_unknown_version.stderr @@ -1,5 +1,5 @@ error: `changed_in` version can not be greater than the `api_version` - --> tests/ui/changed_in_unknown_version.rs:8:3 - | -8 | fn test(data: u64); - | ^^ + --> tests/ui/changed_in_unknown_version.rs:25:3 + | +25 | fn test(data: u64); + | ^^ diff --git a/substrate/primitives/api/test/tests/ui/declaring_old_block.rs b/substrate/primitives/api/test/tests/ui/declaring_old_block.rs index fb741590282249c692af3b9233f59a95fa3b0b5b..6aa0582db15ee626c7d875f2ddafcb077e4c6367 100644 --- a/substrate/primitives/api/test/tests/ui/declaring_old_block.rs +++ b/substrate/primitives/api/test/tests/ui/declaring_old_block.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { fn test(); diff --git a/substrate/primitives/api/test/tests/ui/declaring_old_block.stderr b/substrate/primitives/api/test/tests/ui/declaring_old_block.stderr index 50dd37582c603d5d355472e2003b1813d18ecb67..233fe2f5f1bd6a5a58c7168c6e5d84555f380952 100644 --- a/substrate/primitives/api/test/tests/ui/declaring_old_block.stderr +++ b/substrate/primitives/api/test/tests/ui/declaring_old_block.stderr @@ -1,11 +1,11 @@ error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally. - --> $DIR/declaring_old_block.rs:2:23 - | -2 | pub trait Api { - | ^^^^^^ + --> tests/ui/declaring_old_block.rs:19:23 + | +19 | pub trait Api { + | ^^^^^^ error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! - --> $DIR/declaring_old_block.rs:2:16 - | -2 | pub trait Api { - | ^^^^^ + --> tests/ui/declaring_old_block.rs:19:16 + | +19 | pub trait Api { + | ^^^^^ diff --git a/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.rs b/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.rs index e3c7ae8a39ab748557c5d160f35e24dfcd0a353d..b8eeef3c3e53b62fa0509ad611c10037f8f99cd2 100644 --- a/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.rs +++ b/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { fn test(); diff --git a/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.stderr b/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.stderr index 778de3c9d15f7ff9caf94b858182af78ff260bd1..59a73819089eaba567105496470224ea1a36b24c 100644 --- a/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.stderr +++ b/substrate/primitives/api/test/tests/ui/declaring_own_block_with_different_name.stderr @@ -1,5 +1,5 @@ error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally. - --> $DIR/declaring_own_block_with_different_name.rs:2:19 - | -2 | pub trait Api { - | ^^^^^^ + --> tests/ui/declaring_own_block_with_different_name.rs:19:19 + | +19 | pub trait Api { + | ^^^^^^ diff --git a/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.rs b/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.rs index 68d84d97fa8e25f8bf1611ae4e8598702af87b17..1dce4fed0062f3005c93ceba134f699c76a112d3 100644 --- a/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.rs +++ b/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.stderr b/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.stderr index 96ec09a1855446e080b36b5d4d2908b6ed5e9cc5..498a3f201c3a2a91098df6afa1b863d5b06c3eaa 100644 --- a/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.stderr +++ b/substrate/primitives/api/test/tests/ui/empty_impl_runtime_apis_call.stderr @@ -1,7 +1,7 @@ error: No api implementation given! - --> tests/ui/empty_impl_runtime_apis_call.rs:11:1 + --> tests/ui/empty_impl_runtime_apis_call.rs:28:1 | -11 | sp_api::impl_runtime_apis! {} +28 | sp_api::impl_runtime_apis! {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `sp_api::impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.rs b/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.rs index 32501be7855c6b7c6aaff54710a8bd38d7c38581..43718e4cd04a3f25fcc805edec3c14283f1f5f56 100644 --- a/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.rs +++ b/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr b/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr index 2324be85be4f82acdbb55e17e6b1d21a95739b73..4bd64c974f29ced75ff54eb002711d728a64f258 100644 --- a/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr +++ b/substrate/primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr @@ -1,35 +1,35 @@ error[E0053]: method `test` has an incompatible type for trait - --> tests/ui/impl_incorrect_method_signature.rs:16:17 + --> tests/ui/impl_incorrect_method_signature.rs:33:17 | -16 | fn test(data: String) {} +33 | fn test(data: String) {} | ^^^^^^ | | | expected `u64`, found `std::string::String` | help: change the parameter type to match the trait: `u64` | note: type in trait - --> tests/ui/impl_incorrect_method_signature.rs:10:17 + --> tests/ui/impl_incorrect_method_signature.rs:27:17 | -10 | fn test(data: u64); +27 | fn test(data: u64); | ^^^ = note: expected signature `fn(u64)` found signature `fn(std::string::String)` error[E0308]: mismatched types - --> tests/ui/impl_incorrect_method_signature.rs:16:11 + --> tests/ui/impl_incorrect_method_signature.rs:33:11 | -14 | / sp_api::impl_runtime_apis! { -15 | | impl self::Api for Runtime { -16 | | fn test(data: String) {} +31 | / sp_api::impl_runtime_apis! { +32 | | impl self::Api for Runtime { +33 | | fn test(data: String) {} | | ^^^^ expected `u64`, found `String` -17 | | } +34 | | } ... | -29 | | } -30 | | } +46 | | } +47 | | } | |_- arguments to this function are incorrect | note: associated function defined here - --> tests/ui/impl_incorrect_method_signature.rs:10:6 + --> tests/ui/impl_incorrect_method_signature.rs:27:6 | -10 | fn test(data: u64); +27 | fn test(data: u64); | ^^^^ diff --git a/substrate/primitives/api/test/tests/ui/impl_missing_version.rs b/substrate/primitives/api/test/tests/ui/impl_missing_version.rs index 8fd40a400922f8240cf09d46a8566be9f17390ed..560257b5168c921ce112a56fcbd7e9c303363c77 100644 --- a/substrate/primitives/api/test/tests/ui/impl_missing_version.rs +++ b/substrate/primitives/api/test/tests/ui/impl_missing_version.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/impl_missing_version.stderr b/substrate/primitives/api/test/tests/ui/impl_missing_version.stderr index 770543aa8875d7876772d6f1998a895f821d5c40..c154bb10be09041a69d1a93fa92f76454b6d8a42 100644 --- a/substrate/primitives/api/test/tests/ui/impl_missing_version.stderr +++ b/substrate/primitives/api/test/tests/ui/impl_missing_version.stderr @@ -1,8 +1,8 @@ error[E0405]: cannot find trait `ApiV4` in module `self::runtime_decl_for_api` - --> tests/ui/impl_missing_version.rs:18:13 + --> tests/ui/impl_missing_version.rs:35:13 | -8 | pub trait Api { +25 | pub trait Api { | ------------- similarly named trait `ApiV2` defined here ... -18 | impl self::Api for Runtime { +35 | impl self::Api for Runtime { | ^^^ help: a trait with a similar name exists: `ApiV2` diff --git a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs index cb8f2f493d74114135b3830d8adf4ac6dc823720..4647a78809ab4bcb68dfc8e367e6423e83182956 100644 --- a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs +++ b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr index a41f59f36b1f0fa3a70c26caf19519600a5812d6..9e014e3ea821a192e6a6af64c45a23022c67a6f3 100644 --- a/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr +++ b/substrate/primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr @@ -1,5 +1,5 @@ error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration! - --> tests/ui/impl_two_traits_with_same_name.rs:24:15 + --> tests/ui/impl_two_traits_with_same_name.rs:41:15 | -24 | impl second::Api for Runtime { +41 | impl second::Api for Runtime { | ^^^ diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_1.rs b/substrate/primitives/api/test/tests/ui/invalid_api_version_1.rs index e038dd0aa6585b03c30e39a9383dd58fecef0dac..67af9a95521f537d49bf76eab35a8d393c912602 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_1.rs +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_1.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { #[api_version] pub trait Api { diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_1.stderr b/substrate/primitives/api/test/tests/ui/invalid_api_version_1.stderr index 53ffce959bb6697b861af157bbd7f78d5b2b572a..41ee4d5657c10f3f3c7ef2ee6b99fa534f35e906 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_1.stderr +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_1.stderr @@ -1,5 +1,5 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(1)` - --> tests/ui/invalid_api_version_1.rs:2:2 - | -2 | #[api_version] - | ^ + --> tests/ui/invalid_api_version_1.rs:19:2 + | +19 | #[api_version] + | ^ diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_2.rs b/substrate/primitives/api/test/tests/ui/invalid_api_version_2.rs index bb8ed8ed11fea503c931f433c784a182987c320b..fe563023f75d12b7cdbe2ce43f37d2aa02179ed0 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_2.rs +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_2.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { #[api_version("1")] pub trait Api { diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_2.stderr b/substrate/primitives/api/test/tests/ui/invalid_api_version_2.stderr index 0c5274d4680ff3dbcd83abf7619aea9d9a73357a..adfe4962ce453b854a41f6b38e44866c21656a7c 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_2.stderr +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_2.stderr @@ -1,5 +1,5 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(1)` - --> tests/ui/invalid_api_version_2.rs:2:2 - | -2 | #[api_version("1")] - | ^ + --> tests/ui/invalid_api_version_2.rs:19:2 + | +19 | #[api_version("1")] + | ^ diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_3.rs b/substrate/primitives/api/test/tests/ui/invalid_api_version_3.rs index d010866e23731dc737e6cdd810b45b0bba3b5d34..385837067e9f7bd3b100616ff6750f23374f3dee 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_3.rs +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_3.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { #[api_version()] pub trait Api { diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_3.stderr b/substrate/primitives/api/test/tests/ui/invalid_api_version_3.stderr index 4a34a7aa9b47ac666535f9b2828ab9daab3fd865..cd73a384f606411ed65da506e2d9f85d31ead2ca 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_3.stderr +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_3.stderr @@ -1,5 +1,5 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(1)` - --> tests/ui/invalid_api_version_3.rs:2:2 - | -2 | #[api_version()] - | ^ + --> tests/ui/invalid_api_version_3.rs:19:2 + | +19 | #[api_version()] + | ^ diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_4.rs b/substrate/primitives/api/test/tests/ui/invalid_api_version_4.rs index 37b5b6ffa25d112532095b0085322e95d2501cd0..adca5f725597a6d1a1e6a4d77798ccec1de62c02 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_4.rs +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_4.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { #[api_version("1")] diff --git a/substrate/primitives/api/test/tests/ui/invalid_api_version_4.stderr b/substrate/primitives/api/test/tests/ui/invalid_api_version_4.stderr index 57541a97f6c91b0a87a3e7d6176d73cdf8014752..a241ee028709c66c373ae45e98e075b6fae0ab19 100644 --- a/substrate/primitives/api/test/tests/ui/invalid_api_version_4.stderr +++ b/substrate/primitives/api/test/tests/ui/invalid_api_version_4.stderr @@ -1,5 +1,5 @@ error: Unexpected `api_version` attribute. The supported format is `api_version(1)` - --> tests/ui/invalid_api_version_4.rs:3:3 - | -3 | #[api_version("1")] - | ^ + --> tests/ui/invalid_api_version_4.rs:20:3 + | +20 | #[api_version("1")] + | ^ diff --git a/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.rs b/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.rs index b4f43cd401bba927323a1d6403f728b301ba6dc8..ca61bff5e6adca411e88988dbfbd8d70155b61e2 100644 --- a/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.rs +++ b/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { #[api_version(2)] pub trait Api { diff --git a/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.stderr b/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.stderr index ec4b594023a05963b7ddc7119a807bfbc883b8c8..dec73775363afa1e9bcf44914cc97fb87578dded 100644 --- a/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.stderr +++ b/substrate/primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.stderr @@ -1,11 +1,11 @@ error: Method version `1` is older than (or equal to) trait version `2`.Methods can't define versions older than the trait version. - --> tests/ui/method_ver_lower_than_trait_ver.rs:4:3 - | -4 | #[api_version(1)] - | ^ + --> tests/ui/method_ver_lower_than_trait_ver.rs:21:3 + | +21 | #[api_version(1)] + | ^ error: Trait version is set here. - --> tests/ui/method_ver_lower_than_trait_ver.rs:2:2 - | -2 | #[api_version(2)] - | ^ + --> tests/ui/method_ver_lower_than_trait_ver.rs:19:2 + | +19 | #[api_version(2)] + | ^ diff --git a/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.rs b/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.rs index b69505bfeb098f5b04fb8c663f7d29a36e96a42e..81d4bfeda8237122c3edf238595c2e9ce90f2194 100644 --- a/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.rs +++ b/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.stderr b/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.stderr index 5dc2b993bb1a7345bd8621f81d075fedea998dff..4d7ead55d61ddde5906c2f873535fe5010ccee6a 100644 --- a/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.stderr +++ b/substrate/primitives/api/test/tests/ui/missing_block_generic_parameter.stderr @@ -1,5 +1,5 @@ error: Missing `Block` generic parameter. - --> tests/ui/missing_block_generic_parameter.rs:12:13 + --> tests/ui/missing_block_generic_parameter.rs:29:13 | -12 | impl self::Api for Runtime { +29 | impl self::Api for Runtime { | ^^^ diff --git a/substrate/primitives/api/test/tests/ui/missing_path_for_trait.rs b/substrate/primitives/api/test/tests/ui/missing_path_for_trait.rs index e47bca1c3f6ce940a205ba79cf5599a806aaad0d..d1a0a27e20a9ffb96db7763479a276b13c59d313 100644 --- a/substrate/primitives/api/test/tests/ui/missing_path_for_trait.rs +++ b/substrate/primitives/api/test/tests/ui/missing_path_for_trait.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. struct Runtime {} diff --git a/substrate/primitives/api/test/tests/ui/missing_path_for_trait.stderr b/substrate/primitives/api/test/tests/ui/missing_path_for_trait.stderr index cca993501979e914f81b8eafdaca6b3d176f6454..9444b0041e61f1d23443fba6e1a67cd4ae547b1d 100644 --- a/substrate/primitives/api/test/tests/ui/missing_path_for_trait.stderr +++ b/substrate/primitives/api/test/tests/ui/missing_path_for_trait.stderr @@ -1,5 +1,5 @@ error: The implemented trait has to be referenced with a path, e.g. `impl client::Core for Runtime`. - --> tests/ui/missing_path_for_trait.rs:12:7 + --> tests/ui/missing_path_for_trait.rs:29:7 | -12 | impl Api for Runtime { +29 | impl Api for Runtime { | ^^^ diff --git a/substrate/primitives/api/test/tests/ui/missing_versioned_method.rs b/substrate/primitives/api/test/tests/ui/missing_versioned_method.rs index 919cef055fe62682ed3d80172e556fbb60ed5cc8..6ead545f85a11e8f0382331e77145acb4a053d5e 100644 --- a/substrate/primitives/api/test/tests/ui/missing_versioned_method.rs +++ b/substrate/primitives/api/test/tests/ui/missing_versioned_method.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/missing_versioned_method.stderr b/substrate/primitives/api/test/tests/ui/missing_versioned_method.stderr index b88d903212df1ed29e2a600d6abbca1a1b568dd2..e313b7948e85fcdc8c8abcb9f7d933e7936b7c05 100644 --- a/substrate/primitives/api/test/tests/ui/missing_versioned_method.stderr +++ b/substrate/primitives/api/test/tests/ui/missing_versioned_method.stderr @@ -1,8 +1,8 @@ error[E0046]: not all trait items implemented, missing: `test3` - --> tests/ui/missing_versioned_method.rs:18:2 + --> tests/ui/missing_versioned_method.rs:35:2 | -12 | fn test3(); +29 | fn test3(); | ----------- `test3` from trait ... -18 | impl self::Api for Runtime { +35 | impl self::Api for Runtime { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation diff --git a/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.rs b/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.rs index 036bba417f57d00e4a83a311351e58b3a7d3a914..8eebc1d79babcbd6fb95876a530a920397c035a6 100644 --- a/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.rs +++ b/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.stderr b/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.stderr index 4afa6856a58146694bf94efb3f9ca61d1dc6bb40..a45d2e6d354dddbd938d3fe09784881356d9cc18 100644 --- a/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.stderr +++ b/substrate/primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.stderr @@ -1,8 +1,8 @@ error[E0046]: not all trait items implemented, missing: `test3` - --> tests/ui/missing_versioned_method_multiple_vers.rs:20:2 + --> tests/ui/missing_versioned_method_multiple_vers.rs:37:2 | -12 | fn test3(); +29 | fn test3(); | ----------- `test3` from trait ... -20 | impl self::Api for Runtime { +37 | impl self::Api for Runtime { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation diff --git a/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.rs b/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.rs index 45e6adb2fcf948b64027c9e2241f2f519a240647..7fa3916bf20e261522fc4648dce3f7eb5ec2d27f 100644 --- a/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.rs +++ b/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use substrate_test_runtime_client::runtime::Block; use sp_api::ApiError; diff --git a/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.stderr b/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.stderr index 234331c9749bb333929fa536de73c8260da022aa..a7ea3146e8992f8d9f9709f7437503651768b928 100644 --- a/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.stderr +++ b/substrate/primitives/api/test/tests/ui/mock_advanced_hash_by_reference.stderr @@ -1,13 +1,13 @@ error: `Hash` needs to be taken by value and not by reference! - --> tests/ui/mock_advanced_hash_by_reference.rs:12:1 + --> tests/ui/mock_advanced_hash_by_reference.rs:29:1 | -12 | / sp_api::mock_impl_runtime_apis! { -13 | | impl Api for MockApi { -14 | | #[advanced] -15 | | fn test(&self, _: &Hash) -> Result<(), ApiError> { +29 | / sp_api::mock_impl_runtime_apis! { +30 | | impl Api for MockApi { +31 | | #[advanced] +32 | | fn test(&self, _: &Hash) -> Result<(), ApiError> { ... | -18 | | } -19 | | } +35 | | } +36 | | } | |_^ | = note: this error originates in the macro `sp_api::mock_impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.rs b/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.rs index 76bf5f1aa745967c7d3703e0f56121799a34353b..2a2eeec631346ebda3e731901637ba625be03b4f 100644 --- a/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.rs +++ b/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use substrate_test_runtime_client::runtime::Block; use sp_api::ApiError; diff --git a/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.stderr b/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.stderr index 48a94a00beae7cdc789eb445a054288d0b6bd9e2..0e45f73f3ed851180bc904a1cfe30a9ad7f82e61 100644 --- a/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.stderr +++ b/substrate/primitives/api/test/tests/ui/mock_advanced_missing_hash.stderr @@ -1,5 +1,5 @@ error: If using the `advanced` attribute, it is required that the function takes at least one argument, the `Hash`. - --> tests/ui/mock_advanced_missing_hash.rs:15:3 + --> tests/ui/mock_advanced_missing_hash.rs:32:3 | -15 | fn test(&self) -> Result<(), ApiError> { +32 | fn test(&self) -> Result<(), ApiError> { | ^^ diff --git a/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.rs b/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.rs index f49cafd23a00122bd53976c0656e0779f3d3fb5d..a4c98ca0cb024ee1c2dc486e6fd690bfe7140371 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.rs +++ b/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + struct Block2; sp_api::decl_runtime_apis! { diff --git a/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.stderr b/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.stderr index 1831d0485b473a3d33ca1bafce6c2fa67f6b78a2..cd29108e1569c2ac7a5a60f027418442aaebc272 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.stderr +++ b/substrate/primitives/api/test/tests/ui/mock_only_one_block_type.stderr @@ -1,11 +1,11 @@ error: Block type should be the same between all runtime apis. - --> $DIR/mock_only_one_block_type.rs:20:12 + --> tests/ui/mock_only_one_block_type.rs:37:12 | -20 | impl Api2 for MockApi { +37 | impl Api2 for MockApi { | ^^^^^^ error: First block type found here - --> $DIR/mock_only_one_block_type.rs:16:11 + --> tests/ui/mock_only_one_block_type.rs:33:11 | -16 | impl Api for MockApi { +33 | impl Api for MockApi { | ^^^^^ diff --git a/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.rs b/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.rs index 617031b4d5f1a1f37c974ed8d826f43e49003233..155b3d23d91808c8a8b9af34ea8a8a132deb595b 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.rs +++ b/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { fn test(data: u64); diff --git a/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.stderr b/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.stderr index 5f1e29b281c8504d39a355028882099b40298810..e9e7da2db8b0d4777340b6bd154b1acbc1c47421 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.stderr +++ b/substrate/primitives/api/test/tests/ui/mock_only_one_self_type.stderr @@ -1,11 +1,11 @@ error: Self type should not change between runtime apis - --> $DIR/mock_only_one_self_type.rs:19:23 + --> tests/ui/mock_only_one_self_type.rs:36:23 | -19 | impl Api2 for MockApi2 { +36 | impl Api2 for MockApi2 { | ^^^^^^^^ error: First self type found here - --> $DIR/mock_only_one_self_type.rs:15:22 + --> tests/ui/mock_only_one_self_type.rs:32:22 | -15 | impl Api for MockApi { +32 | impl Api for MockApi { | ^^^^^^^ diff --git a/substrate/primitives/api/test/tests/ui/mock_only_self_reference.rs b/substrate/primitives/api/test/tests/ui/mock_only_self_reference.rs index 8a733f5779ce938edcd1301b535938288b66737b..061206fff73d50dec36149d68231c74d877a9f54 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_self_reference.rs +++ b/substrate/primitives/api/test/tests/ui/mock_only_self_reference.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use substrate_test_runtime_client::runtime::Block; sp_api::decl_runtime_apis! { diff --git a/substrate/primitives/api/test/tests/ui/mock_only_self_reference.stderr b/substrate/primitives/api/test/tests/ui/mock_only_self_reference.stderr index f088e8f2de59db08dc37554c6935c7eef54c651c..8457557718771db27ae6c0b9ae7cf59f9e4a8e78 100644 --- a/substrate/primitives/api/test/tests/ui/mock_only_self_reference.stderr +++ b/substrate/primitives/api/test/tests/ui/mock_only_self_reference.stderr @@ -1,50 +1,50 @@ error: Only `&self` is supported! - --> tests/ui/mock_only_self_reference.rs:14:11 + --> tests/ui/mock_only_self_reference.rs:31:11 | -14 | fn test(self, data: u64) {} +31 | fn test(self, data: u64) {} | ^^^^ error: Only `&self` is supported! - --> tests/ui/mock_only_self_reference.rs:16:12 + --> tests/ui/mock_only_self_reference.rs:33:12 | -16 | fn test2(&mut self, data: u64) {} +33 | fn test2(&mut self, data: u64) {} | ^ error[E0050]: method `test` has 2 parameters but the declaration in trait `Api::test` has 3 - --> tests/ui/mock_only_self_reference.rs:12:1 + --> tests/ui/mock_only_self_reference.rs:29:1 | -3 | / sp_api::decl_runtime_apis! { -4 | | pub trait Api { -5 | | fn test(data: u64); +20 | / sp_api::decl_runtime_apis! { +21 | | pub trait Api { +22 | | fn test(data: u64); | |_________________________- trait requires 3 parameters ... -12 | / sp_api::mock_impl_runtime_apis! { -13 | | impl Api for MockApi { -14 | | fn test(self, data: u64) {} -15 | | -16 | | fn test2(&mut self, data: u64) {} -17 | | } -18 | | } +29 | / sp_api::mock_impl_runtime_apis! { +30 | | impl Api for MockApi { +31 | | fn test(self, data: u64) {} +32 | | +33 | | fn test2(&mut self, data: u64) {} +34 | | } +35 | | } | |_^ expected 3 parameters, found 2 | = note: this error originates in the macro `sp_api::mock_impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0050]: method `test2` has 2 parameters but the declaration in trait `Api::test2` has 3 - --> tests/ui/mock_only_self_reference.rs:12:1 + --> tests/ui/mock_only_self_reference.rs:29:1 | -3 | / sp_api::decl_runtime_apis! { -4 | | pub trait Api { -5 | | fn test(data: u64); -6 | | fn test2(data: u64); +20 | / sp_api::decl_runtime_apis! { +21 | | pub trait Api { +22 | | fn test(data: u64); +23 | | fn test2(data: u64); | |__________________________- trait requires 3 parameters ... -12 | / sp_api::mock_impl_runtime_apis! { -13 | | impl Api for MockApi { -14 | | fn test(self, data: u64) {} -15 | | -16 | | fn test2(&mut self, data: u64) {} -17 | | } -18 | | } +29 | / sp_api::mock_impl_runtime_apis! { +30 | | impl Api for MockApi { +31 | | fn test(self, data: u64) {} +32 | | +33 | | fn test2(&mut self, data: u64) {} +34 | | } +35 | | } | |_^ expected 3 parameters, found 2 | = note: this error originates in the macro `sp_api::mock_impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/api/test/tests/ui/no_default_implementation.rs b/substrate/primitives/api/test/tests/ui/no_default_implementation.rs index 6af93d6b865399c85b4d0756cb4357a4b71e21b2..4b96700ae3616a363a6dea034f03034bf1bc0b73 100644 --- a/substrate/primitives/api/test/tests/ui/no_default_implementation.rs +++ b/substrate/primitives/api/test/tests/ui/no_default_implementation.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + sp_api::decl_runtime_apis! { pub trait Api { fn test() { diff --git a/substrate/primitives/api/test/tests/ui/no_default_implementation.stderr b/substrate/primitives/api/test/tests/ui/no_default_implementation.stderr index 0ccece1441916245bd43517842cd0335395cbdf6..0d25fe2e59fe4524f4b5df1b09d0ac362a368bea 100644 --- a/substrate/primitives/api/test/tests/ui/no_default_implementation.stderr +++ b/substrate/primitives/api/test/tests/ui/no_default_implementation.stderr @@ -1,8 +1,8 @@ error: A runtime API function cannot have a default implementation! - --> $DIR/no_default_implementation.rs:3:13 - | -3 | fn test() { - | ___________________^ -4 | | println!("Hey, I'm a default implementation!"); -5 | | } - | |_________^ + --> tests/ui/no_default_implementation.rs:20:13 + | +20 | fn test() { + | ___________________^ +21 | | println!("Hey, I'm a default implementation!"); +22 | | } + | |_________^ diff --git a/substrate/primitives/api/test/tests/ui/positive_cases/custom_where_bound.rs b/substrate/primitives/api/test/tests/ui/positive_cases/custom_where_bound.rs index b572a3bc30d5dd5ff3714cf29a1e08d8a84df247..594556d57be50dbd151de486dc22a63a733b933b 100644 --- a/substrate/primitives/api/test/tests/ui/positive_cases/custom_where_bound.rs +++ b/substrate/primitives/api/test/tests/ui/positive_cases/custom_where_bound.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::traits::Block as BlockT; diff --git a/substrate/primitives/api/test/tests/ui/positive_cases/default_impls.rs b/substrate/primitives/api/test/tests/ui/positive_cases/default_impls.rs index 58192feb9ecac3c2b02c7a23c7ec2afada860781..ae573238ffe144d26b7e5dd4528e8a9e5ab88a9e 100644 --- a/substrate/primitives/api/test/tests/ui/positive_cases/default_impls.rs +++ b/substrate/primitives/api/test/tests/ui/positive_cases/default_impls.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.rs b/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.rs index 14a8fa4d4e0b1bb8eb715c86a4b165874915dca3..921bf0d04351dac4ddcdd18030619f1ebcf15008 100644 --- a/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.rs +++ b/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime::traits::Block as BlockT; use substrate_test_runtime_client::runtime::Block; diff --git a/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.stderr b/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.stderr index e9d550f3a3bcf841c15bba9c0422db2fcfc06e05..4c21a3afb9b6a2d13a7b3a0091dec785608c5a69 100644 --- a/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.stderr +++ b/substrate/primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.stderr @@ -1,39 +1,39 @@ error[E0053]: method `test` has an incompatible type for trait - --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:16:17 + --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:33:17 | -16 | fn test(data: &u64) { +33 | fn test(data: &u64) { | ^^^^ | | | expected `u64`, found `&u64` | help: change the parameter type to match the trait: `u64` | note: type in trait - --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:10:17 + --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:27:17 | -10 | fn test(data: u64); +27 | fn test(data: u64); | ^^^ = note: expected signature `fn(u64)` found signature `fn(&u64)` error[E0308]: mismatched types - --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:16:11 + --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:33:11 | -14 | / sp_api::impl_runtime_apis! { -15 | | impl self::Api for Runtime { -16 | | fn test(data: &u64) { +31 | / sp_api::impl_runtime_apis! { +32 | | impl self::Api for Runtime { +33 | | fn test(data: &u64) { | | ^^^^^^^ expected `u64`, found `&u64` -17 | | unimplemented!() +34 | | unimplemented!() ... | -31 | | } -32 | | } +48 | | } +49 | | } | |_- arguments to this function are incorrect | note: associated function defined here - --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:10:6 + --> tests/ui/type_reference_in_impl_runtime_apis_call.rs:27:6 | -10 | fn test(data: u64); +27 | fn test(data: u64); | ^^^^ help: consider removing the borrow | -16 | fn test(data: &u64) { +33 | fn test(data: &u64) { | diff --git a/substrate/primitives/application-crypto/Cargo.toml b/substrate/primitives/application-crypto/Cargo.toml index 0eea63fefcb86699f29ce2431b1a03307d4bd50c..7c5e317307790728977a1f069388dc671cceba87 100644 --- a/substrate/primitives/application-crypto/Cargo.toml +++ b/substrate/primitives/application-crypto/Cargo.toml @@ -18,7 +18,7 @@ targets = ["x86_64-unknown-linux-gnu"] sp-core = { path = "../core", default-features = false} codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, optional = true, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, optional = true, features = ["derive", "alloc"] } sp-std = { path = "../std", default-features = false} sp-io = { path = "../io", default-features = false} diff --git a/substrate/primitives/arithmetic/Cargo.toml b/substrate/primitives/arithmetic/Cargo.toml index ba7f6f8e1760cd2c51262f08c2a48b45734030b5..4c2a78aec6fbad473194dfe7acdd1e5b854a3363 100644 --- a/substrate/primitives/arithmetic/Cargo.toml +++ b/substrate/primitives/arithmetic/Cargo.toml @@ -21,7 +21,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = integer-sqrt = "0.1.2" num-traits = { version = "0.2.8", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } static_assertions = "1.1.0" sp-std = { path = "../std", default-features = false} diff --git a/substrate/primitives/consensus/babe/Cargo.toml b/substrate/primitives/consensus/babe/Cargo.toml index ba011c84ea5950684423af6ab3d3aaf67040ccff..764e95501801b5448abae882a4c30e30f9d0312b 100644 --- a/substrate/primitives/consensus/babe/Cargo.toml +++ b/substrate/primitives/consensus/babe/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } sp-api = { path = "../../api", default-features = false} sp-application-crypto = { path = "../../application-crypto", default-features = false} sp-consensus-slots = { path = "../slots", default-features = false} diff --git a/substrate/primitives/consensus/beefy/Cargo.toml b/substrate/primitives/consensus/beefy/Cargo.toml index 2c38917999f9a340222d2756d368ad316dd53544..6a12a5a7c7c522f9fb28740bc28544de32dc1c3d 100644 --- a/substrate/primitives/consensus/beefy/Cargo.toml +++ b/substrate/primitives/consensus/beefy/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, optional = true, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, optional = true, features = ["derive", "alloc"] } sp-api = { path = "../../api", default-features = false} sp-application-crypto = { path = "../../application-crypto", default-features = false} sp-core = { path = "../../core", default-features = false} diff --git a/substrate/primitives/consensus/grandpa/Cargo.toml b/substrate/primitives/consensus/grandpa/Cargo.toml index bf2ae2921a493afa897a28619865d06696077779..bee9092b986816a0609bf5aa490ce08135c7e1fd 100644 --- a/substrate/primitives/consensus/grandpa/Cargo.toml +++ b/substrate/primitives/consensus/grandpa/Cargo.toml @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = grandpa = { package = "finality-grandpa", version = "0.16.2", default-features = false, features = ["derive-codec"] } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", features = ["derive", "alloc"], default-features = false, optional = true } +serde = { version = "1.0.188", features = ["derive", "alloc"], default-features = false, optional = true } sp-api = { path = "../../api", default-features = false} sp-application-crypto = { path = "../../application-crypto", default-features = false} sp-core = { path = "../../core", default-features = false} diff --git a/substrate/primitives/consensus/sassafras/Cargo.toml b/substrate/primitives/consensus/sassafras/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..56ae0087099e144bfb00adb9055bc4a0c8bf25e6 --- /dev/null +++ b/substrate/primitives/consensus/sassafras/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "sp-consensus-sassafras" +version = "0.3.4-dev" +authors = ["Parity Technologies "] +description = "Primitives for Sassafras consensus" +edition = "2021" +license = "Apache-2.0" +homepage = "https://substrate.io" +repository = "https://github.com/paritytech/substrate/" +documentation = "https://docs.rs/sp-consensus-sassafras" +readme = "README.md" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +scale-codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.163", default-features = false, features = ["derive"], optional = true } +sp-api = { version = "4.0.0-dev", default-features = false, path = "../../api" } +sp-application-crypto = { version = "23.0.0", default-features = false, path = "../../application-crypto", features = ["bandersnatch-experimental"] } +sp-consensus-slots = { version = "0.10.0-dev", default-features = false, path = "../slots" } +sp-core = { version = "21.0.0", default-features = false, path = "../../core", features = ["bandersnatch-experimental"] } +sp-runtime = { version = "24.0.0", default-features = false, path = "../../runtime" } +sp-std = { version = "8.0.0", default-features = false, path = "../../std" } + +[features] +default = [ "std" ] +std = [ + "scale-codec/std", + "scale-info/std", + "serde/std", + "sp-api/std", + "sp-application-crypto/std", + "sp-consensus-slots/std", + "sp-core/std", + "sp-runtime/std", + "sp-std/std", +] + +# Serde support without relying on std features. +serde = [ + "dep:serde", + "scale-info/serde", + "sp-application-crypto/serde", + "sp-consensus-slots/serde", + "sp-core/serde", + "sp-runtime/serde", +] diff --git a/substrate/primitives/consensus/sassafras/README.md b/substrate/primitives/consensus/sassafras/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5024d1bf700dc7e48f55b40bc346ed76f5ed9862 --- /dev/null +++ b/substrate/primitives/consensus/sassafras/README.md @@ -0,0 +1,12 @@ +Primitives for SASSAFRAS. + +# ⚠️ WARNING ⚠️ + +The crate interfaces and structures are highly experimental and may be subject +to significant changes. + +Depends on upstream experimental feature: `bandersnatch-experimental`. + +These structs were mostly extracted from the main SASSAFRAS protocol PR: https://github.com/paritytech/substrate/pull/11879. + +Tracking issue: https://github.com/paritytech/polkadot-sdk/issues/41 diff --git a/substrate/primitives/consensus/sassafras/src/digests.rs b/substrate/primitives/consensus/sassafras/src/digests.rs new file mode 100644 index 0000000000000000000000000000000000000000..95a305099de553cbe263fc1acd5605d1670d638b --- /dev/null +++ b/substrate/primitives/consensus/sassafras/src/digests.rs @@ -0,0 +1,98 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Sassafras digests structures and helpers. + +use crate::{ + ticket::TicketClaim, vrf::VrfSignature, AuthorityId, AuthorityIndex, AuthoritySignature, + EpochConfiguration, Randomness, Slot, SASSAFRAS_ENGINE_ID, +}; + +use scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; + +use sp_runtime::{DigestItem, RuntimeDebug}; +use sp_std::vec::Vec; + +/// Epoch slot claim digest entry. +/// +/// This is mandatory for each block. +#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +pub struct SlotClaim { + /// Authority index that claimed the slot. + pub authority_idx: AuthorityIndex, + /// Corresponding slot number. + pub slot: Slot, + /// Slot claim VRF signature. + pub vrf_signature: VrfSignature, + /// Ticket auxiliary information for claim check. + pub ticket_claim: Option, +} + +/// Information about the next epoch. +/// +/// This is mandatory in the first block of each epoch. +#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)] +pub struct NextEpochDescriptor { + /// Authorities list. + pub authorities: Vec, + /// Epoch randomness. + pub randomness: Randomness, + /// Epoch configurable parameters. + /// + /// If not present previous epoch parameters are used. + pub config: Option, +} + +/// Runtime digest entries. +/// +/// Entries which may be generated by on-chain code. +#[derive(Decode, Encode, Clone, PartialEq, Eq)] +pub enum ConsensusLog { + /// Provides information about the next epoch parameters. + #[codec(index = 1)] + NextEpochData(NextEpochDescriptor), + /// Disable the authority with given index. + #[codec(index = 2)] + OnDisabled(AuthorityIndex), +} + +impl TryFrom<&DigestItem> for SlotClaim { + type Error = (); + fn try_from(item: &DigestItem) -> Result { + item.pre_runtime_try_to(&SASSAFRAS_ENGINE_ID).ok_or(()) + } +} + +impl From<&SlotClaim> for DigestItem { + fn from(claim: &SlotClaim) -> Self { + DigestItem::PreRuntime(SASSAFRAS_ENGINE_ID, claim.encode()) + } +} + +impl TryFrom<&DigestItem> for AuthoritySignature { + type Error = (); + fn try_from(item: &DigestItem) -> Result { + item.seal_try_to(&SASSAFRAS_ENGINE_ID).ok_or(()) + } +} + +impl From<&AuthoritySignature> for DigestItem { + fn from(signature: &AuthoritySignature) -> Self { + DigestItem::Seal(SASSAFRAS_ENGINE_ID, signature.encode()) + } +} diff --git a/substrate/primitives/consensus/sassafras/src/lib.rs b/substrate/primitives/consensus/sassafras/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..e421e771d406a197cb30429a43b5c57d7f48b9de --- /dev/null +++ b/substrate/primitives/consensus/sassafras/src/lib.rs @@ -0,0 +1,169 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Primitives for Sassafras consensus. + +#![deny(warnings)] +#![forbid(unsafe_code, missing_docs, unused_variables, unused_imports)] +#![cfg_attr(not(feature = "std"), no_std)] + +use scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_core::crypto::KeyTypeId; +use sp_runtime::{ConsensusEngineId, RuntimeDebug}; +use sp_std::vec::Vec; + +pub use sp_consensus_slots::{Slot, SlotDuration}; + +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + +pub mod digests; +pub mod ticket; +pub mod vrf; + +pub use ticket::{ + ticket_id_threshold, EphemeralPublic, EphemeralSignature, TicketBody, TicketClaim, + TicketEnvelope, TicketId, +}; + +mod app { + use sp_application_crypto::{app_crypto, bandersnatch, key_types::SASSAFRAS}; + app_crypto!(bandersnatch, SASSAFRAS); +} + +/// Key type identifier. +pub const KEY_TYPE: KeyTypeId = sp_application_crypto::key_types::SASSAFRAS; + +/// Consensus engine identifier. +pub const SASSAFRAS_ENGINE_ID: ConsensusEngineId = *b"SASS"; + +/// VRF output length for per-slot randomness. +pub const RANDOMNESS_LENGTH: usize = 32; + +/// Index of an authority. +pub type AuthorityIndex = u32; + +/// Sassafras authority keypair. Necessarily equivalent to the schnorrkel public key used in +/// the main Sassafras module. If that ever changes, then this must, too. +#[cfg(feature = "std")] +pub type AuthorityPair = app::Pair; + +/// Sassafras authority signature. +pub type AuthoritySignature = app::Signature; + +/// Sassafras authority identifier. Necessarily equivalent to the schnorrkel public key used in +/// the main Sassafras module. If that ever changes, then this must, too. +pub type AuthorityId = app::Public; + +/// Weight of a Sassafras block. +/// Primary blocks have a weight of 1 whereas secondary blocks have a weight of 0. +pub type SassafrasBlockWeight = u32; + +/// An equivocation proof for multiple block authorships on the same slot (i.e. double vote). +pub type EquivocationProof = sp_consensus_slots::EquivocationProof; + +/// Randomness required by some protocol's operations. +pub type Randomness = [u8; RANDOMNESS_LENGTH]; + +/// Configuration data that can be modified on epoch change. +#[derive( + Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo, Default, +)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub struct EpochConfiguration { + /// Tickets threshold redundancy factor. + pub redundancy_factor: u32, + /// Tickets attempts for each validator. + pub attempts_number: u32, +} + +/// Sassafras epoch information +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, TypeInfo)] +pub struct Epoch { + /// The epoch index. + pub epoch_idx: u64, + /// The starting slot of the epoch. + pub start_slot: Slot, + /// Slot duration in milliseconds. + pub slot_duration: SlotDuration, + /// Duration of epoch in slots. + pub epoch_duration: u64, + /// Authorities for the epoch. + pub authorities: Vec, + /// Randomness for the epoch. + pub randomness: Randomness, + /// Epoch configuration. + pub config: EpochConfiguration, +} + +/// An opaque type used to represent the key ownership proof at the runtime API boundary. +/// +/// The inner value is an encoded representation of the actual key ownership proof which will be +/// parameterized when defining the runtime. At the runtime API boundary this type is unknown and +/// as such we keep this opaque representation, implementors of the runtime API will have to make +/// sure that all usages of `OpaqueKeyOwnershipProof` refer to the same type. +#[derive(Decode, Encode, PartialEq, TypeInfo)] +#[repr(transparent)] +pub struct OpaqueKeyOwnershipProof(Vec); + +// Runtime API. +sp_api::decl_runtime_apis! { + /// API necessary for block authorship with Sassafras. + pub trait SassafrasApi { + /// Get ring context to be used for ticket construction and verification. + fn ring_context() -> Option; + + /// Submit next epoch validator tickets via an unsigned extrinsic. + /// This method returns `false` when creation of the extrinsics fails. + fn submit_tickets_unsigned_extrinsic(tickets: Vec) -> bool; + + /// Get ticket id associated to the given slot. + fn slot_ticket_id(slot: Slot) -> Option; + + /// Get ticket id and data associated to the given slot. + fn slot_ticket(slot: Slot) -> Option<(TicketId, TicketBody)>; + + /// Current epoch information. + fn current_epoch() -> Epoch; + + /// Next epoch information. + fn next_epoch() -> Epoch; + + /// Generates a proof of key ownership for the given authority in the current epoch. + /// + /// An example usage of this module is coupled with the session historical module to prove + /// that a given authority key is tied to a given staking identity during a specific + /// session. + /// + /// Proofs of key ownership are necessary for submitting equivocation reports. + fn generate_key_ownership_proof(authority_id: AuthorityId) -> Option; + + /// Submits an unsigned extrinsic to report an equivocation. + /// + /// The caller must provide the equivocation proof and a key ownership proof (should be + /// obtained using `generate_key_ownership_proof`). The extrinsic will be unsigned and + /// should only be accepted for local authorship (not to be broadcast to the network). This + /// method returns `false` when creation of the extrinsic fails. + /// + /// Only useful in an offchain context. + fn submit_report_equivocation_unsigned_extrinsic( + equivocation_proof: EquivocationProof, + key_owner_proof: OpaqueKeyOwnershipProof, + ) -> bool; + } +} diff --git a/substrate/primitives/consensus/sassafras/src/ticket.rs b/substrate/primitives/consensus/sassafras/src/ticket.rs new file mode 100644 index 0000000000000000000000000000000000000000..d81770c96d9bbec9dc8a625e048173d705a9f7cb --- /dev/null +++ b/substrate/primitives/consensus/sassafras/src/ticket.rs @@ -0,0 +1,91 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Primitives related to tickets. + +use crate::vrf::RingVrfSignature; +use scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; + +pub use sp_core::ed25519::{Public as EphemeralPublic, Signature as EphemeralSignature}; + +/// Ticket identifier. +/// +/// Its value is the output of a VRF whose inputs cannot be controlled by the +/// ticket's creator (refer to [`crate::vrf::ticket_id_input`] parameters). +/// Because of this, it is also used as the ticket score to compare against +/// the epoch ticket's threshold to decide if the ticket is worth being considered +/// for slot assignment (refer to [`ticket_id_threshold`]). +pub type TicketId = u128; + +/// Ticket data persisted on-chain. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +pub struct TicketBody { + /// Attempt index. + pub attempt_idx: u32, + /// Ephemeral public key which gets erased when the ticket is claimed. + pub erased_public: EphemeralPublic, + /// Ephemeral public key which gets exposed when the ticket is claimed. + pub revealed_public: EphemeralPublic, +} + +/// Ticket ring vrf signature. +pub type TicketSignature = RingVrfSignature; + +/// Ticket envelope used on during submission. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +pub struct TicketEnvelope { + /// Ticket body. + pub body: TicketBody, + /// Ring signature. + pub signature: TicketSignature, +} + +/// Ticket claim information filled by the block author. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +pub struct TicketClaim { + /// Signature verified via `TicketBody::erased_public`. + pub erased_signature: EphemeralSignature, +} + +/// Computes ticket-id maximum allowed value for a given epoch. +/// +/// Only ticket identifiers below this threshold should be considered for slot +/// assignment. +/// +/// The value is computed as `TicketId::MAX*(redundancy*slots)/(attempts*validators)` +/// +/// Where: +/// - `redundancy`: redundancy factor; +/// - `slots`: number of slots in epoch; +/// - `attempts`: max number of tickets attempts per validator; +/// - `validators`: number of validators in epoch. +/// +/// If `attempts * validators = 0` then we return 0. +pub fn ticket_id_threshold( + redundancy: u32, + slots: u32, + attempts: u32, + validators: u32, +) -> TicketId { + let den = attempts as u64 * validators as u64; + let num = redundancy as u64 * slots as u64; + TicketId::max_value() + .checked_div(den.into()) + .unwrap_or_default() + .saturating_mul(num.into()) +} diff --git a/substrate/primitives/consensus/sassafras/src/vrf.rs b/substrate/primitives/consensus/sassafras/src/vrf.rs new file mode 100644 index 0000000000000000000000000000000000000000..d25a656f9508f7090755af20cfa0418b5954015e --- /dev/null +++ b/substrate/primitives/consensus/sassafras/src/vrf.rs @@ -0,0 +1,104 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Utilities related to VRF input, output and signatures. + +use crate::{Randomness, TicketBody, TicketId}; +use scale_codec::Encode; +use sp_consensus_slots::Slot; +use sp_std::vec::Vec; + +pub use sp_core::bandersnatch::{ + ring_vrf::{RingContext, RingProver, RingVerifier, RingVrfSignature}, + vrf::{VrfInput, VrfOutput, VrfSignData, VrfSignature}, +}; + +fn vrf_input_from_data( + domain: &[u8], + data: impl IntoIterator>, +) -> VrfInput { + let buf = data.into_iter().fold(Vec::new(), |mut buf, item| { + let bytes = item.as_ref(); + buf.extend_from_slice(bytes); + let len = u8::try_from(bytes.len()).expect("private function with well known inputs; qed"); + buf.push(len); + buf + }); + VrfInput::new(domain, buf) +} + +/// VRF input to claim slot ownership during block production. +pub fn slot_claim_input(randomness: &Randomness, slot: Slot, epoch: u64) -> VrfInput { + vrf_input_from_data( + b"sassafras-claim-v1.0", + [randomness.as_slice(), &slot.to_le_bytes(), &epoch.to_le_bytes()], + ) +} + +/// Signing-data to claim slot ownership during block production. +pub fn slot_claim_sign_data(randomness: &Randomness, slot: Slot, epoch: u64) -> VrfSignData { + let input = slot_claim_input(randomness, slot, epoch); + VrfSignData::new_unchecked( + b"sassafras-slot-claim-transcript-v1.0", + Option::<&[u8]>::None, + Some(input), + ) +} + +/// VRF input to generate the ticket id. +pub fn ticket_id_input(randomness: &Randomness, attempt: u32, epoch: u64) -> VrfInput { + vrf_input_from_data( + b"sassafras-ticket-v1.0", + [randomness.as_slice(), &attempt.to_le_bytes(), &epoch.to_le_bytes()], + ) +} + +/// VRF input to generate the revealed key. +pub fn revealed_key_input(randomness: &Randomness, attempt: u32, epoch: u64) -> VrfInput { + vrf_input_from_data( + b"sassafras-revealed-v1.0", + [randomness.as_slice(), &attempt.to_le_bytes(), &epoch.to_le_bytes()], + ) +} + +/// Data to be signed via ring-vrf. +pub fn ticket_body_sign_data(ticket_body: &TicketBody, ticket_id_input: VrfInput) -> VrfSignData { + VrfSignData::new_unchecked( + b"sassafras-ticket-body-transcript-v1.0", + Some(ticket_body.encode().as_slice()), + Some(ticket_id_input), + ) +} + +/// Make ticket-id from the given VRF input and output. +/// +/// Input should have been obtained via [`ticket_id_input`]. +/// Output should have been obtained from the input directly using the vrf secret key +/// or from the vrf signature outputs. +pub fn make_ticket_id(input: &VrfInput, output: &VrfOutput) -> TicketId { + let bytes = output.make_bytes::<16>(b"ticket-id", input); + u128::from_le_bytes(bytes) +} + +/// Make revealed key seed from a given VRF input and ouput. +/// +/// Input should have been obtained via [`revealed_key_input`]. +/// Output should have been obtained from the input directly using the vrf secret key +/// or from the vrf signature outputs. +pub fn make_revealed_key_seed(input: &VrfInput, output: &VrfOutput) -> [u8; 32] { + output.make_bytes::<32>(b"revealed-seed", input) +} diff --git a/substrate/primitives/core/Cargo.toml b/substrate/primitives/core/Cargo.toml index 4300c6a08fa7b4d796b8c8f95069a23f4c7ef0d5..efcaad1a6f610795d4bc15cde487070633a2854b 100644 --- a/substrate/primitives/core/Cargo.toml +++ b/substrate/primitives/core/Cargo.toml @@ -17,13 +17,13 @@ arrayvec = { version = "0.7.2", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive","max-encoded-len"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -serde = { version = "1.0.163", optional = true, default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.188", optional = true, default-features = false, features = ["derive", "alloc"] } bounded-collections = { version = "0.1.8", default-features = false } primitive-types = { version = "0.12.0", default-features = false, features = ["codec", "scale-info"] } impl-serde = { version = "0.4.0", default-features = false, optional = true } hash-db = { version = "0.16.0", default-features = false } hash256-std-hasher = { version = "0.15.2", default-features = false } -bs58 = { version = "0.4.0", default-features = false, optional = true } +bs58 = { version = "0.5.0", default-features = false, optional = true } rand = { version = "0.8.5", features = ["small_rng"], optional = true } substrate-bip39 = { version = "0.4.4", optional = true } tiny-bip39 = { version = "1.0.0", optional = true } @@ -58,7 +58,7 @@ sp-runtime-interface = { path = "../runtime-interface", default-features = false # bls crypto w3f-bls = { version = "0.1.3", default-features = false, optional = true} # bandersnatch crypto -bandersnatch_vrfs = { git = "https://github.com/w3f/ring-vrf", rev = "c86ebd4", default-features = false, optional = true } +bandersnatch_vrfs = { git = "https://github.com/w3f/ring-vrf", rev = "3119f51", default-features = false, optional = true } [dev-dependencies] criterion = "0.4.0" diff --git a/substrate/primitives/core/benches/bench.rs b/substrate/primitives/core/benches/bench.rs index e91c1758c3cbb070ea455f6d1bd4b0baeb4a85aa..ffca819b638e56fd329a3184b962ae568bae9102 100644 --- a/substrate/primitives/core/benches/bench.rs +++ b/substrate/primitives/core/benches/bench.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/substrate/primitives/core/src/bandersnatch.rs b/substrate/primitives/core/src/bandersnatch.rs index c3ba7f41058e96eda10c13cf847c9137a5dcba38..01f3538188a462ed465356fb4be75eab7223c78c 100644 --- a/substrate/primitives/core/src/bandersnatch.rs +++ b/substrate/primitives/core/src/bandersnatch.rs @@ -18,7 +18,7 @@ //! VRFs backed by [Bandersnatch](https://neuromancer.sk/std/bls/Bandersnatch), //! an elliptic curve built over BLS12-381 scalar field. //! -//! The primitive can operate both as a traditional VRF or as an anonymized ring VRF. +//! The primitive can operate both as a regular VRF or as an anonymized Ring VRF. #[cfg(feature = "std")] use crate::crypto::Ss58Codec; @@ -31,7 +31,7 @@ use crate::crypto::{DeriveError, DeriveJunction, Pair as TraitPair, SecretString use bandersnatch_vrfs::CanonicalSerialize; #[cfg(feature = "full_crypto")] use bandersnatch_vrfs::SecretKey; -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime_interface::pass_by::PassByInner; @@ -42,7 +42,7 @@ pub const CRYPTO_ID: CryptoTypeId = CryptoTypeId(*b"band"); /// Context used to produce a plain signature without any VRF input/output. #[cfg(feature = "full_crypto")] -pub const SIGNING_CTX: &[u8] = b"SigningContext"; +pub const SIGNING_CTX: &[u8] = b"BandersnatchSigningContext"; // Max ring domain size. const RING_DOMAIN_SIZE: usize = 1024; @@ -153,7 +153,8 @@ impl sp_std::fmt::Debug for Public { /// Bandersnatch signature. /// -/// The signature is created via the [`VrfSecret::vrf_sign`] using [`SIGNING_CTX`] as `label`. +/// The signature is created via the [`VrfSecret::vrf_sign`] using [`SIGNING_CTX`] as transcript +/// `label`. #[cfg_attr(feature = "full_crypto", derive(Hash))] #[derive(Clone, Copy, PartialEq, Eq, Encode, Decode, PassByInner, MaxEncodedLen, TypeInfo)] pub struct Signature([u8; SIGNATURE_SERIALIZED_LEN]); @@ -238,7 +239,7 @@ impl TraitPair for Pair { /// Make a new key pair from secret seed material. /// - /// The slice must be 64 bytes long or it will return an error. + /// The slice must be 32 bytes long or it will return an error. fn from_seed_slice(seed_slice: &[u8]) -> Result { if seed_slice.len() != SEED_SERIALIZED_LEN { return Err(SecretStringError::InvalidSeedLength) @@ -272,7 +273,6 @@ impl TraitPair for Pair { Ok((Self::from_seed(&seed), Some(seed))) } - /// Get the public key. fn public(&self) -> Public { let public = self.secret.to_public(); let mut raw = [0; PUBLIC_SERIALIZED_LEN]; @@ -282,23 +282,25 @@ impl TraitPair for Pair { Public::unchecked_from(raw) } - /// Sign raw data. + /// Sign a message. + /// + /// In practice this produce a Schnorr signature of a transcript composed by + /// the constant label [`SIGNING_CTX`] and `data` without any additional data. + /// + /// See [`vrf::VrfSignData`] for additional details. fn sign(&self, data: &[u8]) -> Signature { let data = vrf::VrfSignData::new_unchecked(SIGNING_CTX, &[data], None); self.vrf_sign(&data).signature } - /// Verify a signature on a message. - /// - /// Returns `true` if the signature is good. fn verify>(signature: &Signature, data: M, public: &Public) -> bool { let data = vrf::VrfSignData::new_unchecked(SIGNING_CTX, &[data.as_ref()], None); let signature = - vrf::VrfSignature { signature: *signature, vrf_outputs: vrf::VrfIosVec::default() }; + vrf::VrfSignature { signature: *signature, outputs: vrf::VrfIosVec::default() }; public.vrf_verify(&data, &signature) } - /// Return a vector filled with seed raw data. + /// Return a vector filled with the seed (32 bytes). fn to_raw_vec(&self) -> Vec { self.seed().to_vec() } @@ -319,7 +321,8 @@ pub mod vrf { }; /// Max number of inputs/outputs which can be handled by the VRF signing procedures. - /// The number is quite arbitrary and fullfils the current usage of the primitive. + /// + /// The number is quite arbitrary and chosen to fulfill the use cases found so far. /// If required it can be extended in the future. pub const MAX_VRF_IOS: u32 = 3; @@ -328,7 +331,7 @@ pub mod vrf { /// Can contain at most [`MAX_VRF_IOS`] elements. pub type VrfIosVec = BoundedVec>; - /// VRF input to construct a [`VrfOutput`] instance and embeddable within [`VrfSignData`]. + /// VRF input to construct a [`VrfOutput`] instance and embeddable in [`VrfSignData`]. #[derive(Clone, Debug)] pub struct VrfInput(pub(super) bandersnatch_vrfs::VrfInput); @@ -342,7 +345,9 @@ pub mod vrf { /// VRF (pre)output derived from [`VrfInput`] using a [`VrfSecret`]. /// - /// This is used to produce an arbitrary number of verifiable *random* bytes. + /// This object is used to produce an arbitrary number of verifiable pseudo random + /// bytes and is often called pre-output to emphasize that this is not the actual + /// output of the VRF but an object capable of generating the output. #[derive(Clone, Debug, PartialEq, Eq)] pub struct VrfOutput(pub(super) bandersnatch_vrfs::VrfPreOut); @@ -379,92 +384,102 @@ pub mod vrf { } } - /// A *Fiat-Shamir* transcript and a sequence of [`VrfInput`]s ready to be signed. + /// Data to be signed via one of the two provided vrf flavors. + /// + /// The object contains a transcript and a sequence of [`VrfInput`]s ready to be signed. /// - /// The `transcript` will be used as messages for the *Fiat-Shamir* - /// transform part of the scheme. This data keeps the signature secure - /// but doesn't contribute to the actual VRF output. If unsure just give - /// it a unique label depending on the actual usage of the signing data. + /// The `transcript` summarizes a set of messages which are defining a particular + /// protocol by automating the Fiat-Shamir transform for challenge generation. + /// A good explaination of the topic can be found in Merlin [docs](https://merlin.cool/) /// - /// The `vrf_inputs` is a sequence of [`VrfInput`]s to be signed and which - /// are used to construct the [`VrfOutput`]s in the signature. + /// The `inputs` is a sequence of [`VrfInput`]s which, during the signing procedure, are + /// first transformed to [`VrfOutput`]s. Both inputs and outputs are then appended to + /// the transcript before signing the Fiat-Shamir transform result (the challenge). + /// + /// In practice, as a user, all these technical details can be easily ignored. + /// What is important to remember is: + /// - *Transcript* is an object defining the protocol and used to produce the signature. This + /// object doesn't influence the `VrfOutput`s values. + /// - *Vrf inputs* is some additional data which is used to produce *vrf outputs*. This data + /// will contribute to the signature as well. #[derive(Clone)] pub struct VrfSignData { /// VRF inputs to be signed. - pub vrf_inputs: VrfIosVec, - /// Associated Fiat-Shamir transcript. + pub inputs: VrfIosVec, + /// Associated protocol transcript. pub transcript: Transcript, } impl VrfSignData { /// Construct a new data to be signed. /// - /// The `transcript_data` is used to construct the *Fiat-Shamir* `Transcript`. - /// Fails if the `vrf_inputs` yields more elements than [`MAX_VRF_IOS`] + /// Fails if the `inputs` iterator yields more elements than [`MAX_VRF_IOS`] /// - /// Refer to the [`VrfSignData`] for more details about the usage of - /// `transcript_data` and `vrf_inputs` + /// Refer to [`VrfSignData`] for details about transcript and inputs. pub fn new( - label: &'static [u8], + transcript_label: &'static [u8], transcript_data: impl IntoIterator>, - vrf_inputs: impl IntoIterator, + inputs: impl IntoIterator, ) -> Result { - let vrf_inputs: Vec = vrf_inputs.into_iter().collect(); - if vrf_inputs.len() > MAX_VRF_IOS as usize { + let inputs: Vec = inputs.into_iter().collect(); + if inputs.len() > MAX_VRF_IOS as usize { return Err(()) } - Ok(Self::new_unchecked(label, transcript_data, vrf_inputs)) + Ok(Self::new_unchecked(transcript_label, transcript_data, inputs)) } /// Construct a new data to be signed. /// - /// The `transcript_data` is used to construct the *Fiat-Shamir* `Transcript`. - /// At most the first [`MAX_VRF_IOS`] elements of `vrf_inputs` are used. + /// At most the first [`MAX_VRF_IOS`] elements of `inputs` are used. /// - /// Refer to the [`VrfSignData`] for more details about the usage of - /// `transcript_data` and `vrf_inputs` + /// Refer to [`VrfSignData`] for details about transcript and inputs. pub fn new_unchecked( - label: &'static [u8], + transcript_label: &'static [u8], transcript_data: impl IntoIterator>, - vrf_inputs: impl IntoIterator, + inputs: impl IntoIterator, ) -> Self { - let vrf_inputs: Vec = vrf_inputs.into_iter().collect(); - let vrf_inputs = VrfIosVec::truncate_from(vrf_inputs); - let mut transcript = Transcript::new_labeled(label); - transcript_data - .into_iter() - .for_each(|data| transcript.append_slice(data.as_ref())); - VrfSignData { transcript, vrf_inputs } + let inputs: Vec = inputs.into_iter().collect(); + let inputs = VrfIosVec::truncate_from(inputs); + let mut transcript = Transcript::new_labeled(transcript_label); + transcript_data.into_iter().for_each(|data| transcript.append(data.as_ref())); + VrfSignData { transcript, inputs } } - /// Append a raw message to the transcript. + /// Append a message to the transcript. pub fn push_transcript_data(&mut self, data: &[u8]) { - self.transcript.append_slice(data); + self.transcript.append(data); } - /// Append a [`VrfInput`] to the vrf inputs to be signed. + /// Tries to append a [`VrfInput`] to the vrf inputs list. /// - /// On failure, gives back the [`VrfInput`] parameter. - pub fn push_vrf_input(&mut self, vrf_input: VrfInput) -> Result<(), VrfInput> { - self.vrf_inputs.try_push(vrf_input) + /// On failure, returns back the [`VrfInput`] parameter. + pub fn push_vrf_input(&mut self, input: VrfInput) -> Result<(), VrfInput> { + self.inputs.try_push(input) } - /// Create challenge from the transcript contained within the signing data. + /// Get the challenge associated to the `transcript` contained within the signing data. + /// + /// Ignores the vrf inputs and outputs. pub fn challenge(&self) -> [u8; N] { let mut output = [0; N]; let mut transcript = self.transcript.clone(); - let mut reader = transcript.challenge(b"Prehashed for bandersnatch"); + let mut reader = transcript.challenge(b"bandersnatch challenge"); reader.read_bytes(&mut output); output } } /// VRF signature. + /// + /// Includes both the transcript `signature` and the `outputs` generated from the + /// [`VrfSignData::inputs`]. + /// + /// Refer to [`VrfSignData`] for more details. #[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct VrfSignature { /// VRF (pre)outputs. - pub vrf_outputs: VrfIosVec, - /// VRF signature. + pub outputs: VrfIosVec, + /// Transcript signature. pub signature: Signature, } @@ -481,7 +496,7 @@ pub mod vrf { fn vrf_sign(&self, data: &Self::VrfSignData) -> Self::VrfSignature { const _: () = assert!(MAX_VRF_IOS == 3, "`MAX_VRF_IOS` expected to be 3"); // Workaround to overcome backend signature generic over the number of IOs. - match data.vrf_inputs.len() { + match data.inputs.len() { 0 => self.vrf_sign_gen::<0>(data), 1 => self.vrf_sign_gen::<1>(data), 2 => self.vrf_sign_gen::<2>(data), @@ -506,12 +521,12 @@ pub mod vrf { impl VrfPublic for Public { fn vrf_verify(&self, data: &Self::VrfSignData, signature: &Self::VrfSignature) -> bool { const _: () = assert!(MAX_VRF_IOS == 3, "`MAX_VRF_IOS` expected to be 3"); - let preouts_len = signature.vrf_outputs.len(); - if preouts_len != data.vrf_inputs.len() { + let outputs_len = signature.outputs.len(); + if outputs_len != data.inputs.len() { return false } // Workaround to overcome backend signature generic over the number of IOs. - match preouts_len { + match outputs_len { 0 => self.vrf_verify_gen::<0>(data, signature), 1 => self.vrf_verify_gen::<1>(data, signature), 2 => self.vrf_verify_gen::<2>(data, signature), @@ -525,7 +540,7 @@ pub mod vrf { impl Pair { fn vrf_sign_gen(&self, data: &VrfSignData) -> VrfSignature { let ios: Vec<_> = data - .vrf_inputs + .inputs .iter() .map(|i| self.secret.clone().0.vrf_inout(i.0.clone())) .collect(); @@ -541,7 +556,7 @@ pub mod vrf { let outputs: Vec<_> = signature.preoutputs.into_iter().map(VrfOutput).collect(); let outputs = VrfIosVec::truncate_from(outputs); - VrfSignature { signature: Signature(sign_bytes), vrf_outputs: outputs } + VrfSignature { signature: Signature(sign_bytes), outputs } } /// Generate an arbitrary number of bytes from the given `context` and VRF `input`. @@ -567,7 +582,7 @@ pub mod vrf { }; let Ok(preouts) = signature - .vrf_outputs + .outputs .iter() .map(|o| o.0.clone()) .collect::>() @@ -587,7 +602,7 @@ pub mod vrf { }; let signature = ThinVrfSignature { signature, preoutputs: preouts }; - let inputs = data.vrf_inputs.iter().map(|i| i.0.clone()); + let inputs = data.inputs.iter().map(|i| i.0.clone()); signature.verify_thin_vrf(data.transcript.clone(), inputs, &public).is_ok() } @@ -675,6 +690,8 @@ pub mod ring_vrf { } } + impl EncodeLike for RingContext {} + impl MaxEncodedLen for RingContext { fn max_encoded_len() -> usize { <[u8; RING_CONTEXT_SERIALIZED_LEN]>::max_encoded_len() @@ -695,9 +712,9 @@ pub mod ring_vrf { /// VRF (pre)outputs. pub outputs: VrfIosVec, /// Pedersen VRF signature. - signature: [u8; PEDERSEN_SIGNATURE_SERIALIZED_LEN], + pub signature: [u8; PEDERSEN_SIGNATURE_SERIALIZED_LEN], /// Ring proof. - ring_proof: [u8; RING_PROOF_SERIALIZED_LEN], + pub ring_proof: [u8; RING_PROOF_SERIALIZED_LEN], } #[cfg(feature = "full_crypto")] @@ -710,7 +727,7 @@ pub mod ring_vrf { pub fn ring_vrf_sign(&self, data: &VrfSignData, prover: &RingProver) -> RingVrfSignature { const _: () = assert!(MAX_VRF_IOS == 3, "`MAX_VRF_IOS` expected to be 3"); // Workaround to overcome backend signature generic over the number of IOs. - match data.vrf_inputs.len() { + match data.inputs.len() { 0 => self.ring_vrf_sign_gen::<0>(data, prover), 1 => self.ring_vrf_sign_gen::<1>(data, prover), 2 => self.ring_vrf_sign_gen::<2>(data, prover), @@ -725,7 +742,7 @@ pub mod ring_vrf { prover: &RingProver, ) -> RingVrfSignature { let ios: Vec<_> = data - .vrf_inputs + .inputs .iter() .map(|i| self.secret.clone().0.vrf_inout(i.0.clone())) .collect(); @@ -760,7 +777,7 @@ pub mod ring_vrf { pub fn verify(&self, data: &VrfSignData, verifier: &RingVerifier) -> bool { const _: () = assert!(MAX_VRF_IOS == 3, "`MAX_VRF_IOS` expected to be 3"); let preouts_len = self.outputs.len(); - if preouts_len != data.vrf_inputs.len() { + if preouts_len != data.inputs.len() { return false } // Workaround to overcome backend signature generic over the number of IOs. @@ -798,7 +815,7 @@ pub mod ring_vrf { let ring_signature = bandersnatch_vrfs::RingVrfSignature { signature, preoutputs, ring_proof }; - let inputs = data.vrf_inputs.iter().map(|i| i.0.clone()); + let inputs = data.inputs.iter().map(|i| i.0.clone()); ring_signature .verify_ring_vrf(data.transcript.clone(), inputs, verifier) @@ -910,11 +927,11 @@ mod tests { let signature = pair.vrf_sign(&data); let o10 = pair.make_bytes::<32>(b"ctx1", &i1); - let o11 = signature.vrf_outputs[0].make_bytes::<32>(b"ctx1", &i1); + let o11 = signature.outputs[0].make_bytes::<32>(b"ctx1", &i1); assert_eq!(o10, o11); let o20 = pair.make_bytes::<48>(b"ctx2", &i2); - let o21 = signature.vrf_outputs[1].make_bytes::<48>(b"ctx2", &i2); + let o21 = signature.outputs[1].make_bytes::<48>(b"ctx2", &i2); assert_eq!(o20, o21); } @@ -932,8 +949,7 @@ mod tests { let bytes = expected.encode(); - let expected_len = - data.vrf_inputs.len() * PREOUT_SERIALIZED_LEN + SIGNATURE_SERIALIZED_LEN + 1; + let expected_len = data.inputs.len() * PREOUT_SERIALIZED_LEN + SIGNATURE_SERIALIZED_LEN + 1; assert_eq!(bytes.len(), expected_len); let decoded = VrfSignature::decode(&mut bytes.as_slice()).unwrap(); @@ -993,6 +1009,35 @@ mod tests { assert!(!signature.verify(&data, &verifier)); } + #[test] + fn ring_vrf_make_bytes_matches() { + let ring_ctx = RingContext::new_testing(); + + let mut pks: Vec<_> = (0..16).map(|i| Pair::from_seed(&[i as u8; 32]).public()).collect(); + assert!(pks.len() <= ring_ctx.max_keyset_size()); + + let pair = Pair::from_seed(DEV_SEED); + + // Just pick one index to patch with the actual public key + let prover_idx = 3; + pks[prover_idx] = pair.public(); + + let i1 = VrfInput::new(b"dom1", b"foo"); + let i2 = VrfInput::new(b"dom2", b"bar"); + let data = VrfSignData::new_unchecked(b"mydata", &[b"tdata"], [i1.clone(), i2.clone()]); + + let prover = ring_ctx.prover(&pks, prover_idx).unwrap(); + let signature = pair.ring_vrf_sign(&data, &prover); + + let o10 = pair.make_bytes::<32>(b"ctx1", &i1); + let o11 = signature.outputs[0].make_bytes::<32>(b"ctx1", &i1); + assert_eq!(o10, o11); + + let o20 = pair.make_bytes::<48>(b"ctx2", &i2); + let o21 = signature.outputs[1].make_bytes::<48>(b"ctx2", &i2); + assert_eq!(o20, o21); + } + #[test] fn encode_decode_ring_vrf_signature() { let ring_ctx = RingContext::new_testing(); @@ -1017,7 +1062,7 @@ mod tests { let bytes = expected.encode(); - let expected_len = data.vrf_inputs.len() * PREOUT_SERIALIZED_LEN + + let expected_len = data.inputs.len() * PREOUT_SERIALIZED_LEN + PEDERSEN_SIGNATURE_SERIALIZED_LEN + RING_PROOF_SERIALIZED_LEN + 1; diff --git a/substrate/primitives/core/src/crypto.rs b/substrate/primitives/core/src/crypto.rs index 6afe4b752a690b7b625787ca295f14e210201388..8c7d98f00cd89d3c3b65a3927bfd83d5e1136154 100644 --- a/substrate/primitives/core/src/crypto.rs +++ b/substrate/primitives/core/src/crypto.rs @@ -1136,6 +1136,8 @@ pub mod key_types { /// Key type for Babe module, built-in. Identified as `babe`. pub const BABE: KeyTypeId = KeyTypeId(*b"babe"); + /// Key type for Sassafras module, built-in. Identified as `sass`. + pub const SASSAFRAS: KeyTypeId = KeyTypeId(*b"sass"); /// Key type for Grandpa module, built-in. Identified as `gran`. pub const GRANDPA: KeyTypeId = KeyTypeId(*b"gran"); /// Key type for controlling an account in a Substrate runtime, built-in. Identified as `acco`. diff --git a/substrate/primitives/crypto/ec-utils/Cargo.toml b/substrate/primitives/crypto/ec-utils/Cargo.toml index 3ee9fea6a3600e128033187131df1682ef6010aa..15a6e85abb9675149bad87cfc769d9a8d8b89f7e 100644 --- a/substrate/primitives/crypto/ec-utils/Cargo.toml +++ b/substrate/primitives/crypto/ec-utils/Cargo.toml @@ -23,18 +23,18 @@ ark-ed-on-bls12-381-bandersnatch = { version = "0.4.0", default-features = false ark-ed-on-bls12-377 = { version = "0.4.0", default-features = false } sp-std = { path = "../../std", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -ark-scale = { version = "0.0.3", features = ["hazmat"], default-features = false } +ark-scale = { version = "0.0.10", features = ["hazmat"], default-features = false } sp-runtime-interface = { path = "../../runtime-interface", default-features = false} [dev-dependencies] sp-io = { path = "../../io", default-features = false } ark-algebra-test-templates = { version = "0.4.2", default-features = false } -sp-ark-models = { version = "0.4.0-beta", default-features = false } -sp-ark-bls12-377 = { version = "0.4.0-beta", default-features = false } -sp-ark-bls12-381 = { version = "0.4.0-beta", default-features = false } -sp-ark-bw6-761 = { version = "0.4.0-beta", default-features = false } -sp-ark-ed-on-bls12-377 = { version = "0.4.0-beta", default-features = false } -sp-ark-ed-on-bls12-381-bandersnatch = { version = "0.4.0-beta", default-features = false } +sp-ark-models = { version = "0.4.1-beta", default-features = false } +sp-ark-bls12-377 = { version = "0.4.1-beta", default-features = false } +sp-ark-bls12-381 = { version = "0.4.1-beta", default-features = false } +sp-ark-bw6-761 = { version = "0.4.1-beta", default-features = false } +sp-ark-ed-on-bls12-377 = { version = "0.4.1-beta", default-features = false } +sp-ark-ed-on-bls12-381-bandersnatch = { version = "0.4.1-beta", default-features = false } [features] default = [ "std" ] diff --git a/substrate/primitives/crypto/ec-utils/src/bls12_377.rs b/substrate/primitives/crypto/ec-utils/src/bls12_377.rs index 9230479b3bec513e2429055c975a145d91432b3b..78f20297299b08492c71dcedec5f3d43a695afd4 100644 --- a/substrate/primitives/crypto/ec-utils/src/bls12_377.rs +++ b/substrate/primitives/crypto/ec-utils/src/bls12_377.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/crypto/ec-utils/src/bls12_381.rs b/substrate/primitives/crypto/ec-utils/src/bls12_381.rs index 6c707aa581458e8520ac81971b7738b4617eb051..b2ec48a42fc53ee1b33f6ac87abce1d3df0a3a19 100644 --- a/substrate/primitives/crypto/ec-utils/src/bls12_381.rs +++ b/substrate/primitives/crypto/ec-utils/src/bls12_381.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/crypto/ec-utils/src/bw6_761.rs b/substrate/primitives/crypto/ec-utils/src/bw6_761.rs index 2f3b4c3c9c9aacdde7a11045136cb3411d7a5867..4ad26fc54b1e0c13727f65dec83609853b9a8fce 100644 --- a/substrate/primitives/crypto/ec-utils/src/bw6_761.rs +++ b/substrate/primitives/crypto/ec-utils/src/bw6_761.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs b/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs index 84a86286180f7b74a73ffce0c5cd9ece83bf0673..e69dbd7984645918d946e48418a5c433114b5642 100644 --- a/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs +++ b/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs b/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs index 72b68c3b47182e012b25f0b5beab8cb74d05f874..7e9cd87e543d3731a4942f793787522c9677a9c2 100644 --- a/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs +++ b/substrate/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/keystore/src/lib.rs b/substrate/primitives/keystore/src/lib.rs index 82062fe7b40a713ca0afa934431e74a307f55108..035af7099a6f8835364c14e3150ba880e3efc2c1 100644 --- a/substrate/primitives/keystore/src/lib.rs +++ b/substrate/primitives/keystore/src/lib.rs @@ -17,6 +17,7 @@ //! Keystore traits +#[cfg(feature = "std")] pub mod testing; #[cfg(feature = "bandersnatch-experimental")] @@ -631,3 +632,15 @@ impl KeystoreExt { Self(Arc::new(keystore)) } } + +sp_core::generate_feature_enabled_macro!( + bandersnatch_experimental_enabled, + feature = "bandersnatch-experimental", + $ +); + +sp_core::generate_feature_enabled_macro!( + bls_experimental_enabled, + feature = "bls-experimental", + $ +); diff --git a/substrate/primitives/maybe-compressed-blob/Cargo.toml b/substrate/primitives/maybe-compressed-blob/Cargo.toml index da4c412c452388888db210c4de3b7415e92e43b9..c6fa7103672fc17097a9c446ab01262612034efc 100644 --- a/substrate/primitives/maybe-compressed-blob/Cargo.toml +++ b/substrate/primitives/maybe-compressed-blob/Cargo.toml @@ -12,4 +12,4 @@ readme = "README.md" [dependencies] thiserror = "1.0" -zstd = { version = "0.12.3", default-features = false } +zstd = { version = "0.12.4", default-features = false } diff --git a/substrate/primitives/merkle-mountain-range/Cargo.toml b/substrate/primitives/merkle-mountain-range/Cargo.toml index 4d985e7a7846e588c96fa862fab00c83e9ee3c3f..747b967dd9ed78162840f9648c208ae55f9442fa 100644 --- a/substrate/primitives/merkle-mountain-range/Cargo.toml +++ b/substrate/primitives/merkle-mountain-range/Cargo.toml @@ -16,7 +16,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } mmr-lib = { package = "ckb-merkle-mountain-range", version = "0.5.2", default-features = false } -serde = { version = "1.0.163", features = ["derive", "alloc"], default-features = false, optional = true } +serde = { version = "1.0.188", features = ["derive", "alloc"], default-features = false, optional = true } sp-api = { path = "../api", default-features = false} sp-core = { path = "../core", default-features = false} sp-debug-derive = { path = "../debug-derive", default-features = false} diff --git a/substrate/primitives/npos-elections/Cargo.toml b/substrate/primitives/npos-elections/Cargo.toml index 00b4bd14b7d7c1058cb395bc2d9decf8e8def860..68f1bef91665c6b168f736e8125a633a265652d9 100644 --- a/substrate/primitives/npos-elections/Cargo.toml +++ b/substrate/primitives/npos-elections/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } sp-arithmetic = { path = "../arithmetic", default-features = false} sp-core = { path = "../core", default-features = false} sp-runtime = { path = "../runtime", default-features = false} diff --git a/substrate/primitives/npos-elections/fuzzer/Cargo.toml b/substrate/primitives/npos-elections/fuzzer/Cargo.toml index 8a36cea3b2e0e2302211352ee49c806058cda2ed..86927786c58f2d2a3604db28f4cfb7c40083f30a 100644 --- a/substrate/primitives/npos-elections/fuzzer/Cargo.toml +++ b/substrate/primitives/npos-elections/fuzzer/Cargo.toml @@ -14,7 +14,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } honggfuzz = "0.5" rand = { version = "0.8", features = ["std", "small_rng"] } sp-npos-elections = { path = ".." } diff --git a/substrate/primitives/rpc/Cargo.toml b/substrate/primitives/rpc/Cargo.toml index d2bbaeff3d2cea766a53db6c3a295859ec287007..21447dafb050d90542380eaecd0ce5f2bb847dc0 100644 --- a/substrate/primitives/rpc/Cargo.toml +++ b/substrate/primitives/rpc/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] rustc-hash = "1.1.0" -serde = { version = "1.0.163", features = ["derive"] } +serde = { version = "1.0.188", features = ["derive"] } sp-core = { path = "../core" } [dev-dependencies] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.rs b/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.rs index 948c327aa1a8b03c0b146031c013e07ca9b589f9..3dc49f7333b75441e6f57fcae3dcf78e6cdcc1f6 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.stderr b/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.stderr index 592dd9928c9687b875cc10d0d5ea15457c276c2d..f8dbdfbcb8f3dc6f03adbddff5e9264b046a52cd 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_duplicate_versions.stderr @@ -1,11 +1,11 @@ error: Duplicated version attribute - --> $DIR/no_duplicate_versions.rs:7:2 - | -7 | #[version(2)] - | ^ + --> tests/ui/no_duplicate_versions.rs:24:2 + | +24 | #[version(2)] + | ^ error: Previous version with the same number defined here - --> $DIR/no_duplicate_versions.rs:5:2 - | -5 | #[version(2)] - | ^ + --> tests/ui/no_duplicate_versions.rs:22:2 + | +22 | #[version(2)] + | ^ diff --git a/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.rs b/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.rs index 51e45f178f0c5d1163fd6549dacb8f16ce61bd33..836c5866459fae1aa9e39fc98355a4b2a7500051 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.stderr b/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.stderr index e8accd62fc68dec8680e093e7b6c0f7b0fc21291..23e671f6ce3f3e93ef8e49aba332b86e2c029473 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_feature_gated_method.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `bar` in module `test` - --> tests/ui/no_feature_gated_method.rs:16:8 + --> tests/ui/no_feature_gated_method.rs:33:8 | -16 | test::bar(); +33 | test::bar(); | ^^^ not found in `test` diff --git a/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.rs b/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.rs index c468f48e37462015c7426f653e0012a528313a25..8706a28782294efeee7c246259f5765d9edb63e3 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.stderr b/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.stderr index cdefcf60c56a8c4d27ab352e11cbd42d4198d241..142ca186c7d2923055fa7660fe6fc3a98cc07037 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_gaps_in_versions.stderr @@ -1,5 +1,5 @@ error: Unexpected version attribute: missing version '2' for this function - --> $DIR/no_gaps_in_versions.rs:13:2 + --> tests/ui/no_gaps_in_versions.rs:30:2 | -13 | #[version(3)] +30 | #[version(3)] | ^ diff --git a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.rs b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.rs index 407942eb5ed8899d83a698f7af4b34c6f1ca4ee5..7fd61802a1ac62af9c0a4db0c7890207be1b670a 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.stderr b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.stderr index 8a549753ac9f9abf5f9cf2e1e3cd4e05d1f4b2c4..f5257bdd99287d6abb41a744eeaa2a6cb1e740c6 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_method.stderr @@ -1,5 +1,5 @@ error: Generic parameters not supported. - --> $DIR/no_generic_parameters_method.rs:5:10 - | -5 | fn test() {} - | ^ + --> tests/ui/no_generic_parameters_method.rs:22:10 + | +22 | fn test() {} + | ^ diff --git a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.rs b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.rs index 35efac6761ca28acae520dca795e0995994b4f11..ebb5b6f03f8c47818dc7d23b9e7aaa8447fd88a5 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.stderr b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.stderr index 794e30bca767d3a3c0aed33713d7baca5d268f28..88a623c63bb6f815c43d9d59f7b0f9d1528917aa 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_generic_parameters_trait.stderr @@ -1,5 +1,5 @@ error: Generic parameters not supported. - --> $DIR/no_generic_parameters_trait.rs:4:12 - | -4 | trait Test { - | ^ + --> tests/ui/no_generic_parameters_trait.rs:21:12 + | +21 | trait Test { + | ^ diff --git a/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.rs b/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.rs index e3cd93e4a97b224857fa34949896d7d53f67a28a..d243b0da6096e4f2f9934ae4632d1bb3495ca50d 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.stderr b/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.stderr index 31b2d39762340a4f09a53780a2a31f9b56def8b4..b2b570ca3079b52bbe7c11df1948a137f11636ce 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_method_implementation.stderr @@ -1,5 +1,5 @@ error: Methods need to have an implementation. - --> $DIR/no_method_implementation.rs:5:2 - | -5 | fn test(); - | ^^ + --> tests/ui/no_method_implementation.rs:22:2 + | +22 | fn test(); + | ^^ diff --git a/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.rs b/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.rs index a4a8a5804bee342f5c224f7ccf886f1cda53ad72..73bb0fd3f17af1ee03d91fb0d133185be53d3868 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.rs +++ b/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.stderr b/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.stderr index 6f50e14278de56abf824522cc5e1d63d63419d7e..6a99f4f76b523bc2a6afb7a2af4cc48fbd9716bc 100644 --- a/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/no_versioned_conditional_build.stderr @@ -1,5 +1,5 @@ error: Conditional compilation is not supported for versioned functions - --> tests/ui/no_versioned_conditional_build.rs:7:2 - | -7 | #[version(2)] - | ^ + --> tests/ui/no_versioned_conditional_build.rs:24:2 + | +24 | #[version(2)] + | ^ diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.rs b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.rs index 6f4ae37ea466e1f2f603929c557633c6d2059fcb..dcc8fb0930bdf10f93adb30a8b043be962854233 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.rs +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::pass_by::PassByEnum; #[derive(PassByEnum)] diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.stderr b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.stderr index 44fb5a244e03d7a8e9cf71b7e031b00f3b5419ae..c5b69d426abf4d5f12138cdd5bb02baed6d376d6 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.stderr @@ -1,7 +1,7 @@ error: `PassByEnum` only supports enums as input type. - --> $DIR/pass_by_enum_with_struct.rs:3:10 - | -3 | #[derive(PassByEnum)] - | ^^^^^^^^^^ - | - = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui/pass_by_enum_with_struct.rs:20:10 + | +20 | #[derive(PassByEnum)] + | ^^^^^^^^^^ + | + = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.rs b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.rs index a03bfdc1aed814f180d6822a74efcc93b05a316c..b6faa46605bf731e08b0cc86fc08c769abb3afd1 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.rs +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::pass_by::PassByEnum; #[derive(PassByEnum)] diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.stderr b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.stderr index 633dc3bbe8bc4829d32c72acc5ddb6dcd944480d..ad94efed3c659cfe1daa906bc5b1b7391d6a4d8a 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.stderr @@ -1,7 +1,7 @@ error: `PassByEnum` only supports unit variants. - --> $DIR/pass_by_enum_with_value_variant.rs:3:10 - | -3 | #[derive(PassByEnum)] - | ^^^^^^^^^^ - | - = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui/pass_by_enum_with_value_variant.rs:20:10 + | +20 | #[derive(PassByEnum)] + | ^^^^^^^^^^ + | + = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.rs b/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.rs index f496bc3700106b27de4c72d0a3226174e751b03e..2b7e98165ba53107088a01dd8ecf22d47f8c80bb 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.rs +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::pass_by::PassByInner; #[derive(PassByInner)] diff --git a/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.stderr b/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.stderr index 0ffee00210e795532ecbb976cb4b07147c12ecf6..3ca1362fb424ca7eaba3a37dd96b08ef5574fa84 100644 --- a/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.stderr @@ -1,7 +1,7 @@ error: Only newtype/one field structs are supported by `PassByInner`! - --> $DIR/pass_by_inner_with_two_fields.rs:3:10 - | -3 | #[derive(PassByInner)] - | ^^^^^^^^^^^ - | - = note: this error originates in the derive macro `PassByInner` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui/pass_by_inner_with_two_fields.rs:20:10 + | +20 | #[derive(PassByInner)] + | ^^^^^^^^^^^ + | + = note: this error originates in the derive macro `PassByInner` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.rs b/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.rs index 9c12614d9307726c01c8e3acfcb59bbd5b926abd..82227dc67ff6b2e4413f6fd7a3b4ef08f92ab2cc 100644 --- a/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.rs +++ b/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.rs @@ -1,3 +1,20 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sp_runtime_interface::runtime_interface; #[runtime_interface] diff --git a/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.stderr b/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.stderr index 9b17a63a35cbcd0e3ef6cbb209b99e435840b9de..3e9a4b74e8b81b5130cf85d7a8d66d80463e7bca 100644 --- a/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.stderr +++ b/substrate/primitives/runtime-interface/tests/ui/take_self_by_value.stderr @@ -1,5 +1,5 @@ error: Taking `Self` by value is not allowed. - --> $DIR/take_self_by_value.rs:5:10 - | -5 | fn test(self) {} - | ^^^^ + --> tests/ui/take_self_by_value.rs:22:10 + | +22 | fn test(self) {} + | ^^^^ diff --git a/substrate/primitives/runtime/Cargo.toml b/substrate/primitives/runtime/Cargo.toml index 7f31f0930b1d6725fbef984db73d664733f4169c..7050c27bc849758599d8fd2086f8f4fa7da93220 100644 --- a/substrate/primitives/runtime/Cargo.toml +++ b/substrate/primitives/runtime/Cargo.toml @@ -22,7 +22,7 @@ log = { version = "0.4.17", default-features = false } paste = "1.0" rand = { version = "0.8.5", optional = true } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } sp-application-crypto = { path = "../application-crypto", default-features = false} sp-arithmetic = { path = "../arithmetic", default-features = false} sp-core = { path = "../core", default-features = false} @@ -33,7 +33,7 @@ sp-weights = { path = "../weights", default-features = false} [dev-dependencies] rand = "0.8.5" serde_json = "1.0.85" -zstd = { version = "0.12.3", default-features = false } +zstd = { version = "0.12.4", default-features = false } sp-api = { path = "../api" } sp-state-machine = { path = "../state-machine" } sp-tracing = { path = "../tracing" } diff --git a/substrate/primitives/staking/Cargo.toml b/substrate/primitives/staking/Cargo.toml index 9f67446969da6e82c77f93cffd45006f4a17f7a9..825806078f6e9fde8b0a3e41d4013166cd649f96 100644 --- a/substrate/primitives/staking/Cargo.toml +++ b/substrate/primitives/staking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } impl-trait-for-tuples = "0.2.2" diff --git a/substrate/primitives/staking/src/currency_to_vote.rs b/substrate/primitives/staking/src/currency_to_vote.rs index 556e5bd210426faeb8d774f88a8ebd5dfb1dd029..ff1253ade5fa12271da02ff671a0ea2ca5c21d0c 100644 --- a/substrate/primitives/staking/src/currency_to_vote.rs +++ b/substrate/primitives/staking/src/currency_to_vote.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/substrate/primitives/statement-store/README.md b/substrate/primitives/statement-store/README.md index fb88aaa4ecd9c062a059cf303de3a520fa5bfed9..2cde0d669eefa1de0a71b874fdeb5acecf2c9cb8 100644 --- a/substrate/primitives/statement-store/README.md +++ b/substrate/primitives/statement-store/README.md @@ -10,7 +10,7 @@ Each field is effectively a key/value pair. Fields must be sorted and the same f Formally, `Statement` is equivalent to the type `Vec` and `Field` is the SCALE-encoded enumeration: - 0: `AuthenticityProof(Proof)`: The signature of the message. For cryptography where the public key cannot be derived from the signature together with the message data, then this will also include the signer's public key. The message data is all fields of the messages fields except the signature concatenated together *without the length prefix that a `Vec` would usually imply*. This is so that the signature can be derived without needing to re-encode the statement. -- 1: `DecryptionKey([u8; 32])`: The decryption key identifier which should be used to decrypt the statement's data. In the absense of this field `Data` should be treated as not encrypted. +- 1: `DecryptionKey([u8; 32])`: The decryption key identifier which should be used to decrypt the statement's data. In the absence of this field `Data` should be treated as not encrypted. - 2: `Priority(u32)`: Priority specifier. Higher priority statements should be kept around at the cost of lower priority statements if multiple statements from the same sender are competing for persistence or transport. Nodes should disregard when considering unsigned statements. - 3: `Channel([u8; 32])`: The channel identifier. Only one message of a given channel should be retained at once (the one of highest priority). Nodes should disregard when considering unsigned statements. - 4: `Topic1([u8; 32]))`: First topic identifier. diff --git a/substrate/primitives/storage/Cargo.toml b/substrate/primitives/storage/Cargo.toml index 01a9b9b650aafb1fdd5ed99e726c84b414c0cbce..11e574f1c4ced1402ec7488cce7b722bedd7cca5 100644 --- a/substrate/primitives/storage/Cargo.toml +++ b/substrate/primitives/storage/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } impl-serde = { version = "0.4.0", optional = true, default-features = false } ref-cast = "1.0.0" -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } sp-debug-derive = { path = "../debug-derive", default-features = false} sp-std = { path = "../std", default-features = false} diff --git a/substrate/primitives/test-primitives/Cargo.toml b/substrate/primitives/test-primitives/Cargo.toml index a5d7b518a69b96d4eb4f40e0ab741f9a02f7600b..91d532b6e16caa2584a68eff94408ae47f26c6ff 100644 --- a/substrate/primitives/test-primitives/Cargo.toml +++ b/substrate/primitives/test-primitives/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive"], optional = true } sp-application-crypto = { path = "../application-crypto", default-features = false} sp-core = { path = "../core", default-features = false} sp-runtime = { path = "../runtime", default-features = false} diff --git a/substrate/primitives/version/Cargo.toml b/substrate/primitives/version/Cargo.toml index bcd701c2f6ecd378cfcf42d3a7a93d2e5c754b41..3002566f74ff78aba61b326b52a67cd15db307eb 100644 --- a/substrate/primitives/version/Cargo.toml +++ b/substrate/primitives/version/Cargo.toml @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = impl-serde = { version = "0.4.0", default-features = false, optional = true } parity-wasm = { version = "0.45", optional = true } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } +serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } thiserror = { version = "1.0.30", optional = true } sp-core-hashing-proc-macro = { path = "../core/hashing/proc-macro" } sp-runtime = { path = "../runtime", default-features = false} diff --git a/substrate/primitives/weights/Cargo.toml b/substrate/primitives/weights/Cargo.toml index 467cb145c94a29081ed829a2d05fbf844f2a1923..03e06aad086535c8b5313a81c284c0e8a90cd1cb 100644 --- a/substrate/primitives/weights/Cargo.toml +++ b/substrate/primitives/weights/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.163", default-features = false, optional = true, features = ["derive", "alloc"] } +serde = { version = "1.0.188", default-features = false, optional = true, features = ["derive", "alloc"] } smallvec = "1.11.0" sp-arithmetic = { path = "../arithmetic", default-features = false} sp-core = { path = "../core", default-features = false} diff --git a/substrate/primitives/weights/src/weight_meter.rs b/substrate/primitives/weights/src/weight_meter.rs index 3b0b21ea8799ac44d6dcc787e379b725fab628d4..584d22304c3ae33ece669bc69927a2568fb9b288 100644 --- a/substrate/primitives/weights/src/weight_meter.rs +++ b/substrate/primitives/weights/src/weight_meter.rs @@ -31,7 +31,7 @@ use sp_arithmetic::Perbill; /// use sp_weights::{Weight, WeightMeter}; /// /// // The weight is limited to (10, 0). -/// let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 0)); +/// let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 0)); /// // There is enough weight remaining for an operation with (6, 0) weight. /// assert!(meter.try_consume(Weight::from_parts(6, 0)).is_ok()); /// assert_eq!(meter.remaining(), Weight::from_parts(4, 0)); @@ -51,13 +51,13 @@ pub struct WeightMeter { impl WeightMeter { /// Creates [`Self`] from a limit for the maximal consumable weight. - pub fn from_limit(limit: Weight) -> Self { + pub fn with_limit(limit: Weight) -> Self { Self { consumed: Weight::zero(), limit } } /// Creates [`Self`] with the maximal possible limit for the consumable weight. - pub fn max_limit() -> Self { - Self::from_limit(Weight::MAX) + pub fn new() -> Self { + Self::with_limit(Weight::MAX) } /// The already consumed weight. @@ -84,7 +84,7 @@ impl WeightMeter { /// use sp_weights::{Weight, WeightMeter}; /// use sp_arithmetic::Perbill; /// - /// let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 20)); + /// let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 20)); /// // Nothing consumed so far: /// assert_eq!(meter.consumed_ratio(), Perbill::from_percent(0)); /// meter.consume(Weight::from_parts(5, 5)); @@ -158,7 +158,7 @@ mod tests { #[test] fn weight_meter_remaining_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 20)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 20)); assert!(meter.check_accrue(Weight::from_parts(5, 0))); assert_eq!(meter.consumed, Weight::from_parts(5, 0)); @@ -175,7 +175,7 @@ mod tests { #[test] fn weight_meter_can_accrue_works() { - let meter = WeightMeter::from_limit(Weight::from_parts(1, 1)); + let meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); assert!(meter.can_accrue(Weight::from_parts(0, 0))); assert!(meter.can_accrue(Weight::from_parts(1, 1))); @@ -186,7 +186,7 @@ mod tests { #[test] fn weight_meter_check_accrue_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(2, 2)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(2, 2)); assert!(meter.check_accrue(Weight::from_parts(0, 0))); assert!(meter.check_accrue(Weight::from_parts(1, 1))); @@ -199,7 +199,7 @@ mod tests { #[test] fn weight_meter_check_and_can_accrue_works() { - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); assert!(meter.can_accrue(Weight::from_parts(u64::MAX, 0))); assert!(meter.check_accrue(Weight::from_parts(u64::MAX, 0))); @@ -219,7 +219,7 @@ mod tests { #[test] fn consumed_ratio_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 20)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 20)); assert!(meter.check_accrue(Weight::from_parts(5, 0))); assert_eq!(meter.consumed_ratio(), Perbill::from_percent(50)); @@ -239,7 +239,7 @@ mod tests { #[test] fn try_consume_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 0)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 0)); assert!(meter.try_consume(Weight::from_parts(11, 0)).is_err()); assert!(meter.consumed().is_zero(), "No modification"); @@ -253,7 +253,7 @@ mod tests { #[test] fn can_consume_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 0)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 0)); assert!(!meter.can_consume(Weight::from_parts(11, 0))); assert!(meter.consumed().is_zero(), "No modification"); @@ -267,7 +267,7 @@ mod tests { #[test] #[cfg(debug_assertions)] fn consume_works() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(5, 10)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(5, 10)); meter.consume(Weight::from_parts(4, 0)); assert_eq!(meter.remaining(), Weight::from_parts(1, 10)); @@ -281,7 +281,7 @@ mod tests { #[cfg(debug_assertions)] #[should_panic(expected = "Weight counter overflow")] fn consume_defensive_fail() { - let mut meter = WeightMeter::from_limit(Weight::from_parts(10, 0)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(10, 0)); let _ = meter.consume(Weight::from_parts(11, 0)); } } diff --git a/substrate/scripts/ci/common/lib.sh b/substrate/scripts/ci/common/lib.sh deleted file mode 100755 index 08c2fe81ada04bb6efcacb67833cfd78cccfe208..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/common/lib.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh - -api_base="https://api.github.com/repos" - -# Function to take 2 git tags/commits and get any lines from commit messages -# that contain something that looks like a PR reference: e.g., (#1234) -sanitised_git_logs(){ - git --no-pager log --pretty=format:"%s" "$1...$2" | - # Only find messages referencing a PR - grep -E '\(#[0-9]+\)' | - # Strip any asterisks - sed 's/^* //g' | - # And add them all back - sed 's/^/* /g' -} - -# Returns the last published release on github -# Note: we can't just use /latest because that ignores prereleases -# repo: 'organization/repo' -# Usage: last_github_release "$repo" -last_github_release(){ - i=0 - # Iterate over releases until we find the last release that's not just a draft - while [ $i -lt 29 ]; do - out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$1/releases" | jq ".[$i]") - echo "$out" - # Ugh when echoing to jq, we need to translate newlines into spaces :/ - if [ "$(echo "$out" | tr '\r\n' ' ' | jq '.draft')" = "false" ]; then - echo "$out" | tr '\r\n' ' ' | jq '.tag_name' - return - else - i=$((i + 1)) - fi - done -} - -# Checks whether a tag on github has been verified -# repo: 'organization/repo' -# tagver: 'v1.2.3' -# Usage: check_tag $repo $tagver -check_tag () { - repo=$1 - tagver=$2 - tag_out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") - tag_sha=$(echo "$tag_out" | jq -r .object.sha) - object_url=$(echo "$tag_out" | jq -r .object.url) - if [ "$tag_sha" = "null" ]; then - return 2 - fi - verified_str=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$object_url" | jq -r .verification.verified) - if [ "$verified_str" = "true" ]; then - # Verified, everything is good - return 0 - else - # Not verified. Bad juju. - return 1 - fi -} - -# Checks whether a given PR has a given label. -# repo: 'organization/repo' -# pr_id: 12345 -# label: B1-silent -# Usage: has_label $repo $pr_id $label -has_label(){ - repo="$1" - pr_id="$2" - label="$3" - - # These will exist if the function is called in Gitlab. - # If the function's called in Github, we should have GITHUB_ACCESS_TOKEN set - # already. - if [ -n "$GITHUB_RELEASE_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_RELEASE_TOKEN" - elif [ -n "$GITHUB_PR_TOKEN" ]; then - GITHUB_TOKEN="$GITHUB_PR_TOKEN" - fi - - out=$(curl -H "Authorization: token $GITHUB_TOKEN" -s "$api_base/$repo/pulls/$pr_id") - [ -n "$(echo "$out" | tr -d '\r\n' | jq ".labels | .[] | select(.name==\"$label\")")" ] -} - -# Formats a message into a JSON string for posting to Matrix -# message: 'any plaintext message' -# formatted_message: 'optional message formatted in html' -# Usage: structure_message $content $formatted_content (optional) -structure_message() { - if [ -z "$2" ]; then - body=$(jq -Rs --arg body "$1" '{"msgtype": "m.text", $body}' < /dev/null) - else - body=$(jq -Rs --arg body "$1" --arg formatted_body "$2" '{"msgtype": "m.text", $body, "format": "org.matrix.custom.html", $formatted_body}' < /dev/null) - fi - echo "$body" -} - -# Post a message to a matrix room -# body: '{body: "JSON string produced by structure_message"}' -# room_id: !fsfSRjgjBWEWffws:matrix.parity.io -# access_token: see https://matrix.org/docs/guides/client-server-api/ -# Usage: send_message $body (json formatted) $room_id $access_token -send_message() { - curl -XPOST -d "$1" "https://m.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3" -} - -# Check for runtime changes between two commits. This is defined as any changes -# to bin/node/src/runtime, frame/ and primitives/sr_* trees. -has_runtime_changes() { - from=$1 - to=$2 - if git diff --name-only "${from}...${to}" \ - | grep -q -e '^frame/' -e '^primitives/' - then - return 0 - else - return 1 - fi -} diff --git a/substrate/scripts/ci/github/check_labels.sh b/substrate/scripts/ci/github/check_labels.sh deleted file mode 100755 index 7b0aed9fe73455d01a15c19bba83592eb1989747..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/github/check_labels.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -set -e - -#shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -repo="$GITHUB_REPOSITORY" -pr="$GITHUB_PR" - -ensure_labels() { - for label in "$@"; do - if has_label "$repo" "$pr" "$label"; then - return 0 - fi - done - return 1 -} - -# Must have one of the following labels -releasenotes_labels=( - 'B0-silent' - 'B3-apinoteworthy' - 'B5-clientnoteworthy' - 'B7-runtimenoteworthy' -) - -criticality_labels=( - 'C1-low 📌' - 'C3-medium 📣' - 'C7-high ❗️' - 'C9-critical ‼️' -) - -audit_labels=( - 'D1-audited 👍' - 'D2-notlive 💤' - 'D3-trivial 🧸' - 'D5-nicetohaveaudit ⚠️' - 'D9-needsaudit 👮' -) - -echo "[+] Checking release notes (B) labels" -if ensure_labels "${releasenotes_labels[@]}"; then - echo "[+] Release notes label detected. All is well." -else - echo "[!] Release notes label not detected. Please add one of: ${releasenotes_labels[*]}" - exit 1 -fi - -echo "[+] Checking release criticality (C) labels" -if ensure_labels "${criticality_labels[@]}"; then - echo "[+] Release criticality label detected. All is well." -else - echo "[!] Release criticality label not detected. Please add one of: ${criticality_labels[*]}" - exit 1 -fi - -if has_runtime_changes origin/master "${HEAD_SHA}"; then - echo "[+] Runtime changes detected. Checking audit (D) labels" - if ensure_labels "${audit_labels[@]}"; then - echo "[+] Release audit label detected. All is well." - else - echo "[!] Release audit label not detected. Please add one of: ${audit_labels[*]}" - exit 1 - fi -fi - -exit 0 diff --git a/substrate/scripts/ci/github/generate_changelog.sh b/substrate/scripts/ci/github/generate_changelog.sh deleted file mode 100755 index 32ac1760a6117846ca5a32f7a9058db1fbf7cc5c..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/github/generate_changelog.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -version="$2" -last_version="$1" - -all_changes="$(sanitised_git_logs "$last_version" "$version")" -runtime_changes="" -api_changes="" -client_changes="" -changes="" -migrations="" - -while IFS= read -r line; do - pr_id=$(echo "$line" | sed -E 's/.*#([0-9]+)\)$/\1/') - - # Skip if the PR has the silent label - this allows us to skip a few requests - if has_label 'paritytech/substrate' "$pr_id" 'B0-silent'; then - continue - fi - if has_label 'paritytech/substrate' "$pr_id" 'B3-apinoteworthy' ; then - api_changes="$api_changes -$line" - fi - if has_label 'paritytech/substrate' "$pr_id" 'B5-clientnoteworthy'; then - client_changes="$client_changes -$line" - fi - if has_label 'paritytech/substrate' "$pr_id" 'B7-runtimenoteworthy'; then - runtime_changes="$runtime_changes -$line" - fi - if has_label 'paritytech/substrate' "$pr_id" 'E1-runtime-migration'; then - migrations="$migrations -$line" - fi -done <<< "$all_changes" - -# Make the substrate section if there are any substrate changes -if [ -n "$runtime_changes" ] || - [ -n "$api_changes" ] || - [ -n "$client_changes" ] || - [ -n "$migrations" ]; then - changes=$(cat << EOF -Substrate changes ------------------ - -EOF -) - if [ -n "$runtime_changes" ]; then - changes="$changes - -Runtime -------- -$runtime_changes" - fi - if [ -n "$client_changes" ]; then - changes="$changes - -Client ------- -$client_changes" - fi - if [ -n "$api_changes" ]; then - changes="$changes - -API ---- -$api_changes" - fi - release_text="$release_text - -$changes" -fi -if [ -n "$migrations" ]; then - changes="$changes - -Runtime Migrations ------------------- -$migrations" -fi - -echo "$changes" diff --git a/substrate/scripts/ci/gitlab/check-each-crate.py b/substrate/scripts/ci/gitlab/check-each-crate.py deleted file mode 100755 index adad4f5bd583543b4610cd010a9cefbd04bc5401..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/check-each-crate.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -# A script that checks each workspace crate individually. -# It's relevant to check workspace crates individually because otherwise their compilation problems -# due to feature misconfigurations won't be caught, as exemplified by -# https://github.com/paritytech/substrate/issues/12705 -# -# `check-each-crate.py target_group groups_total` -# -# - `target_group`: Integer starting from 1, the group this script should execute. -# - `groups_total`: Integer starting from 1, total number of groups. - -import subprocess, sys - -# Get all crates -output = subprocess.check_output(["cargo", "tree", "--locked", "--workspace", "--depth", "0", "--prefix", "none"]) - -# Convert the output into a proper list -crates = [] -for line in output.splitlines(): - if line != b"": - crates.append(line.decode('utf8').split(" ")[0]) - -# Make the list unique and sorted -crates = list(set(crates)) -crates.sort() - -target_group = int(sys.argv[1]) - 1 -groups_total = int(sys.argv[2]) - -if len(crates) == 0: - print("No crates detected!", file=sys.stderr) - sys.exit(1) - -print(f"Total crates: {len(crates)}", file=sys.stderr) - -crates_per_group = len(crates) // groups_total - -# If this is the last runner, we need to take care of crates -# after the group that we lost because of the integer division. -if target_group + 1 == groups_total: - overflow_crates = len(crates) % groups_total -else: - overflow_crates = 0 - -print(f"Crates per group: {crates_per_group}", file=sys.stderr) - -# Check each crate -for i in range(0, crates_per_group + overflow_crates): - crate = crates_per_group * target_group + i - - print(f"Checking {crates[crate]}", file=sys.stderr) - - res = subprocess.run(["cargo", "check", "--locked", "-p", crates[crate]]) - - if res.returncode != 0: - sys.exit(1) diff --git a/substrate/scripts/ci/gitlab/check_runtime.sh b/substrate/scripts/ci/gitlab/check_runtime.sh deleted file mode 100755 index 71d6965ecf4fb028b7e08a507125a4ba4ca1330e..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/check_runtime.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# -# -# check for any changes in the node/src/runtime, frame/ and primitives/sr_* trees. if -# there are any changes found, it should mark the PR breaksconsensus and -# "auto-fail" the PR if there isn't a change in the runtime/src/lib.rs file -# that alters the version. - -set -e # fail on any error - -#shellcheck source=../common/lib.sh -. "$(dirname "${0}")/../common/lib.sh" - -VERSIONS_FILE="bin/node/runtime/src/lib.rs" - -boldprint () { printf "|\n| \033[1m%s\033[0m\n|\n" "${@}"; } -boldcat () { printf "|\n"; while read -r l; do printf "| \033[1m%s\033[0m\n" "${l}"; done; printf "|\n" ; } - -github_label () { - echo - echo "# run github-api job for labeling it ${1}" - curl -sS -X POST \ - -F "token=${CI_JOB_TOKEN}" \ - -F "ref=master" \ - -F "variables[LABEL]=${1}" \ - -F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \ - "${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline" -} - - -boldprint "latest 10 commits of ${CI_COMMIT_REF_NAME}" -git log --graph --oneline --decorate=short -n 10 - -boldprint "make sure the master branch and release tag are available in shallow clones" -git fetch --depth="${GIT_DEPTH:-100}" origin master -git fetch --depth="${GIT_DEPTH:-100}" origin release -git tag -f release FETCH_HEAD -git log -n1 release - - -boldprint "check if the wasm sources changed" -if ! has_runtime_changes origin/master "${CI_COMMIT_SHA}" -then - boldcat <<-EOT - - no changes to the runtime source code detected - - EOT - - exit 0 -fi - - - -# check for spec_version updates: if the spec versions changed, then there is -# consensus-critical logic that has changed. the runtime wasm blobs must be -# rebuilt. - -add_spec_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \ - | sed -n -r "s/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p")" -sub_spec_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \ - | sed -n -r "s/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p")" - - - -if [ "${add_spec_version}" != "${sub_spec_version}" ] -then - - boldcat <<-EOT - - changes to the runtime sources and changes in the spec version. - - spec_version: ${sub_spec_version} -> ${add_spec_version} - - EOT - exit 0 - -else - # check for impl_version updates: if only the impl versions changed, we assume - # there is no consensus-critical logic that has changed. - - add_impl_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \ - | sed -n -r 's/^\+[[:space:]]+impl_version: +([0-9]+),$/\1/p')" - sub_impl_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \ - | sed -n -r 's/^\-[[:space:]]+impl_version: +([0-9]+),$/\1/p')" - - - # see if the impl version changed - if [ "${add_impl_version}" != "${sub_impl_version}" ] - then - boldcat <<-EOT - - changes to the runtime sources and changes in the impl version. - - impl_version: ${sub_impl_version} -> ${add_impl_version} - - EOT - exit 0 - fi - - - boldcat <<-EOT - - wasm source files changed but not the spec/impl version. If changes made do not alter logic, - just bump 'impl_version'. If they do change logic, bump 'spec_version'. - - source file directories: - - bin/node/src/runtime - - frame - - primitives/sr-* - - versions file: ${VERSIONS_FILE} - - EOT -fi - -# dropped through. there's something wrong; exit 1. - -exit 1 - -# vim: noexpandtab diff --git a/substrate/scripts/ci/gitlab/check_signed.sh b/substrate/scripts/ci/gitlab/check_signed.sh deleted file mode 100755 index 20d47c2304767e0d61e6ac7cd4b08afe27dfc97e..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/check_signed.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -version="$CI_COMMIT_TAG" - -echo '[+] Checking tag has been signed' -check_tag "paritytech/substrate" "$version" -case $? in - 0) echo '[+] Tag found and has been signed'; exit 0 - ;; - 1) echo '[!] Tag found but has not been signed. Aborting release.'; exit 1 - ;; - 2) echo '[!] Tag not found. Aborting release.'; exit 1 -esac diff --git a/substrate/scripts/ci/gitlab/ensure-deps.sh b/substrate/scripts/ci/gitlab/ensure-deps.sh deleted file mode 100755 index 7087200cef5185878431a89c013bacbd7417b4fd..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/ensure-deps.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -# The script is meant to check if the rules regarding packages -# dependencies are satisfied. -# The general format is: -# [top-lvl-dir] MESSAGE/[other-top-dir] - -# For instance no crate within `./client` directory -# is allowed to import any crate with a directory path containing `frame`. -# Such rule is just: `client crates must not depend on anything in /frame`. - -# The script should be run from the main repo directory! - -set -u - -# HARD FAILING -MUST_NOT=( - "client crates must not depend on anything in /frame" - "client crates must not depend on anything in /node" - "frame crates must not depend on anything in /node" - "frame crates must not depend on anything in /client" - "primitives crates must not depend on anything in /frame" -) - -# ONLY DISPLAYED, script still succeeds -PLEASE_DONT=( - "primitives crates should not depend on anything in /client" -) - -VIOLATIONS=() -PACKAGES=() - -function check_rule() { - rule=$1 - from=$(echo $rule | cut -f1 -d\ ) - to=$(echo $rule | cut -f2 -d\/) - - cd $from - echo "Checking rule '$rule'" - packages=$(find -name Cargo.toml | xargs grep -wn "path.*\.\.\/$to") - has_references=$(echo -n $packages | wc -c) - if [ "$has_references" != "0" ]; then - VIOLATIONS+=("$rule") - # Find packages that violate: - PACKAGES+=("$packages") - fi - cd - > /dev/null -} - -for rule in "${MUST_NOT[@]}" -do - check_rule "$rule"; -done - -# Only the MUST NOT will be counted towards failure -HARD_VIOLATIONS=${#VIOLATIONS[@]} - - -for rule in "${PLEASE_DONT[@]}" -do - check_rule "$rule"; -done - -# Display violations and fail -I=0 -for v in "${VIOLATIONS[@]}" -do - cat << EOF - -=========================================== -======= Violation of rule: $v -=========================================== -${PACKAGES[$I]} - - -EOF - I=$I+1 -done - -exit $HARD_VIOLATIONS diff --git a/substrate/scripts/ci/gitlab/pipeline/build.yml b/substrate/scripts/ci/gitlab/pipeline/build.yml deleted file mode 100644 index 8f63f6ecc3911270d5b12000e1a94ab6df35ef52..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/pipeline/build.yml +++ /dev/null @@ -1,215 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "build" stage - -# PIPELINE_SCRIPTS_TAG can be found in the project variables - -.check-dependent-project: - stage: build - # DAG: this is artificial dependency - needs: - - job: cargo-clippy - artifacts: false - extends: - - .docker-env - - .test-refs-no-trigger-prs-only - variables: - RUSTFLAGS: "-D warnings" - script: - - cargo install --locked --git https://github.com/paritytech/try-runtime-cli --rev a93c9b5abe5d31a4cf1936204f7e5c489184b521 - - git clone - --depth=1 - --branch="$PIPELINE_SCRIPTS_TAG" - https://github.com/paritytech/pipeline-scripts - - ./pipeline-scripts/check_dependent_project.sh - --org paritytech - --dependent-repo "$DEPENDENT_REPO" - --github-api-token "$GITHUB_PR_TOKEN" - --extra-dependencies "$EXTRA_DEPENDENCIES" - --companion-overrides "$COMPANION_OVERRIDES" - -.check-runtime-migration: - extends: - - .check-dependent-project - - .test-refs-no-trigger-prs-only - variables: - DEPENDENT_REPO: polkadot - COMPANION_OVERRIDES: | - substrate: polkadot-v* - polkadot: release-v* - COMPANION_CHECK_COMMAND: > - time cargo build --release -p "$NETWORK"-runtime --features try-runtime && - time try-runtime \ - --runtime ./target/release/wbuild/"$NETWORK"-runtime/target/wasm32-unknown-unknown/release/"$NETWORK"_runtime.wasm \ - on-runtime-upgrade --checks=pre-and-post live --uri wss://${NETWORK}-try-runtime-node.parity-chains.parity.io:443 - -# Individual jobs are set up for each dependent project so that they can be ran in parallel. -# Arguably we could generate a job for each companion in the PR's description using Gitlab's -# parent-child pipelines but that's more complicated. - -check-runtime-migration-polkadot: - extends: - - .check-runtime-migration - variables: - NETWORK: polkadot - -check-runtime-migration-kusama: - extends: .check-runtime-migration - variables: - NETWORK: kusama - -check-runtime-migration-rococo: - extends: .check-runtime-migration - variables: - NETWORK: rococo - allow_failure: true - -check-runtime-migration-westend: - extends: .check-runtime-migration - variables: - NETWORK: westend - -check-dependent-polkadot: - extends: .check-dependent-project - variables: - DEPENDENT_REPO: polkadot - COMPANION_OVERRIDES: | - substrate: polkadot-v* - polkadot: release-v* - # enable the same feature flags as polkadot's test-linux-stable - COMPANION_CHECK_COMMAND: > - cargo check --all-targets --workspace - --features=runtime-benchmarks,runtime-metrics,try-runtime - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ #PRs - -check-dependent-cumulus: - extends: .check-dependent-project - variables: - DEPENDENT_REPO: cumulus - EXTRA_DEPENDENCIES: polkadot - COMPANION_OVERRIDES: | - substrate: polkadot-v* - polkadot: release-v* - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ #PRs - -build-linux-substrate: - stage: build - extends: - - .collect-artifacts - - .docker-env - - .build-refs - variables: - # this variable gets overriden by "rusty-cachier environment inject", use the value as default - CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target" - needs: - - job: test-linux-stable - artifacts: false - before_script: - - !reference [.timestamp, before_script] - - !reference [.job-switcher, before_script] - - mkdir -p ./artifacts/substrate/ - - !reference [.rusty-cachier, before_script] - # tldr: we need to checkout the branch HEAD explicitly because of our dynamic versioning approach while building the substrate binary - # see https://github.com/paritytech/ci_cd/issues/682#issuecomment-1340953589 - - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" - script: - - rusty-cachier snapshot create - - WASM_BUILD_NO_COLOR=1 time cargo build --locked --release -p node-cli --verbose - - mv $CARGO_TARGET_DIR/release/substrate-node ./artifacts/substrate/substrate - - echo -n "Substrate version = " - - if [ "${CI_COMMIT_TAG}" ]; then - echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION; - else - ./artifacts/substrate/substrate --version | - cut -d ' ' -f 2 | tee ./artifacts/substrate/VERSION; - fi - - sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256 - - cp -r ./scripts/ci/docker/substrate.Dockerfile ./artifacts/substrate/ - - printf '\n# building node-template\n\n' - - ./scripts/ci/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz - - rusty-cachier cache upload - -.build-subkey: - stage: build - extends: - - .collect-artifacts - - .docker-env - - .publish-refs - variables: - # this variable gets overriden by "rusty-cachier environment inject", use the value as default - CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target" - before_script: - - !reference [.timestamp, before_script] - - !reference [.job-switcher, before_script] - - mkdir -p ./artifacts/subkey - - !reference [.rusty-cachier, before_script] - script: - - rusty-cachier snapshot create - - cd ./bin/utils/subkey - - SKIP_WASM_BUILD=1 time cargo build --locked --release --verbose - - cd - - - mv $CARGO_TARGET_DIR/release/subkey ./artifacts/subkey/. - - echo -n "Subkey version = " - - ./artifacts/subkey/subkey --version | - sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' | - tee ./artifacts/subkey/VERSION; - - sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256 - - cp -r ./scripts/ci/docker/subkey.Dockerfile ./artifacts/subkey/ - - rusty-cachier cache upload - -build-subkey-linux: - extends: .build-subkey - -build-subkey-macos: - extends: .build-subkey - # duplicating before_script & script sections from .build-subkey hidden job - # to overwrite rusty-cachier integration as it doesn't work on macos - before_script: - # skip timestamp script, the osx bash doesn't support printf %()T - - !reference [.job-switcher, before_script] - - mkdir -p ./artifacts/subkey - script: - - cd ./bin/utils/subkey - - SKIP_WASM_BUILD=1 time cargo build --locked --release --verbose - - cd - - - mv ./target/release/subkey ./artifacts/subkey/. - - echo -n "Subkey version = " - - ./artifacts/subkey/subkey --version | - sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' | - tee ./artifacts/subkey/VERSION; - - sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256 - - cp -r ./scripts/ci/docker/subkey.Dockerfile ./artifacts/subkey/ - after_script: [""] - tags: - - osx - -build-rustdoc: - stage: build - extends: - - .docker-env - - .test-refs - variables: - SKIP_WASM_BUILD: 1 - DOC_INDEX_PAGE: "substrate/index.html" # default redirected page - # this variable gets overriden by "rusty-cachier environment inject", use the value as default - CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target" - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" - when: on_success - expire_in: 7 days - paths: - - ./crate-docs/ - # DAG: this is artificial dependency - needs: - - job: cargo-clippy - artifacts: false - script: - - rusty-cachier snapshot create - - time cargo doc --locked --workspace --all-features --verbose --no-deps - - rm -f $CARGO_TARGET_DIR/doc/.lock - - mv $CARGO_TARGET_DIR/doc ./crate-docs - # FIXME: remove me after CI image gets nonroot - - chown -R nonroot:nonroot ./crate-docs - - echo "" > ./crate-docs/index.html - - rusty-cachier cache upload diff --git a/substrate/scripts/ci/gitlab/pipeline/check.yml b/substrate/scripts/ci/gitlab/pipeline/check.yml deleted file mode 100644 index 576daec9b43311ff39cb076c1f8b706b4751db85..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/pipeline/check.yml +++ /dev/null @@ -1,78 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "check" stage - -check-runtime: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - variables: - CI_IMAGE: "paritytech/tools:latest" - GITLAB_API: "https://gitlab.parity.io/api/v4" - GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" - script: - - ./scripts/ci/gitlab/check_runtime.sh - allow_failure: true - -check-signed-tag: - stage: check - extends: .kubernetes-env - variables: - CI_IMAGE: "paritytech/tools:latest" - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - ./scripts/ci/gitlab/check_signed.sh - -test-dependency-rules: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - variables: - CI_IMAGE: "paritytech/tools:latest" - script: - - ./scripts/ci/gitlab/ensure-deps.sh - -test-rust-features: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - script: - - git clone - --depth=1 - --branch="$PIPELINE_SCRIPTS_TAG" - https://github.com/paritytech/pipeline-scripts - - bash ./pipeline-scripts/rust-features.sh . - -test-rust-feature-propagation: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - script: - - cargo install --locked --version 0.7.4 -q -f zepter && zepter --version - - echo "👉 Hello developer! If you see this CI check failing then it means that one of the crates is missing a feature for one of its dependencies. The output below tells you which feature needs to be added for which dependency to which crate. You can do this by modifying the Cargo.toml file. For more context see the MR where this check was introduced https://github.com/paritytech/substrate/pull/14660" - - zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --feature-enables-dep="try-runtime:frame-try-runtime" --locked - - zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --feature-enables-dep="runtime-benchmarks:frame-benchmarking" --locked - - zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --locked - allow_failure: true # Experimental - -test-prometheus-alerting-rules: - stage: check - extends: .kubernetes-env - variables: - CI_IMAGE: "paritytech/tools:latest" - rules: - - if: $CI_PIPELINE_SOURCE == "pipeline" - when: never - - if: $CI_COMMIT_BRANCH - changes: - - .gitlab-ci.yml - - ./scripts/ci/monitoring/**/* - script: - - promtool check rules ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml - - cat ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml | - promtool test rules ./scripts/ci/monitoring/alerting-rules/alerting-rule-tests.yaml diff --git a/substrate/scripts/ci/gitlab/pipeline/publish.yml b/substrate/scripts/ci/gitlab/pipeline/publish.yml deleted file mode 100644 index c90af7ba347ba83914d35b100ec94f88886f54b1..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/pipeline/publish.yml +++ /dev/null @@ -1,270 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "publish" stage - -.build-push-docker-image-common: - extends: - - .kubernetes-env - stage: publish - variables: - CI_IMAGE: $BUILDAH_IMAGE - GIT_STRATEGY: none - DOCKERFILE: $PRODUCT.Dockerfile - IMAGE_NAME: docker.io/$IMAGE_PATH - before_script: - - !reference [.kubernetes-env, before_script] - - cd ./artifacts/$PRODUCT/ - - VERSION="$(cat ./VERSION)" - - echo "${PRODUCT} version = ${VERSION}" - - test -z "${VERSION}" && exit 1 - script: - - test "$DOCKER_USER" -a "$DOCKER_PASS" || - ( echo "no docker credentials provided"; exit 1 ) - - $BUILDAH_COMMAND build - --format=docker - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --build-arg IMAGE_NAME="${IMAGE_PATH}" - --tag "$IMAGE_NAME:$VERSION" - --tag "$IMAGE_NAME:latest" - --file "$DOCKERFILE" . - - echo "$DOCKER_PASS" | - buildah login --username "$DOCKER_USER" --password-stdin docker.io - - $BUILDAH_COMMAND info - - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$VERSION" - - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:latest" - after_script: - - buildah logout --all - - echo "SUBSTRATE_IMAGE_NAME=${IMAGE_NAME}" | tee -a ./artifacts/$PRODUCT/build.env - - IMAGE_TAG="$(cat ./artifacts/$PRODUCT/VERSION)" - - echo "SUBSTRATE_IMAGE_TAG=${IMAGE_TAG}" | tee -a ./artifacts/$PRODUCT/build.env - - cat ./artifacts/$PRODUCT/build.env - -.build-push-docker-image: - extends: - - .publish-refs - - .build-push-docker-image-common - variables: - IMAGE_PATH: parity/$PRODUCT - DOCKER_USER: $Docker_Hub_User_Parity - DOCKER_PASS: $Docker_Hub_Pass_Parity - -.push-docker-image-description: - stage: publish - extends: - - .kubernetes-env - variables: - CI_IMAGE: paritytech/dockerhub-description - DOCKERHUB_REPOSITORY: parity/$PRODUCT - DOCKER_USERNAME: $Docker_Hub_User_Parity - DOCKER_PASSWORD: $Docker_Hub_Pass_Parity - README_FILEPATH: $CI_PROJECT_DIR/scripts/ci/docker/$PRODUCT.Dockerfile.README.md - rules: - - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push" - changes: - - scripts/ci/docker/$PRODUCT.Dockerfile.README.md - before_script: - - echo - script: - - cd / && sh entrypoint.sh - -# publish image to docker.io/paritypr, (e.g. for later use in zombienet testing) -.build-push-image-temporary: - extends: - - .build-refs - - .build-push-docker-image-common - variables: - IMAGE_PATH: paritypr/$PRODUCT - DOCKER_USER: $PARITYPR_USER - DOCKER_PASS: $PARITYPR_PASS - -publish-docker-substrate: - extends: .build-push-docker-image - needs: - - job: build-linux-substrate - artifacts: true - variables: - PRODUCT: substrate - -publish-docker-description-substrate: - extends: .push-docker-image-description - variables: - PRODUCT: substrate - SHORT_DESCRIPTION: "Substrate Docker Image." - -publish-docker-substrate-temporary: - extends: .build-push-image-temporary - needs: - - job: build-linux-substrate - artifacts: true - variables: - PRODUCT: substrate - artifacts: - reports: - # this artifact is used in zombienet-tests job - # https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance - dotenv: ./artifacts/$PRODUCT/build.env - expire_in: 24h - -publish-docker-subkey: - extends: .build-push-docker-image - needs: - - job: build-subkey-linux - artifacts: true - variables: - PRODUCT: subkey - -publish-docker-description-subkey: - extends: .push-docker-image-description - variables: - PRODUCT: subkey - SHORT_DESCRIPTION: "The subkey program is a key management utility for Substrate-based blockchains." - -publish-s3-release: - stage: publish - extends: - - .publish-refs - - .kubernetes-env - needs: - - job: build-linux-substrate - artifacts: true - - job: build-subkey-linux - artifacts: true - image: paritytech/awscli:latest - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "substrate/${ARCH}-${DOCKER_OS}" - script: - - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ - - echo "update objects in latest path" - - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/ - --recursive --human-readable --summarize - -publish-rustdoc: - stage: publish - extends: .kubernetes-env - variables: - CI_IMAGE: node:16 - GIT_DEPTH: 100 - RUSTDOCS_DEPLOY_REFS: "master" - rules: - - if: $CI_PIPELINE_SOURCE == "pipeline" - when: never - - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME =~ /^monthly-20[0-9]{2}-[0-9]{2}.*$/ # to support: monthly-2021-09+1 - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - # `needs:` can be removed after CI image gets nonroot. In this case `needs:` stops other - # artifacts from being dowloaded by this job. - needs: - - job: build-rustdoc - artifacts: true - script: - # If $CI_COMMIT_REF_NAME doesn't match one of $RUSTDOCS_DEPLOY_REFS space-separated values, we - # exit immediately. - # Putting spaces at the front and back to ensure we are not matching just any substring, but the - # whole space-separated value. - - '[[ " ${RUSTDOCS_DEPLOY_REFS} " =~ " ${CI_COMMIT_REF_NAME} " ]] || exit 0' - # setup ssh - - eval $(ssh-agent) - - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} - - mkdir ~/.ssh && touch ~/.ssh/known_hosts - - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts - # Set git config - - git config user.email "devops-team@parity.io" - - git config user.name "${GITHUB_USER}" - - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git" - - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - - git fetch origin gh-pages - # Save README and docs - - cp -r ./crate-docs/ /tmp/doc/ - - cp README.md /tmp/doc/ - # we don't need to commit changes because we copy docs to /tmp - - git checkout gh-pages --force - # Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS - - which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud - - index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME} - # Ensure the destination dir doesn't exist. - - rm -rf ${CI_COMMIT_REF_NAME} - - mv -f /tmp/doc ${CI_COMMIT_REF_NAME} - # Upload files - - git add --all - # `git commit` has an exit code of > 0 if there is nothing to commit. - # This causes GitLab to exit immediately and marks this job failed. - # We don't want to mark the entire job failed if there's nothing to - # publish though, hence the `|| true`. - - git commit -m "___Updated docs for ${CI_COMMIT_REF_NAME}___" || - echo "___Nothing to commit___" - - git push origin gh-pages --force - after_script: - - rm -rf .git/ ./* - -publish-draft-release: - stage: publish - image: paritytech/tools:latest - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - ./scripts/ci/gitlab/publish_draft_release.sh - allow_failure: true - -.publish-crates-template: - stage: publish - extends: - - .crates-publishing-template - - .crates-publishing-pipeline - # We don't want multiple jobs racing to publish crates as it's redundant and they might overwrite - # the releases of one another. Use resource_group to ensure that at most one instance of this job - # is running at any given time. - resource_group: crates-publishing - # crates.io currently rate limits crate publishing at 1 per minute: - # https://github.com/paritytech/release-engineering/issues/123#issuecomment-1335509748 - # Taking into account the 202 (as of Dec 07, 2022) publishable Substrate crates, in the worst - # case, due to the rate limits alone, we'd have to wait through at least 202 minutes of delay. - # Taking into account also the verification steps and extra synchronization delays after - # publishing the crate, the job needs to have a much higher timeout than average. - timeout: 9h - # A custom publishing environment is used for us to be able to set up protected secrets - # specifically for it - environment: publish-crates - script: - - rusty-cachier snapshot create - - git clone - --depth 1 - --branch "$RELENG_SCRIPTS_BRANCH" - https://github.com/paritytech/releng-scripts.git - - CRATESIO_TARGET_INSTANCE=default ./releng-scripts/publish-crates - - rusty-cachier cache upload - -publish-crates: - extends: .publish-crates-template - # publish-crates should only be run if publish-crates-locally passes - needs: - - job: check-crate-publishing - artifacts: false - -publish-crates-manual: - extends: .publish-crates-template - when: manual - interruptible: false - -check-crate-publishing: - stage: publish - extends: - - .crates-publishing-template - - .crates-publishing-pipeline - # When lots of crates are taken into account (for example on master where all crates are tested) - # the job might take a long time, as evidenced by: - # https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2269364 - timeout: 4h - script: - - rusty-cachier snapshot create - - git clone - --depth 1 - --branch "$RELENG_SCRIPTS_BRANCH" - https://github.com/paritytech/releng-scripts.git - - CRATESIO_TARGET_INSTANCE=local ./releng-scripts/publish-crates - - rusty-cachier cache upload diff --git a/substrate/scripts/ci/gitlab/pipeline/test.yml b/substrate/scripts/ci/gitlab/pipeline/test.yml deleted file mode 100644 index 9c057e8d91582455e05da7f8cb9b264793831ead..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/pipeline/test.yml +++ /dev/null @@ -1,494 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "test" stage - -# It's more like a check and it belongs to the previous stage, but we want to run this job with real tests in parallel -find-fail-ci-phrase: - stage: test - variables: - CI_IMAGE: "paritytech/tools:latest" - ASSERT_REGEX: "FAIL-CI" - GIT_DEPTH: 1 - extends: - - .kubernetes-env - script: - - set +e - - rg --line-number --hidden --type rust --glob '!{.git,target}' "$ASSERT_REGEX" .; exit_status=$? - - if [ $exit_status -eq 0 ]; then - echo "$ASSERT_REGEX was found, exiting with 1"; - exit 1; - else - echo "No $ASSERT_REGEX was found, exiting with 0"; - exit 0; - fi - -cargo-deny-licenses: - stage: test - extends: - - .docker-env - - .test-refs - variables: - CARGO_DENY_CMD: "cargo deny --all-features check licenses -c ./scripts/ci/deny.toml" - script: - - rusty-cachier snapshot create - - $CARGO_DENY_CMD --hide-inclusion-graph - - rusty-cachier cache upload - after_script: - - !reference [.rusty-cachier, after_script] - - echo "___The complete log is in the artifacts___" - - $CARGO_DENY_CMD 2> deny.log - - if [ $CI_JOB_STATUS != 'success' ]; then - echo 'Please check license of your crate or add an exception to scripts/ci/deny.toml'; - fi - artifacts: - name: $CI_COMMIT_SHORT_SHA - expire_in: 3 days - when: always - paths: - - deny.log - -cargo-fmt: - stage: test - variables: - RUSTY_CACHIER_TOOLCHAIN: nightly - extends: - - .docker-env - - .test-refs - script: - - rusty-cachier snapshot create - - cargo +nightly fmt --all -- --check - - rusty-cachier cache upload - -cargo-fmt-manifest: - stage: test - extends: - - .docker-env - - .test-refs - script: - - cargo install zepter --locked --version 0.11.1 -q -f --no-default-features && zepter --version - - echo "👉 Hello developer! If you see this CI check failing then it means that one of the your changes in a Cargo.toml file introduced ill-formatted or unsorted features. Please take a look at 'docs/STYLE_GUIDE.md#manifest-formatting' to find out more." - - zepter format features --check - allow_failure: true # Experimental - -cargo-clippy: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: cargo-fmt - artifacts: false - extends: - - .docker-env - - .test-refs - script: - - echo $RUSTFLAGS - - cargo version && cargo clippy --version - - rusty-cachier snapshot create - - SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo clippy --locked --all-targets --workspace - - rusty-cachier cache upload - -cargo-check-benches: - stage: test - variables: - CI_JOB_NAME: "cargo-check-benches" - extends: - - .docker-env - - .test-refs-check-benches - - .collect-artifacts - - .pipeline-stopper-artifacts - before_script: - - !reference [.timestamp, before_script] - # perform rusty-cachier operations before any further modifications to the git repo to make cargo feel cheated not so much - - !reference [.rust-info-script, script] - - !reference [.job-switcher, before_script] - - !reference [.rusty-cachier, before_script] - - !reference [.pipeline-stopper-vars, script] - # merges in the master branch on PRs. skip if base is not master - - 'if [ $CI_COMMIT_REF_NAME != "master" ]; then - BASE=$(curl -s -H "Authorization: Bearer ${GITHUB_PR_TOKEN}" https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME} | jq -r .base.ref); - printf "Merging base branch %s\n" "${BASE:=master}"; - if [ $BASE != "master" ]; then - echo "$BASE is not master, skipping merge"; - else - git config user.email "ci@gitlab.parity.io"; - git fetch origin "refs/heads/${BASE}"; - git merge --verbose --no-edit FETCH_HEAD; - fi - fi' - parallel: 2 - script: - - rusty-cachier snapshot create - - mkdir -p ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA - # this job is executed in parallel on two runners - - echo "___Running benchmarks___"; - - case ${CI_NODE_INDEX} in - 1) - SKIP_WASM_BUILD=1 time cargo check --locked --benches --all; - cargo run --locked --release -p node-bench -- ::trie::read::small --json - | tee ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::trie::read::small.json; - echo "___Uploading cache for rusty-cachier___"; - rusty-cachier cache upload - ;; - 2) - cargo run --locked --release -p node-bench -- ::node::import::sr25519::transfer_keep_alive::paritydb::small --json - | tee ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::node::import::sr25519::transfer_keep_alive::paritydb::small.json - ;; - esac - -node-bench-regression-guard: - # it's not belong to `build` semantically, but dag jobs can't depend on each other - # within the single stage - https://gitlab.com/gitlab-org/gitlab/-/issues/30632 - # more: https://github.com/paritytech/substrate/pull/8519#discussion_r608012402 - stage: build - extends: - - .docker-env - - .test-refs-no-trigger-prs-only - needs: - # this is a DAG - - job: cargo-check-benches - artifacts: true - # polls artifact from master to compare with current result - # need to specify both parallel jobs from master because of the bug - # https://gitlab.com/gitlab-org/gitlab/-/issues/39063 - - project: $CI_PROJECT_PATH - job: "cargo-check-benches 1/2" - ref: master - artifacts: true - - project: $CI_PROJECT_PATH - job: "cargo-check-benches 2/2" - ref: master - artifacts: true - variables: - CI_IMAGE: "paritytech/node-bench-regression-guard:latest" - before_script: - - !reference [.timestamp, before_script] - script: - - echo "------- IMPORTANT -------" - - echo "node-bench-regression-guard depends on the results of a cargo-check-benches job" - - echo "In case of this job failure, check your pipeline's cargo-check-benches" - - "node-bench-regression-guard --reference artifacts/benches/master-* - --compare-with artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA" - after_script: [""] - -cargo-check-try-runtime-and-experimental: - stage: test - extends: - - .docker-env - - .test-refs - script: - - rusty-cachier snapshot create - - time cargo check --workspace --locked --features try-runtime,experimental - - rusty-cachier cache upload - -test-deterministic-wasm: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: cargo-check-try-runtime-and-experimental - artifacts: false - extends: - - .docker-env - - .test-refs - variables: - WASM_BUILD_NO_COLOR: 1 - # this variable gets overriden by "rusty-cachier environment inject", use the value as default - CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target" - script: - - rusty-cachier snapshot create - # build runtime - - cargo build --locked --verbose --release -p kitchensink-runtime - # make checksum - - sha256sum $CARGO_TARGET_DIR/release/wbuild/kitchensink-runtime/target/wasm32-unknown-unknown/release/kitchensink_runtime.wasm > checksum.sha256 - # clean up - - rm -rf $CARGO_TARGET_DIR/release/wbuild - # build again - - cargo build --locked --verbose --release -p kitchensink-runtime - # confirm checksum - - sha256sum -c ./checksum.sha256 - # clean up again, don't put release binaries into the cache - - rm -rf $CARGO_TARGET_DIR/release/wbuild - - rusty-cachier cache upload - -test-linux-stable: - stage: test - extends: - - .docker-env - - .test-refs - - .pipeline-stopper-artifacts - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - # Ensure we run the UI tests. - RUN_UI_TESTS: 1 - # needed for rusty-cachier to keep cache in test-linux-stable folder and not in test-linux-stable-1/3 - CI_JOB_NAME: "test-linux-stable" - parallel: 3 - script: - - rusty-cachier snapshot create - # this job runs all tests in former runtime-benchmarks, frame-staking and wasmtime tests - # tests are partitioned by nextest and executed in parallel on $CI_NODE_TOTAL runners - - echo "Node index - ${CI_NODE_INDEX}. Total amount - ${CI_NODE_TOTAL}" - - time cargo nextest run --workspace - --locked - --release - --verbose - --features runtime-benchmarks,try-runtime,experimental - --manifest-path ./bin/node/cli/Cargo.toml - --partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL} - # run runtime-api tests with `enable-staging-api` feature - - time cargo nextest run -p sp-api-test --features enable-staging-api - # we need to update cache only from one job - - if [ ${CI_NODE_INDEX} == 1 ]; then rusty-cachier cache upload; fi - # Upload tests results to Elasticsearch - - echo "Upload test results to Elasticsearch" - - cat target/nextest/default/junit.xml | xq . > target/nextest/default/junit.json - - | - curl -v -XPOST --http1.1 \ - -u ${ELASTIC_USERNAME}:${ELASTIC_PASSWORD} \ - https://elasticsearch.parity-build.parity.io/unit-tests/_doc/${CI_JOB_ID} \ - -H 'Content-Type: application/json' \ - -d @target/nextest/default/junit.json || echo "failed to upload junit report" - artifacts: - when: always - paths: - - target/nextest/default/junit.xml - reports: - junit: target/nextest/default/junit.xml - -test-frame-support: - stage: test - extends: - - .docker-env - - .test-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - # Ensure we run the UI tests. - RUN_UI_TESTS: 1 - script: - - rusty-cachier snapshot create - - cat /cargo_target_dir/debug/.fingerprint/memory_units-759eddf317490d2b/lib-memory_units.json || true - - time cargo test --verbose --locked -p frame-support-test --features=frame-feature-testing,no-metadata-docs,try-runtime,experimental --manifest-path ./frame/support/test/Cargo.toml - - time cargo test --verbose --locked -p frame-support-test --features=frame-feature-testing,frame-feature-testing-2,no-metadata-docs,try-runtime,experimental --manifest-path ./frame/support/test/Cargo.toml - - SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --verbose --locked -- --ignored timeout - - cat /cargo_target_dir/debug/.fingerprint/memory_units-759eddf317490d2b/lib-memory_units.json || true - - rusty-cachier cache upload - -# This job runs tests that don't work with cargo-nextest in test-linux-stable -test-linux-stable-extra: - stage: test - extends: - - .docker-env - - .test-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - # Ensure we run the UI tests. - RUN_UI_TESTS: 1 - script: - - rusty-cachier snapshot create - # Run node-cli tests - # TODO: add to test-linux-stable-nextest after fix https://github.com/paritytech/substrate/issues/11321 - - time cargo test node-cli --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path ./bin/node/cli/Cargo.toml - # Run doctests - # TODO: add to test-linux-stable-nextest after fix https://github.com/nextest-rs/nextest/issues/16 - - time cargo test --doc --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path ./bin/node/cli/Cargo.toml - - rusty-cachier cache upload - -# This job runs all benchmarks defined in the `/bin/node/runtime` once to check that there are no errors. -quick-benchmarks: - stage: test - extends: - - .docker-env - - .test-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: "full" - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - script: - - rusty-cachier snapshot create - - time cargo run --locked --release -p node-cli --features runtime-benchmarks -- benchmark pallet --wasm-execution compiled --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 - - rusty-cachier cache upload - -test-frame-examples-compile-to-wasm: - # into one job - stage: test - extends: - - .docker-env - - .test-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions" - RUST_BACKTRACE: 1 - script: - - rusty-cachier snapshot create - - cd ./frame/examples/offchain-worker/ - - cargo build --locked --target=wasm32-unknown-unknown --no-default-features - - cd ../basic - - cargo build --locked --target=wasm32-unknown-unknown --no-default-features - - rusty-cachier cache upload - -test-linux-stable-int: - stage: test - extends: - - .docker-env - - .test-refs - - .pipeline-stopper-artifacts - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - # Ensure we run the UI tests. - RUN_UI_TESTS: 1 - script: - - rusty-cachier snapshot create - - WASM_BUILD_NO_COLOR=1 - RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace - time cargo test -p node-cli --release --verbose --locked -- --ignored - - rusty-cachier cache upload - -# more information about this job can be found here: -# https://github.com/paritytech/substrate/pull/6916 -check-tracing: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: test-linux-stable-int - artifacts: false - extends: - - .docker-env - - .test-refs - - .pipeline-stopper-artifacts - script: - - rusty-cachier snapshot create - # with-tracing must be explicitly activated, we run a test to ensure this works as expected in both cases - - time cargo test --locked --manifest-path ./primitives/tracing/Cargo.toml --no-default-features - - time cargo test --locked --manifest-path ./primitives/tracing/Cargo.toml --no-default-features --features=with-tracing - - rusty-cachier cache upload - -# more information about this job can be found here: -# https://github.com/paritytech/substrate/pull/3778 -test-full-crypto-feature: - stage: test - # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs - needs: - - job: check-tracing - artifacts: false - extends: - - .docker-env - - .test-refs - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-C debug-assertions" - RUST_BACKTRACE: 1 - script: - - rusty-cachier snapshot create - - cd primitives/core/ - - time cargo build --locked --verbose --no-default-features --features full_crypto - - cd ../application-crypto - - time cargo build --locked --verbose --no-default-features --features full_crypto - - rusty-cachier cache upload - -check-rustdoc: - stage: test - extends: - - .docker-env - - .test-refs - variables: - SKIP_WASM_BUILD: 1 - RUSTDOCFLAGS: "-Dwarnings" - script: - - rusty-cachier snapshot create - - time cargo doc --locked --workspace --all-features --verbose --no-deps - - rusty-cachier cache upload - -cargo-check-each-crate: - stage: test - extends: - - .docker-env - - .test-refs - - .collect-artifacts - - .pipeline-stopper-artifacts - variables: - # $CI_JOB_NAME is set manually so that rusty-cachier can share the cache for all - # "cargo-check-each-crate I/N" jobs - CI_JOB_NAME: cargo-check-each-crate - script: - - rusty-cachier snapshot create - - PYTHONUNBUFFERED=x time ./scripts/ci/gitlab/check-each-crate.py "$CI_NODE_INDEX" "$CI_NODE_TOTAL" - # need to update cache only from one job - - if [ "$CI_NODE_INDEX" == 1 ]; then rusty-cachier cache upload; fi - parallel: 2 - -cargo-check-each-crate-macos: - stage: test - extends: - - .test-refs - - .collect-artifacts - - .pipeline-stopper-artifacts - before_script: - # skip timestamp script, the osx bash doesn't support printf %()T - - !reference [.job-switcher, before_script] - - !reference [.rust-info-script, script] - - !reference [.pipeline-stopper-vars, script] - variables: - SKIP_WASM_BUILD: 1 - script: - # TODO: enable rusty-cachier once it supports Mac - # TODO: use parallel jobs, as per cargo-check-each-crate, once more Mac runners are available - # - time ./scripts/ci/gitlab/check-each-crate.py 1 1 - - time cargo check --workspace --locked - tags: - - osx - -cargo-hfuzz: - stage: test - extends: - - .docker-env - - .test-refs - - .pipeline-stopper-artifacts - variables: - # max 10s per iteration, 60s per file - HFUZZ_RUN_ARGS: > - --exit_upon_crash - --exit_code_upon_crash 1 - --timeout 10 - --run_time 60 - # use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes: - # https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian - # https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr - # https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling rusty-cachier's absolute CARGO_TARGET_DIR - HFUZZ_BUILD_ARGS: > - --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs" - --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981" - artifacts: - name: "hfuzz-$CI_COMMIT_SHORT_SHA" - expire_in: 7 days - when: on_failure - paths: - - primitives/arithmetic/fuzzer/hfuzz_workspace/ - script: - - cd ./primitives/arithmetic/fuzzer - - rusty-cachier snapshot create - - cargo hfuzz build - - rusty-cachier cache upload - - for target in $(cargo read-manifest | jq -r '.targets | .[] | .name'); do - cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; }; done diff --git a/substrate/scripts/ci/gitlab/pipeline/zombienet.yml b/substrate/scripts/ci/gitlab/pipeline/zombienet.yml deleted file mode 100644 index 31ee510343278943838420679705212d61e75d2d..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/pipeline/zombienet.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This file is part of .gitlab-ci.yml -# Here are all jobs that are executed during "zombienet" stage - -# common settings for all zombienet jobs -.zombienet-common: - before_script: - - echo "Zombie-net Tests Config" - - echo "${ZOMBIENET_IMAGE}" - - echo "${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IMAGE_TAG}" - - echo "${GH_DIR}" - - export DEBUG=zombie,zombie::network-node - - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG} - - echo "${ZOMBIENET_INTEGRATION_TEST_IMAGE}" - stage: zombienet - image: "${ZOMBIENET_IMAGE}" - needs: - - job: publish-docker-substrate-temporary - extends: - - .kubernetes-env - - .zombienet-refs - variables: - GH_DIR: "https://github.com/paritytech/substrate/tree/${CI_COMMIT_SHA}/zombienet" - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1 - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" - when: always - expire_in: 2 days - paths: - - ./zombienet-logs - after_script: - - mkdir -p ./zombienet-logs - - cp /tmp/zombie*/logs/* ./zombienet-logs/ - retry: 2 - tags: - - zombienet-polkadot-integration-test - -zombienet-0000-block-building: - extends: - - .zombienet-common - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}/0000-block-building" - --test="block-building.zndsl" - -zombienet-0001-basic-warp-sync: - extends: - - .zombienet-common - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}/0001-basic-warp-sync" - --test="test-warp-sync.zndsl" - -zombienet-0002-validators-warp-sync: - extends: - - .zombienet-common - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}/0002-validators-warp-sync" - --test="test-validators-warp-sync.zndsl" - -zombienet-0003-block-building-warp-sync: - extends: - - .zombienet-common - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh - --github-remote-dir="${GH_DIR}/0003-block-building-warp-sync" - --test="test-block-building-warp-sync.zndsl" diff --git a/substrate/scripts/ci/gitlab/prettier.sh b/substrate/scripts/ci/gitlab/prettier.sh deleted file mode 100755 index 299bbee179dcaeff3fbadffd89fb4548ac878555..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/prettier.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# meant to be installed via -# git config filter.ci-prettier.clean "scripts/ci/gitlab/prettier.sh" - -prettier --parser yaml diff --git a/substrate/scripts/ci/gitlab/publish_draft_release.sh b/substrate/scripts/ci/gitlab/publish_draft_release.sh deleted file mode 100755 index 88d1de0e04fe3c17245d5e7dd95e5dd632625ad3..0000000000000000000000000000000000000000 --- a/substrate/scripts/ci/gitlab/publish_draft_release.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=../common/lib.sh -source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" - -version="$CI_COMMIT_TAG" - -# Note that this is not the last *tagged* version, but the last *published* version -last_version=$(last_github_release 'paritytech/substrate') - -release_text="$(./generate_release_text.sh "$last_version" "$version")" - -echo "[+] Pushing release to github" -# Create release on github -release_name="Substrate $version" -data=$(jq -Rs --arg version "$version" \ - --arg release_name "$release_name" \ - --arg release_text "$release_text" \ -'{ - "tag_name": $version, - "target_commitish": "master", - "name": $release_name, - "body": $release_text, - "draft": true, - "prerelease": false -}' < /dev/null) - -out=$(curl -s -X POST --data "$data" -H "Authorization: token $GITHUB_RELEASE_TOKEN" "$api_base/paritytech/substrate/releases") - -html_url=$(echo "$out" | jq -r .html_url) - -if [ "$html_url" == "null" ] -then - echo "[!] Something went wrong posting:" - echo "$out" -else - echo "[+] Release draft created: $html_url" -fi - -echo '[+] Sending draft release URL to Matrix' - -msg_body=$(cat <Release pipeline for Substrate $version complete.
-Draft release created: $html_url -EOF -) -send_message "$(structure_message "$msg_body" "$formatted_msg_body")" "!aJymqQYtCjjqImFLSb:parity.io" "$RELEASENOTES_MATRIX_V2_ACCESS_TOKEN" - -echo "[+] Done! Maybe the release worked..." diff --git a/substrate/scripts/ci/node-template-release/Cargo.toml b/substrate/scripts/ci/node-template-release/Cargo.toml index 5cd90a25f6cc17beaa40ddb2bf41d315bff45cf0..6c4cee8ece335b106239bdf5c91372f187269812 100644 --- a/substrate/scripts/ci/node-template-release/Cargo.toml +++ b/substrate/scripts/ci/node-template-release/Cargo.toml @@ -11,7 +11,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } flate2 = "1.0" fs_extra = "1.3" glob = "0.3" diff --git a/substrate/scripts/ci/node-template-release/src/main.rs b/substrate/scripts/ci/node-template-release/src/main.rs index 9681d73fa6fccdea2d4db5037372f841bc4c300b..850535e4045f9fa2e63caa782ad6f66efd3ef28c 100644 --- a/substrate/scripts/ci/node-template-release/src/main.rs +++ b/substrate/scripts/ci/node-template-release/src/main.rs @@ -1,3 +1,21 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + use std::{ collections::HashMap, fs::{self, File, OpenOptions}, diff --git a/substrate/test-utils/Cargo.toml b/substrate/test-utils/Cargo.toml index 977d1f694057cc5f25bdfa2f33233719948634fb..31bdc0f663a10734d1e4775f1fb03c63ffb9f1ed 100644 --- a/substrate/test-utils/Cargo.toml +++ b/substrate/test-utils/Cargo.toml @@ -15,7 +15,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] futures = "0.3.16" tokio = { version = "1.22.0", features = ["macros", "time"] } -substrate-test-utils-derive = { path = "derive" } [dev-dependencies] trybuild = { version = "1.0.74", features = [ "diff" ] } diff --git a/substrate/test-utils/client/Cargo.toml b/substrate/test-utils/client/Cargo.toml index 1ee3e74fdd1b35a658c7f3a54545569ad87f837b..91c30f5a8ecef0ffb525ba536c5763701d90975f 100644 --- a/substrate/test-utils/client/Cargo.toml +++ b/substrate/test-utils/client/Cargo.toml @@ -17,7 +17,7 @@ array-bytes = "6.1" async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" sc-client-api = { path = "../../client/api" } sc-client-db = { path = "../../client/db", default-features = false, features = [ diff --git a/substrate/test-utils/derive/Cargo.toml b/substrate/test-utils/derive/Cargo.toml deleted file mode 100644 index 8299f6db04837d118b6cc4f68ffdc76d202d71f2..0000000000000000000000000000000000000000 --- a/substrate/test-utils/derive/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "substrate-test-utils-derive" -version = "0.10.0-dev" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -homepage = "https://substrate.io" -repository.workspace = true -description = "Substrate test utilities macros" -publish = false - -[dependencies] -proc-macro-crate = "1.1.3" -proc-macro2 = "1.0.56" -quote = "1.0.28" -syn = { version = "2.0.16", features = ["full"] } - -[lib] -proc-macro = true diff --git a/substrate/test-utils/derive/src/lib.rs b/substrate/test-utils/derive/src/lib.rs deleted file mode 100644 index 0291d825e768cec16e8e5f3cb979fe7d78e8c759..0000000000000000000000000000000000000000 --- a/substrate/test-utils/derive/src/lib.rs +++ /dev/null @@ -1,73 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -use proc_macro::{Span, TokenStream}; -use proc_macro_crate::{crate_name, FoundCrate}; -use quote::quote; - -#[proc_macro_attribute] -pub fn test(args: TokenStream, item: TokenStream) -> TokenStream { - let input = syn::parse_macro_input!(item as syn::ItemFn); - - parse_knobs(input, args.into()).unwrap_or_else(|e| e.to_compile_error().into()) -} - -fn parse_knobs( - mut input: syn::ItemFn, - args: proc_macro2::TokenStream, -) -> Result { - let sig = &mut input.sig; - let body = &input.block; - let attrs = &input.attrs; - let vis = input.vis; - - if !sig.inputs.is_empty() { - return Err(syn::Error::new_spanned(&sig, "No arguments expected for tests.")) - } - - let crate_name = match crate_name("substrate-test-utils") { - Ok(FoundCrate::Itself) => syn::Ident::new("substrate_test_utils", Span::call_site().into()), - Ok(FoundCrate::Name(crate_name)) => syn::Ident::new(&crate_name, Span::call_site().into()), - Err(e) => return Err(syn::Error::new_spanned(&sig, e)), - }; - - let header = { - quote! { - #[#crate_name::tokio::test( #args )] - } - }; - - let result = quote! { - #header - #(#attrs)* - #vis #sig { - if #crate_name::tokio::time::timeout( - std::time::Duration::from_secs( - std::env::var("SUBSTRATE_TEST_TIMEOUT") - .ok() - .and_then(|x| x.parse().ok()) - .unwrap_or(600)), - async move { #body }, - ).await.is_err() { - panic!("The test took too long!"); - } - } - }; - - Ok(result.into()) -} diff --git a/substrate/test-utils/runtime/Cargo.toml b/substrate/test-utils/runtime/Cargo.toml index 654479f5fdd0d477e42f24717ba7484e141b5383..4f587d55e79da2d918f1a5aaa81d30496c927f7c 100644 --- a/substrate/test-utils/runtime/Cargo.toml +++ b/substrate/test-utils/runtime/Cargo.toml @@ -48,7 +48,7 @@ sp-externalities = { path = "../../primitives/externalities", default-features = # 3rd party array-bytes = { version = "6.1", optional = true } log = { version = "0.4.17", default-features = false } -serde = { version = "1.0.163", features = ["alloc", "derive"], default-features = false } +serde = { version = "1.0.188", features = ["alloc", "derive"], default-features = false } serde_json = { version = "1.0.85", default-features = false, features = ["alloc"] } [dev-dependencies] diff --git a/substrate/test-utils/src/lib.rs b/substrate/test-utils/src/lib.rs index 1ad702893683f696728bc1ecfb10e832b480da22..30472e79b3f15b3ee2d252c27641bd2f9f1511bc 100644 --- a/substrate/test-utils/src/lib.rs +++ b/substrate/test-utils/src/lib.rs @@ -17,26 +17,6 @@ //! Test utils -#[doc(hidden)] -pub use futures; -/// Marks async function to be executed by an async runtime suitable to test environment. -/// -/// # Requirements -/// -/// You must have tokio in the `[dev-dependencies]` of your crate to use this macro. -/// -/// # Example -/// -/// ``` -/// #[substrate_test_utils::test] -/// async fn basic_test() { -/// assert!(true); -/// } -/// ``` -pub use substrate_test_utils_derive::test; -#[doc(hidden)] -pub use tokio; - /// Panic when the vectors are different, without taking the order into account. /// /// # Examples diff --git a/substrate/test-utils/test-crate/Cargo.toml b/substrate/test-utils/test-crate/Cargo.toml deleted file mode 100644 index bb68c9f18ede51870e84a29c8eaef9af5e78685c..0000000000000000000000000000000000000000 --- a/substrate/test-utils/test-crate/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "substrate-test-utils-test-crate" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -homepage = "https://substrate.io" -repository.workspace = true -publish = false - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dev-dependencies] -tokio = { version = "1.22.0", features = ["macros"] } -sc-service = { path = "../../client/service" } -test-utils = { package = "substrate-test-utils", path = ".." } diff --git a/substrate/test-utils/test-crate/src/main.rs b/substrate/test-utils/test-crate/src/main.rs deleted file mode 100644 index cab4cc6e924d7b0d1731477f5c3d3833153690f2..0000000000000000000000000000000000000000 --- a/substrate/test-utils/test-crate/src/main.rs +++ /dev/null @@ -1,25 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#[cfg(test)] -#[test_utils::test] -async fn basic_test() { - assert!(true); -} - -fn main() {} diff --git a/substrate/test-utils/tests/basic.rs b/substrate/test-utils/tests/basic.rs deleted file mode 100644 index e8c46b1e837d2f7f6cfde7ea980aabc37c998667..0000000000000000000000000000000000000000 --- a/substrate/test-utils/tests/basic.rs +++ /dev/null @@ -1,49 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#[substrate_test_utils::test] -async fn basic_test() { - assert!(true); -} - -#[substrate_test_utils::test] -#[should_panic(expected = "boo!")] -async fn panicking_test() { - panic!("boo!"); -} - -#[substrate_test_utils::test(flavor = "multi_thread", worker_threads = 1)] -async fn basic_test_with_args() { - assert!(true); -} - -// NOTE: enable this test only after setting SUBSTRATE_TEST_TIMEOUT to a smaller value -// -// SUBSTRATE_TEST_TIMEOUT=1 cargo test -- --ignored timeout -#[substrate_test_utils::test] -#[should_panic(expected = "test took too long")] -#[ignore] -async fn timeout() { - tokio::time::sleep(std::time::Duration::from_secs( - std::env::var("SUBSTRATE_TEST_TIMEOUT") - .expect("env var SUBSTRATE_TEST_TIMEOUT has been provided by the user") - .parse::() - .unwrap() + 1, - )) - .await; -} diff --git a/substrate/test-utils/tests/ui.rs b/substrate/test-utils/tests/ui.rs deleted file mode 100644 index baf822bb87a49c8e43278c2686afc2811aee6c09..0000000000000000000000000000000000000000 --- a/substrate/test-utils/tests/ui.rs +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#[test] -fn substrate_test_utils_derive_trybuild() { - let t = trybuild::TestCases::new(); - t.compile_fail("tests/ui/too-many-func-parameters.rs"); -} diff --git a/substrate/test-utils/tests/ui/too-many-func-parameters.rs b/substrate/test-utils/tests/ui/too-many-func-parameters.rs deleted file mode 100644 index 0eece5f9e6130cea8b291beae2256185ae1659af..0000000000000000000000000000000000000000 --- a/substrate/test-utils/tests/ui/too-many-func-parameters.rs +++ /dev/null @@ -1,24 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#[substrate_test_utils::test] -async fn too_many_func_parameters(_: u32) { - assert!(true); -} - -fn main() {} diff --git a/substrate/test-utils/tests/ui/too-many-func-parameters.stderr b/substrate/test-utils/tests/ui/too-many-func-parameters.stderr deleted file mode 100644 index 1b1630022e4f7e48aa6ad346e756257ab9544752..0000000000000000000000000000000000000000 --- a/substrate/test-utils/tests/ui/too-many-func-parameters.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: No arguments expected for tests. - --> $DIR/too-many-func-parameters.rs:20:1 - | -20 | async fn too_many_func_parameters(_: u32) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/substrate/utils/frame/benchmarking-cli/Cargo.toml b/substrate/utils/frame/benchmarking-cli/Cargo.toml index 7238aa2ba324ec306236a4060eea307bd257a837..096e4be82d4bb9aa444f8b5ff38920cc7bfabfe5 100644 --- a/substrate/utils/frame/benchmarking-cli/Cargo.toml +++ b/substrate/utils/frame/benchmarking-cli/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = "6.1" chrono = "0.4" -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1" } comfy-table = { version = "7.0.1", default-features = false } handlebars = "4.2.2" @@ -26,7 +26,7 @@ linked-hash-map = "0.5.4" log = "0.4.17" rand = { version = "0.8.4", features = ["small_rng"] } rand_pcg = "0.3.1" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" thiserror = "1.0.30" thousands = "0.2.0" diff --git a/substrate/utils/frame/frame-utilities-cli/Cargo.toml b/substrate/utils/frame/frame-utilities-cli/Cargo.toml index 4e6392d51025fd69e3a9e7bb2b9df591e75ee3af..d191506a2acbbc5d2e1626b46eb5d048dd0cf6e9 100644 --- a/substrate/utils/frame/frame-utilities-cli/Cargo.toml +++ b/substrate/utils/frame/frame-utilities-cli/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://docs.rs/substrate-frame-cli" readme = "README.md" [dependencies] -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } frame-support = { path = "../../../frame/support" } frame-system = { path = "../../../frame/system" } sc-cli = { path = "../../../client/cli" } diff --git a/substrate/utils/frame/generate-bags/Cargo.toml b/substrate/utils/frame/generate-bags/Cargo.toml index 471f18b4ab4eb2d3cd2065cace2ae28e221e0319..ac22197c5ac4b3fe25de85eb704572420595cb91 100644 --- a/substrate/utils/frame/generate-bags/Cargo.toml +++ b/substrate/utils/frame/generate-bags/Cargo.toml @@ -17,5 +17,5 @@ pallet-staking = { path = "../../../frame/staking" } sp-staking = { path = "../../../primitives/staking" } # third party -chrono = { version = "0.4.19" } +chrono = { version = "0.4.27" } num-format = "0.4.3" diff --git a/substrate/utils/frame/generate-bags/node-runtime/Cargo.toml b/substrate/utils/frame/generate-bags/node-runtime/Cargo.toml index c72912aeafcecf5b8cd4c8ad202fb5835ba8f914..43005ca5c4a3121680c32bb39d4a4c4c90afa352 100644 --- a/substrate/utils/frame/generate-bags/node-runtime/Cargo.toml +++ b/substrate/utils/frame/generate-bags/node-runtime/Cargo.toml @@ -14,4 +14,4 @@ kitchensink-runtime = { path = "../../../../bin/node/runtime" } generate-bags = { path = ".." } # third-party -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } diff --git a/substrate/utils/frame/remote-externalities/Cargo.toml b/substrate/utils/frame/remote-externalities/Cargo.toml index 49f9fac11f62c8097b2c71bdc7e21a70f47d89aa..ad6ab006da1dcd0c69c3ffa1b24a2a00128c6d34 100644 --- a/substrate/utils/frame/remote-externalities/Cargo.toml +++ b/substrate/utils/frame/remote-externalities/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] jsonrpsee = { version = "0.16.2", features = ["http-client"] } codec = { package = "parity-scale-codec", version = "3.6.1" } log = "0.4.17" -serde = "1.0.163" +serde = "1.0.188" sp-core = { path = "../../../primitives/core" } sp-state-machine = { path = "../../../primitives/state-machine" } sp-io = { path = "../../../primitives/io" } diff --git a/substrate/utils/frame/try-runtime/cli/Cargo.toml b/substrate/utils/frame/try-runtime/cli/Cargo.toml index 01b655cea8aed58a27baf696b2cbd1e4a078dfa5..7d1c204422ae3b72d67ba991db198f6755b2df4d 100644 --- a/substrate/utils/frame/try-runtime/cli/Cargo.toml +++ b/substrate/utils/frame/try-runtime/cli/Cargo.toml @@ -35,13 +35,13 @@ frame-try-runtime = { path = "../../../../frame/try-runtime", optional = true} substrate-rpc-client = { path = "../../rpc/client" } async-trait = "0.1.57" -clap = { version = "4.2.5", features = ["derive"] } +clap = { version = "4.4.2", features = ["derive"] } hex = { version = "0.4.3", default-features = false } log = "0.4.17" parity-scale-codec = "3.6.1" -serde = "1.0.163" +serde = "1.0.188" serde_json = "1.0.85" -zstd = { version = "0.12.3", default-features = false } +zstd = { version = "0.12.4", default-features = false } [dev-dependencies] assert_cmd = "2.0.10" diff --git a/substrate/zombienet/0001-basic-warp-sync/test-warp-sync.toml b/substrate/zombienet/0001-basic-warp-sync/test-warp-sync.toml index 272b5862e8e89fa8dbe7c0a2e7fbd116e92af1d3..d14d77cfe621ca44585d4a55bcb5dea269ebccfc 100644 --- a/substrate/zombienet/0001-basic-warp-sync/test-warp-sync.toml +++ b/substrate/zombienet/0001-basic-warp-sync/test-warp-sync.toml @@ -6,7 +6,7 @@ default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" default_command = "substrate" chain = "gen-db" -chain_spec_path = "zombienet/0001-basic-warp-sync/chain-spec.json" +chain_spec_path = "substrate/zombienet/0001-basic-warp-sync/chain-spec.json" [[relaychain.nodes]] name = "alice" diff --git a/substrate/zombienet/0002-validators-warp-sync/test-validators-warp-sync.toml b/substrate/zombienet/0002-validators-warp-sync/test-validators-warp-sync.toml index df4414f5c8b5f1ca52aec28a9a581faf4cb0ac68..8336672ad497e12b89822ef371eec1539260c411 100644 --- a/substrate/zombienet/0002-validators-warp-sync/test-validators-warp-sync.toml +++ b/substrate/zombienet/0002-validators-warp-sync/test-validators-warp-sync.toml @@ -6,7 +6,7 @@ default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" default_command = "substrate" chain = "gen-db" -chain_spec_path = "zombienet/0002-validators-warp-sync/chain-spec.json" +chain_spec_path = "substrate/zombienet/0002-validators-warp-sync/chain-spec.json" [[relaychain.nodes]] name = "alice" diff --git a/substrate/zombienet/0003-block-building-warp-sync/test-block-building-warp-sync.toml b/substrate/zombienet/0003-block-building-warp-sync/test-block-building-warp-sync.toml index 5119c919c70c4b42271ed9ae9ce2417de0b55c88..6642ba8fea3ca7c22fe6d5c835db3249aaf2ee53 100644 --- a/substrate/zombienet/0003-block-building-warp-sync/test-block-building-warp-sync.toml +++ b/substrate/zombienet/0003-block-building-warp-sync/test-block-building-warp-sync.toml @@ -6,7 +6,7 @@ default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" default_command = "substrate" chain = "gen-db" -chain_spec_path = "zombienet/0003-block-building-warp-sync/chain-spec.json" +chain_spec_path = "substrate/zombienet/0003-block-building-warp-sync/chain-spec.json" #we need at least 3 nodes for warp sync [[relaychain.nodes]]