diff --git a/.github/commands-readme.md b/.github/commands-readme.md
index 793524e056f8..ce4e0fd0d789 100644
--- a/.github/commands-readme.md
+++ b/.github/commands-readme.md
@@ -10,6 +10,7 @@ The current available command actions are:
- [Command FMT](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-fmt.yml)
- [Command Update UI](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-update-ui.yml)
+- [Command Prdoc](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-prdoc.yml)
- [Command Sync](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-sync.yml)
- [Command Bench](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench.yml)
- [Command Bench All](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench-all.yml)
@@ -235,6 +236,16 @@ You can use the following [`gh cli`](https://cli.github.com/) inside the repo:
gh workflow run command-bench-overheard.yml -f pr=1000 -f benchmark=substrate -f runtime=rococo -f target_dir=substrate
```
+### PrDoc
+
+Generate a PrDoc with the crates populated by all modified crates.
+
+Options:
+- `pr`: The PR number to generate the PrDoc for.
+- `audience`: The audience of whom the changes may concern.
+- `bump`: A default bump level for all crates. The PrDoc will likely need to be edited to reflect the actual changes after generation.
+- `overwrite`: Whether to overwrite any existing PrDoc.
+
### Sync
Run sync and commit back results to PR.
diff --git a/.github/scripts/common/lib.sh b/.github/scripts/common/lib.sh
index 33ef2d3e7eda..bfb3120ad9bb 100755
--- a/.github/scripts/common/lib.sh
+++ b/.github/scripts/common/lib.sh
@@ -315,6 +315,7 @@ function import_gpg_keys() {
) &
done
wait
+ gpg -k $SEC
}
# Check the GPG signature for a given binary
@@ -457,3 +458,15 @@ function get_polkadot_node_version_from_code() {
# Remove the semicolon
sed 's/;//g'
}
+
+validate_stable_tag() {
+ tag="$1"
+ pattern='^stable[0-9]+(-[0-9]+)?$'
+
+ if [[ $tag =~ $pattern ]]; then
+ echo $tag
+ else
+ echo "The input '$tag' does not match the pattern."
+ exit 1
+ fi
+}
diff --git a/.github/scripts/generate-prdoc.py b/.github/scripts/generate-prdoc.py
new file mode 100644
index 000000000000..b7b2e6f970fa
--- /dev/null
+++ b/.github/scripts/generate-prdoc.py
@@ -0,0 +1,112 @@
+#!/usr/bin/env python3
+
+"""
+Generate the PrDoc for a Pull Request with a specific number, audience and bump level.
+
+It downloads and parses the patch from the GitHub API to opulate the prdoc with all modified crates.
+This will delete any prdoc that already exists for the PR if `--force` is passed.
+
+Usage:
+ python generate-prdoc.py --pr 1234 --audience "TODO" --bump "TODO"
+"""
+
+import argparse
+import os
+import re
+import sys
+import subprocess
+import toml
+import yaml
+import requests
+
+from github import Github
+import whatthepatch
+from cargo_workspace import Workspace
+
+# Download the patch and pass the info into `create_prdoc`.
+def from_pr_number(n, audience, bump, force):
+ print(f"Fetching PR '{n}' from GitHub")
+ g = Github()
+
+ repo = g.get_repo("paritytech/polkadot-sdk")
+ pr = repo.get_pull(n)
+
+ patch_url = pr.patch_url
+ patch = requests.get(patch_url).text
+
+ create_prdoc(n, audience, pr.title, pr.body, patch, bump, force)
+
+def create_prdoc(pr, audience, title, description, patch, bump, force):
+ path = f"prdoc/pr_{pr}.prdoc"
+
+ if os.path.exists(path):
+ if force == True:
+ print(f"Overwriting existing PrDoc for PR {pr}")
+ else:
+ print(f"PrDoc already exists for PR {pr}. Use --force to overwrite.")
+ sys.exit(1)
+ else:
+ print(f"No preexisting PrDoc for PR {pr}")
+
+ prdoc = { "doc": [{}], "crates": [] }
+
+ prdoc["title"] = title
+ prdoc["doc"][0]["audience"] = audience
+ prdoc["doc"][0]["description"] = description
+
+ workspace = Workspace.from_path(".")
+
+ modified_paths = []
+ for diff in whatthepatch.parse_patch(patch):
+ modified_paths.append(diff.header.new_path)
+
+ modified_crates = {}
+ for p in modified_paths:
+ # Go up until we find a Cargo.toml
+ p = os.path.join(workspace.path, p)
+ while not os.path.exists(os.path.join(p, "Cargo.toml")):
+ p = os.path.dirname(p)
+
+ with open(os.path.join(p, "Cargo.toml")) as f:
+ manifest = toml.load(f)
+
+ if not "package" in manifest:
+ print(f"File was not in any crate: {p}")
+ continue
+
+ crate_name = manifest["package"]["name"]
+ if workspace.crate_by_name(crate_name).publish:
+ modified_crates[crate_name] = True
+ else:
+ print(f"Skipping unpublished crate: {crate_name}")
+
+ print(f"Modified crates: {modified_crates.keys()}")
+
+ for crate_name in modified_crates.keys():
+ entry = { "name": crate_name }
+
+ if bump == 'silent' or bump == 'ignore' or bump == 'no change':
+ entry["validate"] = False
+ else:
+ entry["bump"] = bump
+
+ print(f"Adding crate {entry}")
+ prdoc["crates"].append(entry)
+
+ # write the parsed PR documentation back to the file
+ with open(path, "w") as f:
+ yaml.dump(prdoc, f)
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--pr", type=int, required=True)
+ parser.add_argument("--audience", type=str, default="TODO")
+ parser.add_argument("--bump", type=str, default="TODO")
+ parser.add_argument("--force", type=str)
+ return parser.parse_args()
+
+if __name__ == "__main__":
+ args = parse_args()
+ force = True if args.force.lower() == "true" else False
+ print(f"Args: {args}, force: {force}")
+ from_pr_number(args.pr, args.audience, args.bump, force)
diff --git a/.github/workflows/check-changed-files.yml b/.github/workflows/check-changed-files.yml
deleted file mode 100644
index 657c05cd047d..000000000000
--- a/.github/workflows/check-changed-files.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-# Reusable workflow to perform checks and generate conditions for other workflows.
-# Currently it checks if any Rust (build-related) file is changed
-# and if the current (caller) workflow file is changed.
-# Example:
-#
-# jobs:
-# changes:
-# permissions:
-# pull-requests: read
-# uses: ./.github/workflows/check-changed-files.yml
-# some-job:
-# needs: changes
-# if: ${{ needs.changes.outputs.rust }}
-# .......
-
-name: Check changes files
-
-on:
- workflow_call:
- # Map the workflow outputs to job outputs
- outputs:
- rust:
- value: ${{ jobs.changes.outputs.rust }}
- description: 'true if any of the build-related OR current (caller) workflow files have changed'
- current-workflow:
- value: ${{ jobs.changes.outputs.current-workflow }}
- description: 'true if current (caller) workflow file has changed'
-
-jobs:
- changes:
- runs-on: ubuntu-latest
- permissions:
- pull-requests: read
- outputs:
- # true if current workflow (caller) file is changed
- rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.current-workflow == 'true' }}
- current-workflow: ${{ steps.filter.outputs.current-workflow }}
- steps:
- - id: current-file
- run: echo "current-workflow-file=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
- - run: echo "${{ steps.current-file.outputs.current-workflow-file }}"
- # For pull requests it's not necessary to checkout the code
- - id: filter
- uses: dorny/paths-filter@v3
- with:
- predicate-quantifier: 'every'
- # current-workflow - check if the current (caller) workflow file is changed
- # rust - check if any Rust (build-related) file is changed
- filters: |
- current-workflow:
- - '${{ steps.current-file.outputs.current-workflow-file }}'
- rust:
- - '**/*'
- - '!.github/**/*'
- - '!prdoc/**/*'
- - '!docs/**/*'
- #
\ No newline at end of file
diff --git a/.github/workflows/check-frame-omni-bencher.yml b/.github/workflows/check-frame-omni-bencher.yml
new file mode 100644
index 000000000000..e9db2d912979
--- /dev/null
+++ b/.github/workflows/check-frame-omni-bencher.yml
@@ -0,0 +1,85 @@
+name: Short benchmarks (frame-omni-bencher)
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ types: [ opened, synchronize, reopened, ready_for_review, labeled ]
+ merge_group:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+env:
+ ARTIFACTS_NAME: frame-omni-bencher-artifacts
+
+jobs:
+ changes:
+ # TODO: remove once migration is complete or this workflow is fully stable
+ if: contains(github.event.label.name, 'GHA-migration')
+ permissions:
+ pull-requests: read
+ uses: ./.github/workflows/reusable-check-changed-files.yml
+
+ set-image:
+ # GitHub Actions allows using 'env' in a container context.
+ # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
+ # This workaround sets the container image for each job using 'set-image' job output.
+ runs-on: ubuntu-latest
+ needs: changes
+ if: ${{ needs.changes.outputs.rust }}
+ outputs:
+ IMAGE: ${{ steps.set_image.outputs.IMAGE }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: set_image
+ run: cat .github/env >> $GITHUB_OUTPUT
+
+ run-frame-omni-bencher:
+ runs-on: arc-runners-polkadot-sdk-beefy
+ needs: [ set-image, changes ] # , build-frame-omni-bencher ]
+ if: ${{ needs.changes.outputs.rust }}
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
+ matrix:
+ runtime:
+ [
+ westend-runtime,
+ rococo-runtime,
+ asset-hub-rococo-runtime,
+ asset-hub-westend-runtime,
+ bridge-hub-rococo-runtime,
+ bridge-hub-westend-runtime,
+ collectives-westend-runtime,
+ coretime-rococo-runtime,
+ coretime-westend-runtime,
+ people-rococo-runtime,
+ people-westend-runtime,
+ glutton-westend-runtime,
+ ]
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ env:
+ PACKAGE_NAME: ${{ matrix.runtime }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: script
+ run: |
+ RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
+ RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
+ forklift cargo build --release --locked -p $PACKAGE_NAME -p frame-omni-bencher --features runtime-benchmarks
+ echo "Running short benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
+ ls -lrt $RUNTIME_BLOB_PATH
+ ./target/release/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1
+ confirm-frame-omni-benchers-passed:
+ runs-on: ubuntu-latest
+ name: All benchmarks passed
+ needs: run-frame-omni-bencher
+ steps:
+ - run: echo '### Good job! All the benchmarks passed 🚀' >> $GITHUB_STEP_SUMMARY
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
new file mode 100644
index 000000000000..054c7d786ca9
--- /dev/null
+++ b/.github/workflows/checks.yml
@@ -0,0 +1,90 @@
+name: checks
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ types: [opened, synchronize, reopened, ready_for_review, labeled]
+ merge_group:
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
+
+jobs:
+ changes:
+ # TODO: remove once migration is complete or this workflow is fully stable
+ if: contains(github.event.label.name, 'GHA-migration')
+ permissions:
+ pull-requests: read
+ uses: ./.github/workflows/reusable-check-changed-files.yml
+ set-image:
+ # GitHub Actions allows using 'env' in a container context.
+ # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
+ # This workaround sets the container image for each job using 'set-image' job output.
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ outputs:
+ IMAGE: ${{ steps.set_image.outputs.IMAGE }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: set_image
+ run: cat .github/env >> $GITHUB_OUTPUT
+ cargo-clippy:
+ runs-on: arc-runners-polkadot-sdk-beefy
+ needs: [set-image, changes] # , build-frame-omni-bencher ]
+ if: ${{ needs.changes.outputs.rust }}
+ timeout-minutes: 40
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ env:
+ RUSTFLAGS: "-D warnings"
+ SKIP_WASM_BUILD: 1
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - name: script
+ run: |
+ forklift cargo clippy --all-targets --locked --workspace
+ forklift cargo clippy --all-targets --all-features --locked --workspace
+ check-try-runtime:
+ runs-on: arc-runners-polkadot-sdk-beefy
+ needs: [set-image, changes] # , build-frame-omni-bencher ]
+ if: ${{ needs.changes.outputs.rust }}
+ timeout-minutes: 40
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - name: script
+ run: |
+ forklift cargo check --locked --all --features try-runtime
+ # this is taken from cumulus
+ # Check that parachain-template will compile with `try-runtime` feature flag.
+ forklift cargo check --locked -p parachain-template-node --features try-runtime
+ # add after https://github.com/paritytech/substrate/pull/14502 is merged
+ # experimental code may rely on try-runtime and vice-versa
+ forklift cargo check --locked --all --features try-runtime,experimental
+ # check-core-crypto-features works fast without forklift
+ check-core-crypto-features:
+ runs-on: arc-runners-polkadot-sdk-beefy
+ needs: [set-image, changes] # , build-frame-omni-bencher ]
+ if: ${{ needs.changes.outputs.rust }}
+ timeout-minutes: 30
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - name: script
+ run: |
+ cd substrate/primitives/core
+ ./check-features-variants.sh
+ cd -
+ cd substrate/primitives/application-crypto
+ ./check-features-variants.sh
+ cd -
+ cd substrate/primitives/keyring
+ ./check-features-variants.sh
+ cd -
diff --git a/.github/workflows/command-inform.yml b/.github/workflows/command-inform.yml
index 2825f4a60460..afdcf4c1b7b9 100644
--- a/.github/workflows/command-inform.yml
+++ b/.github/workflows/command-inform.yml
@@ -7,7 +7,8 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
- if: github.event.issue.pull_request && startsWith(github.event.comment.body, 'bot ')
+ # Temporary disable the bot until the new command bot works properly
+ if: github.event.issue.pull_request && startsWith(github.event.comment.body, 'bot ') && false
steps:
- name: Inform that the new command exist
uses: actions/github-script@v7
diff --git a/.github/workflows/command-prdoc.yml b/.github/workflows/command-prdoc.yml
new file mode 100644
index 000000000000..da8f14089cb8
--- /dev/null
+++ b/.github/workflows/command-prdoc.yml
@@ -0,0 +1,78 @@
+name: Command PrDoc
+
+on:
+ workflow_dispatch:
+ inputs:
+ pr:
+ type: number
+ description: Number of the Pull Request
+ required: true
+ bump:
+ type: choice
+ description: Default bump level for all crates
+ default: "TODO"
+ required: true
+ options:
+ - "TODO"
+ - "no change"
+ - "patch"
+ - "minor"
+ - "major"
+ audience:
+ type: choice
+ description: Audience of the PrDoc
+ default: "TODO"
+ required: true
+ options:
+ - "TODO"
+ - "Runtime Dev"
+ - "Runtime User"
+ - "Node Dev"
+ - "Node User"
+ overwrite:
+ type: choice
+ description: Overwrite existing PrDoc
+ default: "true"
+ required: true
+ options:
+ - "true"
+ - "false"
+
+concurrency:
+ group: command-prdoc
+ cancel-in-progress: true
+
+jobs:
+ cmd-prdoc:
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - name: Download repo
+ uses: actions/checkout@v4
+ - name: Install gh cli
+ id: gh
+ uses: ./.github/actions/set-up-gh
+ with:
+ pr-number: ${{ inputs.pr }}
+ GH_TOKEN: ${{ github.token }}
+ - name: Generate PrDoc
+ run: |
+ python3 -m pip install -q cargo-workspace PyGithub whatthepatch pyyaml toml
+
+ python3 .github/scripts/generate-prdoc.py --pr "${{ inputs.pr }}" --bump "${{ inputs.bump }}" --audience "${{ inputs.audience }}" --force "${{ inputs.overwrite }}"
+
+ - name: Report failure
+ if: ${{ failure() }}
+ run: gh pr comment ${{ inputs.pr }} --body "
Command failed ❌
Run by @${{ github.actor }} for ${{ github.workflow }}
failed. See logs here."
+ env:
+ RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ GH_TOKEN: ${{ github.token }}
+ - name: Push Commit
+ uses: stefanzweifel/git-auto-commit-action@v5
+ with:
+ commit_message: Add PrDoc (auto generated)
+ branch: ${{ steps.gh.outputs.branch }}
+ file_pattern: 'prdoc/*.prdoc'
diff --git a/.github/workflows/misc-sync-templates.yml b/.github/workflows/misc-sync-templates.yml
index d22dc8724f37..c06beb5e98eb 100644
--- a/.github/workflows/misc-sync-templates.yml
+++ b/.github/workflows/misc-sync-templates.yml
@@ -166,9 +166,13 @@ jobs:
title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.stable_release_branch }}"
body: "The template has NOT been successfully built and needs to be inspected."
branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
- - name: Push changes
- run: |
- git add -A .
- git commit --allow-empty -m "Update to ${{ github.event.inputs.stable_release_branch }} triggered by ${{ github.event_name }}"
- git push
- working-directory: "${{ env.template-path }}"
+ - name: Create PR on success
+ uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v5
+ with:
+ path: "${{ env.template-path }}"
+ token: ${{ steps.app_token.outputs.token }}
+ add-paths: |
+ ./*
+ title: "Update the ${{ matrix.template }} template to ${{ github.event.inputs.stable_release_branch }}"
+ body: "This synchronizes the template to the ${{ github.event.inputs.stable_release_branch }} branch."
+ branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
diff --git a/.github/workflows/misc-update-wishlist-leaderboard.yml b/.github/workflows/misc-update-wishlist-leaderboard.yml
index 68625e5433ca..326168717674 100644
--- a/.github/workflows/misc-update-wishlist-leaderboard.yml
+++ b/.github/workflows/misc-update-wishlist-leaderboard.yml
@@ -11,6 +11,7 @@ permissions:
jobs:
update-wishlist-leaderboard:
+ if: github.repository == 'paritytech/polkadot-sdk'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/release-50_publish-docker.yml b/.github/workflows/release-50_publish-docker.yml
index cda10f2ebf15..f09ecf1c7998 100644
--- a/.github/workflows/release-50_publish-docker.yml
+++ b/.github/workflows/release-50_publish-docker.yml
@@ -45,7 +45,7 @@ on:
type: string
default: docker.io
- # The owner is often the same than the Docker Hub username but does ont have to be.
+ # The owner is often the same as the Docker Hub username but does ont have to be.
# In our case, it is not.
owner:
description: Owner of the container image repo
@@ -58,6 +58,10 @@ on:
default: v0.9.18
required: true
+ stable_tag:
+ description: Tag matching the actual stable release version in the format stableYYMM or stableYYMM-X for patch releases
+ required: true
+
permissions:
contents: write
@@ -74,6 +78,29 @@ env:
VERSION: ${{ inputs.version }}
jobs:
+ validate-inputs:
+ runs-on: ubuntu-latest
+ outputs:
+ stable_tag: ${{ steps.validate_inputs.outputs.stable_tag }}
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - name: Validate inputs
+ id: validate_inputs
+ run: |
+ . ./.github/scripts/common/lib.sh
+
+ VERSION=$(filter_version_from_input "${{ inputs.version }}")
+ echo "VERSION=${VERSION}" >> $GITHUB_ENV
+
+ RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
+ echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
+
+ STABLE_TAG=$(validate_stable_tag ${{ inputs.stable_tag }})
+ echo "stable_tag=${STABLE_TAG}" >> $GITHUB_OUTPUT
+
fetch-artifacts: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
@@ -102,9 +129,6 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
- VERSION=$(filter_version_from_input "${{ inputs.version }}")
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
-
fetch_release_artifacts_from_s3
- name: Fetch chain-spec-builder rc artifacts or release artifacts based on release id
@@ -112,7 +136,7 @@ jobs:
if: ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary == 'chain-spec-builder' }}
run: |
. ./.github/scripts/common/lib.sh
- RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
+
fetch_release_artifacts
- name: Upload artifacts
@@ -124,7 +148,7 @@ jobs:
build-container: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
- needs: fetch-artifacts
+ needs: [fetch-artifacts, validate-inputs]
environment: release
steps:
@@ -179,7 +203,7 @@ jobs:
release=$( echo $VERSION | cut -f1 -d- )
echo "tag=latest" >> $GITHUB_OUTPUT
echo "release=${release}" >> $GITHUB_OUTPUT
- echo "stable=stable" >> $GITHUB_OUTPUT
+ echo "stable=${{ needs.validate-inputs.outputs.stable_tag }}" >> $GITHUB_OUTPUT
- name: Build Injected Container image for polkadot rc or chain-spec-builder
if: ${{ env.BINARY == 'polkadot' || env.BINARY == 'chain-spec-builder' }}
@@ -257,7 +281,7 @@ jobs:
build-polkadot-release-container: # this job will be triggered for polkadot release build
if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
runs-on: ubuntu-latest
- needs: fetch-latest-debian-package-version
+ needs: [fetch-latest-debian-package-version, validate-inputs]
environment: release
steps:
- name: Checkout sources
@@ -295,7 +319,7 @@ jobs:
# TODO: The owner should be used below but buildx does not resolve the VARs
# TODO: It would be good to get rid of this GHA that we don't really need.
tags: |
- parity/polkadot:stable
+ parity/polkadot:${{ needs.validate-inputs.outputs.stable_tag }}
parity/polkadot:latest
parity/polkadot:${{ needs.fetch-latest-debian-package-version.outputs.polkadot_container_tag }}
build-args: |
diff --git a/.github/workflows/reusable-check-changed-files.yml b/.github/workflows/reusable-check-changed-files.yml
new file mode 100644
index 000000000000..47f0620439c7
--- /dev/null
+++ b/.github/workflows/reusable-check-changed-files.yml
@@ -0,0 +1,59 @@
+# Reusable workflow to perform checks and generate conditions for other workflows.
+# Currently it checks if any Rust (build-related) file is changed
+# and if the current (caller) workflow file is changed.
+# Example:
+#
+# jobs:
+# changes:
+# permissions:
+# pull-requests: read
+# uses: ./.github/workflows/reusable-check-changed-files.yml
+# some-job:
+# needs: changes
+# if: ${{ needs.changes.outputs.rust }}
+# .......
+
+name: Check changes files
+
+on:
+ workflow_call:
+ # Map the workflow outputs to job outputs
+ outputs:
+ rust:
+ value: ${{ jobs.changes.outputs.rust }}
+ description: "true if any of the build-related OR current (caller) workflow files have changed"
+ current-workflow:
+ value: ${{ jobs.changes.outputs.current-workflow }}
+ description: "true if current (caller) workflow file has changed"
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ outputs:
+ # true if current workflow (caller) file is changed
+ rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.current-workflow == 'true' }}
+ current-workflow: ${{ steps.filter.outputs.current-workflow }}
+ steps:
+ - id: current-file
+ run: echo "current-workflow-file=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
+ - run: echo "${{ steps.current-file.outputs.current-workflow-file }}"
+ # For pull requests it's not necessary to checkout the code
+ - name: Checkout
+ if: github.event_name != 'pull_request'
+ uses: actions/checkout@v4
+ - id: filter
+ uses: dorny/paths-filter@v3
+ with:
+ predicate-quantifier: "every"
+ # current-workflow - check if the current (caller) workflow file is changed
+ # rust - check if any Rust (build-related) file is changed
+ filters: |
+ current-workflow:
+ - '${{ steps.current-file.outputs.current-workflow-file }}'
+ rust:
+ - '**/*'
+ - '!.github/**/*'
+ - '!prdoc/**/*'
+ - '!docs/**/*'
diff --git a/.github/workflows/subsystem-benchmarks.yml b/.github/workflows/subsystem-benchmarks.yml
new file mode 100644
index 000000000000..7c19b420a6ac
--- /dev/null
+++ b/.github/workflows/subsystem-benchmarks.yml
@@ -0,0 +1,82 @@
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ types: [ opened, synchronize, reopened, closed, labeled ]
+ merge_group:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+ pull-requests: write
+
+jobs:
+ set-image:
+ # TODO: remove once migration is complete or this workflow is fully stable
+ if: contains(github.event.label.name, 'GHA-migration')
+ # GitHub Actions allows using 'env' in a container context.
+ # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
+ # This workaround sets the container image for each job using 'set-image' job output.
+ runs-on: ubuntu-latest
+ outputs:
+ IMAGE: ${{ steps.set_image.outputs.IMAGE }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: set_image
+ run: cat .github/env >> $GITHUB_OUTPUT
+
+ build:
+ needs: [ set-image ]
+ runs-on: arc-runners-polkadot-sdk-benchmark
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ env:
+ BENCH_DIR: ./charts/bench/${{ matrix.features.bench }}
+ BENCH_FILE_NAME: ${{ matrix.features.bench }}
+ strategy:
+ fail-fast: false
+ matrix:
+ features: [
+ { name: "polkadot-availability-recovery", bench: "availability-recovery-regression-bench" },
+ { name: "polkadot-availability-distribution", bench: "availability-distribution-regression-bench" },
+ { name: "polkadot-node-core-approval-voting", bench: "approval-voting-regression-bench" },
+ { name: "polkadot-statement-distribution", bench: "statement-distribution-regression-bench" }
+ ]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Check Rust
+ run: |
+ rustup show
+ rustup +nightly show
+
+ - name: Run Benchmarks
+ continue-on-error: true
+ id: run-benchmarks
+ run: |
+ cargo bench -p ${{ matrix.features.name }} --bench ${{ matrix.features.bench }} --features subsystem-benchmarks || echo "Benchmarks failed"
+ ls -lsa ./charts
+ mkdir -p $BENCH_DIR || echo "Directory exists"
+ cp charts/${BENCH_FILE_NAME}.json $BENCH_DIR
+ ls -lsa $BENCH_DIR
+ # Fixes "detected dubious ownership" error in the ci
+ git config --global --add safe.directory '*'
+
+ - name: Publish result to GH Pages
+ if: ${{ steps.run-benchmarks.outcome == 'success' }}
+ uses: benchmark-action/github-action-benchmark@v1
+ with:
+ tool: "customSmallerIsBetter"
+ name: ${{ env.BENCH_FILE_NAME }}
+ output-file-path: ${{ env.BENCH_DIR }}/${{ env.BENCH_FILE_NAME }}.json
+ benchmark-data-dir-path: ${{ env.BENCH_DIR }}
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ comment-on-alert: ${{ github.event_name == 'pull_request' }} # will comment on PRs if regression is detected
+ auto-push: false # TODO: enable when gitlab part is removed ${{ github.ref == 'refs/heads/master' }}
+
diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml
index 55addf11de06..4a13f5318f7d 100644
--- a/.github/workflows/tests-linux-stable.yml
+++ b/.github/workflows/tests-linux-stable.yml
@@ -6,7 +6,7 @@ on:
branches:
- master
pull_request:
- types: [opened, synchronize, reopened, ready_for_review]
+ types: [opened, synchronize, reopened, ready_for_review, labeled]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -14,9 +14,11 @@ concurrency:
jobs:
changes:
+ # TODO: remove once migration is complete or this workflow is fully stable
+ if: contains(github.event.label.name, 'GHA-migration')
permissions:
pull-requests: read
- uses: ./.github/workflows/check-changed-files.yml
+ uses: ./.github/workflows/reusable-check-changed-files.yml
set-image:
# GitHub Actions allows using 'env' in a container context.
@@ -51,7 +53,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: script
- run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored
+ run: WASM_BUILD_NO_COLOR=1 forklift cargo test -p staging-node-cli --release --locked -- --ignored
# https://github.com/paritytech/ci_cd/issues/864
test-linux-stable-runtime-benchmarks:
@@ -70,4 +72,55 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: script
- run: time forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
+ run: forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
+
+ test-linux-stable:
+ needs: [set-image, changes]
+ if: ${{ needs.changes.outputs.rust }}
+ runs-on: ${{ matrix.runners }}
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ partition: [1/3, 2/3, 3/3]
+ runners: [arc-runners-polkadot-sdk-beefy, oldlinux]
+ container:
+ image: ${{ needs.set-image.outputs.IMAGE }}
+ # needed for tests that use unshare syscall
+ options: --security-opt seccomp=unconfined
+ env:
+ 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"
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: script
+ run: |
+ # Fixes "detected dubious ownership" error in the ci
+ git config --global --add safe.directory '*'
+ forklift cargo nextest run \
+ --workspace \
+ --locked \
+ --release \
+ --no-fail-fast \
+ --features try-runtime,experimental,riscv,ci-only-tests \
+ --partition count:${{ matrix.partition }}
+ # run runtime-api tests with `enable-staging-api` feature on the 1st node
+ - name: runtime-api tests
+ if: ${{ matrix.partition == '1/3' }}
+ run: forklift cargo nextest run -p sp-api-test --features enable-staging-api
+
+ confirm-required-jobs-passed:
+ runs-on: ubuntu-latest
+ name: All tests passed
+ # If any new job gets added, be sure to add it to this array
+ needs:
+ [
+ test-linux-stable-int,
+ test-linux-stable-runtime-benchmarks,
+ test-linux-stable,
+ ]
+ steps:
+ - run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a413d3306159..1be2dd7921e0 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -5,7 +5,7 @@ on:
branches:
- master
pull_request:
- types: [opened, synchronize, reopened, ready_for_review]
+ types: [ opened, synchronize, reopened, ready_for_review ]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -15,7 +15,7 @@ jobs:
changes:
permissions:
pull-requests: read
- uses: ./.github/workflows/check-changed-files.yml
+ uses: ./.github/workflows/reusable-check-changed-files.yml
set-image:
# GitHub Actions allows using 'env' in a container context.
@@ -31,7 +31,7 @@ jobs:
run: cat .github/env >> $GITHUB_OUTPUT
quick-benchmarks:
- needs: [set-image, changes]
+ needs: [ set-image, changes ]
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 60
@@ -50,7 +50,7 @@ jobs:
# cf https://github.com/paritytech/polkadot-sdk/issues/1652
test-syscalls:
- needs: [set-image, changes]
+ needs: [ set-image, changes ]
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 60
@@ -75,7 +75,7 @@ jobs:
# fi
cargo-check-all-benches:
- needs: [set-image, changes]
+ needs: [ set-image, changes ]
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 60
diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml
index 0103c6b76a2d..319c95ad6112 100644
--- a/.gitlab/pipeline/test.yml
+++ b/.gitlab/pipeline/test.yml
@@ -110,8 +110,6 @@ test-linux-stable-codecov:
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
fi
- #
-
test-linux-stable:
stage: test
extends:
diff --git a/Cargo.lock b/Cargo.lock
index 54a01f12f35c..67cfbb5968d5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -42,6 +42,15 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
+[[package]]
+name = "aead"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
+dependencies = [
+ "generic-array 0.14.7",
+]
+
[[package]]
name = "aead"
version = "0.5.2"
@@ -52,6 +61,18 @@ dependencies = [
"generic-array 0.14.7",
]
+[[package]]
+name = "aes"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8"
+dependencies = [
+ "cfg-if",
+ "cipher 0.3.0",
+ "cpufeatures",
+ "opaque-debug 0.3.0",
+]
+
[[package]]
name = "aes"
version = "0.8.3"
@@ -63,17 +84,31 @@ dependencies = [
"cpufeatures",
]
+[[package]]
+name = "aes-gcm"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f"
+dependencies = [
+ "aead 0.4.3",
+ "aes 0.7.5",
+ "cipher 0.3.0",
+ "ctr 0.7.0",
+ "ghash 0.4.4",
+ "subtle 2.5.0",
+]
+
[[package]]
name = "aes-gcm"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
dependencies = [
- "aead",
- "aes",
+ "aead 0.5.2",
+ "aes 0.8.3",
"cipher 0.4.4",
- "ctr",
- "ghash",
+ "ctr 0.9.2",
+ "ghash 0.5.0",
"subtle 2.5.0",
]
@@ -157,9 +192,9 @@ dependencies = [
"dunce",
"heck 0.4.1",
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
"syn-solidity",
"tiny-keccak",
]
@@ -228,9 +263,9 @@ dependencies = [
[[package]]
name = "anstyle"
-version = "1.0.6"
+version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
+checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
[[package]]
name = "anstyle-parse"
@@ -284,9 +319,9 @@ dependencies = [
"include_dir",
"itertools 0.10.5",
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -518,7 +553,7 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565"
dependencies = [
"num-bigint",
"num-traits",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -620,7 +655,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -661,9 +696,9 @@ dependencies = [
[[package]]
name = "array-bytes"
-version = "6.2.2"
+version = "6.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0"
+checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293"
[[package]]
name = "arrayref"
@@ -724,7 +759,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
"synstructure 0.12.6",
@@ -736,9 +771,9 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
"synstructure 0.13.1",
]
@@ -748,7 +783,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -759,16 +794,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "assert_cmd"
-version = "2.0.14"
+version = "2.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8"
+checksum = "bc65048dd435533bb1baf2ed9956b9a278fbfdcf90301b39ee117f06c0199d37"
dependencies = [
"anstyle",
"bstr",
@@ -1179,14 +1214,14 @@ version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964"
dependencies = [
- "async-lock 3.4.0",
+ "async-lock 3.3.0",
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite 2.3.0",
"parking",
"polling 3.4.0",
- "rustix 0.38.21",
+ "rustix 0.38.25",
"slab",
"tracing",
"windows-sys 0.52.0",
@@ -1203,13 +1238,13 @@ dependencies = [
[[package]]
name = "async-lock"
-version = "3.4.0"
+version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
+checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
dependencies = [
- "event-listener 5.2.0",
+ "event-listener 4.0.3",
"event-listener-strategy",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -1263,7 +1298,7 @@ dependencies = [
"log",
"memchr",
"once_cell",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"pin-utils",
"slab",
"wasm-bindgen-futures",
@@ -1277,7 +1312,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
dependencies = [
"async-stream-impl",
"futures-core",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -1286,9 +1321,9 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -1303,9 +1338,9 @@ version = "0.1.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -1318,7 +1353,7 @@ dependencies = [
"futures-sink",
"futures-util",
"memchr",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -1362,7 +1397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89"
dependencies = [
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -1508,12 +1543,12 @@ dependencies = [
"lazycell",
"peeking_take_while",
"prettyplease 0.2.12",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"regex",
"rustc-hash",
"shlex",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -2590,6 +2625,18 @@ dependencies = [
"keystream",
]
+[[package]]
+name = "chacha20"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6"
+dependencies = [
+ "cfg-if",
+ "cipher 0.3.0",
+ "cpufeatures",
+ "zeroize",
+]
+
[[package]]
name = "chacha20"
version = "0.9.1"
@@ -2603,14 +2650,14 @@ dependencies = [
[[package]]
name = "chacha20poly1305"
-version = "0.10.1"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35"
+checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5"
dependencies = [
- "aead",
- "chacha20",
- "cipher 0.4.4",
- "poly1305",
+ "aead 0.4.3",
+ "chacha20 0.8.2",
+ "cipher 0.3.0",
+ "poly1305 0.7.2",
"zeroize",
]
@@ -2715,6 +2762,15 @@ dependencies = [
"generic-array 0.14.7",
]
+[[package]]
+name = "cipher"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
+dependencies = [
+ "generic-array 0.14.7",
+]
+
[[package]]
name = "cipher"
version = "0.4.4"
@@ -2723,7 +2779,6 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
"crypto-common",
"inout",
- "zeroize",
]
[[package]]
@@ -2790,9 +2845,9 @@ dependencies = [
[[package]]
name = "clap-num"
-version = "1.0.2"
+version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "488557e97528174edaa2ee268b23a809e0c598213a4bbcb4f34575a46fda147e"
+checksum = "0e063d263364859dc54fb064cedb7c122740cd4733644b14b176c097f51e8ab7"
dependencies = [
"num-traits",
]
@@ -2827,7 +2882,7 @@ checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008"
dependencies = [
"heck 0.4.1",
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -2839,9 +2894,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e"
dependencies = [
"heck 0.5.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -2909,6 +2964,7 @@ dependencies = [
"pallet-message-queue",
"pallet-treasury",
"pallet-utility",
+ "pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
@@ -3026,7 +3082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d51beaa537d73d2d1ff34ee70bc095f170420ab2ec5d687ecd3ec2b0d092514b"
dependencies = [
"nom",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -3039,20 +3095,19 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "colored"
-version = "2.0.4"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
+checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8"
dependencies = [
- "is-terminal",
"lazy_static",
"windows-sys 0.48.0",
]
[[package]]
name = "combine"
-version = "4.6.6"
+version = "4.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
+checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
dependencies = [
"bytes",
"memchr",
@@ -3611,9 +3666,9 @@ dependencies = [
[[package]]
name = "crc"
-version = "3.2.0"
+version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2b432c56615136f8dba245fed7ec3d5518c500a31108661067e61e72fe7e6bc"
+checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636"
dependencies = [
"crc-catalog",
]
@@ -3763,6 +3818,15 @@ dependencies = [
"subtle 2.5.0",
]
+[[package]]
+name = "ctr"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481"
+dependencies = [
+ "cipher 0.3.0",
+]
+
[[package]]
name = "ctr"
version = "0.9.2"
@@ -4149,9 +4213,9 @@ name = "cumulus-pallet-parachain-system-proc-macro"
version = "0.6.0"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4256,12 +4320,8 @@ dependencies = [
name = "cumulus-primitives-aura"
version = "0.7.0"
dependencies = [
- "parity-scale-codec",
- "polkadot-core-primitives",
- "polkadot-primitives",
"sp-api",
"sp-consensus-aura",
- "sp-runtime",
]
[[package]]
@@ -4289,8 +4349,6 @@ dependencies = [
"scale-info",
"sp-core",
"sp-inherents",
- "sp-runtime",
- "sp-state-machine",
"sp-trie",
]
@@ -4343,8 +4401,6 @@ dependencies = [
"pallet-asset-conversion",
"parity-scale-codec",
"polkadot-runtime-common",
- "polkadot-runtime-parachains",
- "sp-io",
"sp-runtime",
"staging-xcm",
"staging-xcm-builder",
@@ -4656,9 +4712,9 @@ dependencies = [
[[package]]
name = "curl-sys"
-version = "0.4.72+curl-8.6.0"
+version = "0.4.73+curl-8.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea"
+checksum = "450ab250ecf17227c39afb9a2dd9261dc0035cb80f2612472fc0c4aac2dcb84d"
dependencies = [
"cc",
"libc",
@@ -4692,9 +4748,9 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4731,10 +4787,10 @@ dependencies = [
"cc",
"codespan-reporting",
"once_cell",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"scratch",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4749,9 +4805,9 @@ version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4842,12 +4898,9 @@ dependencies = [
[[package]]
name = "deranged"
-version = "0.3.11"
+version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
-dependencies = [
- "powerfmt",
-]
+checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
[[package]]
name = "derivative"
@@ -4855,7 +4908,7 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -4866,9 +4919,9 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4877,9 +4930,9 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -4889,7 +4942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"rustc_version 0.4.0",
"syn 1.0.109",
@@ -4985,9 +5038,9 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5045,10 +5098,10 @@ dependencies = [
"common-path",
"derive-syn-parse",
"once_cell",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"regex",
- "syn 2.0.61",
+ "syn 2.0.58",
"termcolor",
"toml 0.8.8",
"walkdir",
@@ -5094,7 +5147,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -5240,7 +5293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
dependencies = [
"heck 0.4.1",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -5252,9 +5305,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a"
dependencies = [
"heck 0.4.1",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5272,9 +5325,9 @@ version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5283,9 +5336,9 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5361,11 +5414,12 @@ dependencies = [
[[package]]
name = "erased-serde"
-version = "0.4.4"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3"
+checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d"
dependencies = [
"serde",
+ "typeid",
]
[[package]]
@@ -5448,23 +5502,23 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "event-listener"
-version = "5.2.0"
+version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91"
+checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e"
dependencies = [
"concurrent-queue",
"parking",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
name = "event-listener-strategy"
-version = "0.5.2"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"
+checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
dependencies = [
- "event-listener 5.2.0",
- "pin-project-lite",
+ "event-listener 4.0.3",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -5486,9 +5540,9 @@ dependencies = [
"file-guard",
"fs-err",
"prettyplease 0.2.12",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5558,9 +5612,9 @@ dependencies = [
"expander",
"indexmap 2.2.3",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -5761,9 +5815,9 @@ dependencies = [
[[package]]
name = "form_urlencoded"
-version = "1.2.1"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
+checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
dependencies = [
"percent-encoding",
]
@@ -5890,11 +5944,11 @@ dependencies = [
"frame-support",
"parity-scale-codec",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"scale-info",
"sp-arithmetic",
- "syn 2.0.61",
+ "syn 2.0.58",
"trybuild",
]
@@ -6085,7 +6139,7 @@ dependencies = [
"parity-scale-codec",
"pretty_assertions",
"proc-macro-warning 1.0.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"regex",
"scale-info",
@@ -6095,7 +6149,7 @@ dependencies = [
"sp-metadata-ir",
"sp-runtime",
"static_assertions",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -6104,18 +6158,18 @@ version = "10.0.0"
dependencies = [
"frame-support-procedural-tools-derive",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "frame-support-procedural-tools-derive"
version = "11.0.0"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -6258,7 +6312,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7"
dependencies = [
- "rustix 0.38.21",
+ "rustix 0.38.25",
"windows-sys 0.48.0",
]
@@ -6344,7 +6398,7 @@ dependencies = [
"futures-io",
"memchr",
"parking",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"waker-fn",
]
@@ -6355,7 +6409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
"futures-core",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -6364,9 +6418,9 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -6410,7 +6464,7 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"pin-utils",
"slab",
]
@@ -6488,6 +6542,16 @@ dependencies = [
"rand_core",
]
+[[package]]
+name = "ghash"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99"
+dependencies = [
+ "opaque-debug 0.3.0",
+ "polyval 0.5.3",
+]
+
[[package]]
name = "ghash"
version = "0.5.0"
@@ -6495,7 +6559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40"
dependencies = [
"opaque-debug 0.3.0",
- "polyval",
+ "polyval 0.6.1",
]
[[package]]
@@ -6613,9 +6677,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.3.26"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
+checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"
dependencies = [
"bytes",
"fnv",
@@ -6766,9 +6830,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex-conservative"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2"
+checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20"
[[package]]
name = "hex-literal"
@@ -6778,9 +6842,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
[[package]]
name = "hkdf"
-version = "0.12.3"
+version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437"
+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"hmac 0.12.1",
]
@@ -6868,7 +6932,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
"bytes",
"http 0.2.9",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -6891,7 +6955,7 @@ dependencies = [
"futures-util",
"http 1.1.0",
"http-body 1.0.0",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
]
[[package]]
@@ -6914,21 +6978,21 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.29"
+version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33"
+checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
"futures-core",
"futures-util",
- "h2 0.3.26",
+ "h2 0.3.24",
"http 0.2.9",
"http-body 0.4.5",
"httparse",
"httpdate",
"itoa",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"socket2 0.5.7",
"tokio",
"tower-service",
@@ -6951,7 +7015,7 @@ dependencies = [
"httparse",
"httpdate",
"itoa",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"smallvec",
"tokio",
"want",
@@ -6965,7 +7029,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [
"futures-util",
"http 0.2.9",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"log",
"rustls 0.21.7",
"rustls-native-certs 0.6.3",
@@ -7003,7 +7067,7 @@ dependencies = [
"http 1.1.0",
"http-body 1.0.0",
"hyper 1.3.1",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"socket2 0.5.7",
"tokio",
"tower",
@@ -7055,16 +7119,6 @@ dependencies = [
"unicode-normalization",
]
-[[package]]
-name = "idna"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
-]
-
[[package]]
name = "if-addrs"
version = "0.10.2"
@@ -7105,7 +7159,7 @@ dependencies = [
"bytes",
"futures",
"http 0.2.9",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"log",
"rand",
"tokio",
@@ -7157,7 +7211,7 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -7177,7 +7231,7 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
]
@@ -7302,7 +7356,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
"hermit-abi 0.3.2",
- "rustix 0.38.21",
+ "rustix 0.38.25",
"windows-sys 0.48.0",
]
@@ -7521,9 +7575,9 @@ checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4"
dependencies = [
"heck 0.5.0",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -7772,9 +7826,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "libnghttp2-sys"
-version = "0.1.9+1.58.0"
+version = "0.1.10+1.61.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64"
+checksum = "959c25552127d2e1fa72f0e52548ec04fc386e827ba71a7bd01db46a447dc135"
dependencies = [
"cc",
"libc",
@@ -7910,9 +7964,9 @@ dependencies = [
[[package]]
name = "libp2p-identity"
-version = "0.2.8"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0"
+checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8"
dependencies = [
"bs58 0.5.1",
"ed25519-dalek",
@@ -8109,9 +8163,9 @@ checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74"
dependencies = [
"heck 0.4.1",
"proc-macro-warning 0.4.2",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -8182,9 +8236,9 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
-version = "0.42.2"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538"
+checksum = "3facf0691bab65f571bc97c6c65ffa836248ca631d631b7691ac91deb7fceb5f"
dependencies = [
"either",
"futures",
@@ -8193,10 +8247,9 @@ dependencies = [
"libp2p-identity",
"log",
"parking_lot 0.12.3",
- "pin-project-lite",
+ "quicksink",
"rw-stream-sink",
- "soketto 0.8.0",
- "thiserror",
+ "soketto 0.7.1",
"url",
"webpki-roots 0.25.2",
]
@@ -8336,9 +8389,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
name = "linux-raw-sys"
-version = "0.4.10"
+version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
+checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829"
[[package]]
name = "lioness"
@@ -8399,7 +8452,7 @@ dependencies = [
"rand",
"rcgen",
"ring 0.16.20",
- "rustls 0.20.9",
+ "rustls 0.20.8",
"serde",
"sha2 0.10.8",
"simple-dns",
@@ -8525,7 +8578,7 @@ dependencies = [
"macro_magic_core",
"macro_magic_macros",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -8537,9 +8590,9 @@ dependencies = [
"const-random",
"derive-syn-parse",
"macro_magic_core_macros",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -8548,9 +8601,9 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -8561,7 +8614,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869"
dependencies = [
"macro_magic_core",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -8612,9 +8665,9 @@ dependencies = [
[[package]]
name = "memchr"
-version = "2.7.4"
+version = "2.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]]
name = "memfd"
@@ -8923,7 +8976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb"
dependencies = [
"cfg-if",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -8935,9 +8988,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2"
dependencies = [
"cfg-if",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -9047,7 +9100,7 @@ checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd"
dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
"synstructure 0.12.6",
@@ -9095,7 +9148,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -9184,9 +9237,9 @@ dependencies = [
[[package]]
name = "network-interface"
-version = "1.1.3"
+version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae72fd9dbd7f55dda80c00d66acc3b2130436fcba9ea89118fc508eaae48dfb0"
+checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1"
dependencies = [
"cc",
"libc",
@@ -9475,21 +9528,15 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-conv"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
-
[[package]]
name = "num-derive"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -9654,9 +9701,9 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -9667,9 +9714,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
-version = "300.2.3+3.2.1"
+version = "300.3.1+3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843"
+checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91"
dependencies = [
"cc",
]
@@ -9721,7 +9768,7 @@ dependencies = [
"itertools 0.11.0",
"petgraph",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -9882,7 +9929,6 @@ dependencies = [
"sp-core",
"sp-io",
"sp-runtime",
- "sp-std 14.0.0",
]
[[package]]
@@ -10425,9 +10471,9 @@ dependencies = [
name = "pallet-contracts-proc-macro"
version = "18.0.0"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -10593,7 +10639,7 @@ dependencies = [
"sp-npos-elections",
"sp-runtime",
"sp-tracing 16.0.0",
- "strum 0.26.2",
+ "strum 0.26.3",
]
[[package]]
@@ -11659,10 +11705,10 @@ name = "pallet-staking-reward-curve"
version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"sp-runtime",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -12304,7 +12350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -12333,7 +12379,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"syn 1.0.109",
"synstructure 0.12.6",
]
@@ -12641,6 +12687,7 @@ dependencies = [
"pallet-balances",
"pallet-identity",
"pallet-message-queue",
+ "pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-runtime-common",
@@ -12718,9 +12765,9 @@ dependencies = [
[[package]]
name = "percent-encoding"
-version = "2.3.1"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
+checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]]
name = "pest"
@@ -12750,9 +12797,9 @@ checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929"
dependencies = [
"pest",
"pest_meta",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -12791,16 +12838,22 @@ version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "pin-project-lite"
-version = "0.2.14"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
+checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05"
[[package]]
name = "pin-utils"
@@ -13443,23 +13496,17 @@ name = "polkadot-node-core-prospective-parachains"
version = "6.0.0"
dependencies = [
"assert_matches",
- "bitvec",
"fatality",
"futures",
- "parity-scale-codec",
- "polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
- "polkadot-node-subsystem-types",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
+ "rand",
"rstest",
- "sc-keystore",
- "sp-application-crypto",
"sp-core",
- "sp-keyring",
- "sp-keystore",
+ "sp-tracing 16.0.0",
"thiserror",
"tracing-gum",
]
@@ -13589,8 +13636,10 @@ dependencies = [
"nix 0.28.0",
"parity-scale-codec",
"polkadot-node-core-pvf-common",
+ "polkadot-node-primitives",
"polkadot-parachain-primitives",
"polkadot-primitives",
+ "sp-maybe-compressed-blob",
"tracing-gum",
]
@@ -13605,6 +13654,7 @@ dependencies = [
"nix 0.28.0",
"parity-scale-codec",
"polkadot-node-core-pvf-common",
+ "polkadot-node-primitives",
"polkadot-primitives",
"rayon",
"rococo-runtime",
@@ -13705,7 +13755,7 @@ dependencies = [
"sc-network",
"sc-network-types",
"sp-runtime",
- "strum 0.26.2",
+ "strum 0.26.3",
"thiserror",
"tracing-gum",
]
@@ -14905,7 +14955,7 @@ dependencies = [
"sp-runtime",
"sp-timestamp",
"sp-tracing 16.0.0",
- "strum 0.26.2",
+ "strum 0.26.3",
"substrate-prometheus-endpoint",
"tokio",
"tracing-gum",
@@ -15141,9 +15191,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c"
dependencies = [
"polkavm-common",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15153,7 +15203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429"
dependencies = [
"polkavm-derive-impl",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15189,7 +15239,7 @@ dependencies = [
"concurrent-queue",
"libc",
"log",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"windows-sys 0.48.0",
]
@@ -15201,12 +15251,23 @@ checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14"
dependencies = [
"cfg-if",
"concurrent-queue",
- "pin-project-lite",
- "rustix 0.38.21",
+ "pin-project-lite 0.2.12",
+ "rustix 0.38.25",
"tracing",
"windows-sys 0.52.0",
]
+[[package]]
+name = "poly1305"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede"
+dependencies = [
+ "cpufeatures",
+ "opaque-debug 0.3.0",
+ "universal-hash 0.4.0",
+]
+
[[package]]
name = "poly1305"
version = "0.8.0"
@@ -15215,7 +15276,19 @@ checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
dependencies = [
"cpufeatures",
"opaque-debug 0.3.0",
- "universal-hash",
+ "universal-hash 0.5.1",
+]
+
+[[package]]
+name = "polyval"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "opaque-debug 0.3.0",
+ "universal-hash 0.4.0",
]
[[package]]
@@ -15227,7 +15300,7 @@ dependencies = [
"cfg-if",
"cpufeatures",
"opaque-debug 0.3.0",
- "universal-hash",
+ "universal-hash 0.5.1",
]
[[package]]
@@ -15245,12 +15318,6 @@ dependencies = [
"rand",
]
-[[package]]
-name = "powerfmt"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
-
[[package]]
name = "pprof"
version = "0.12.1"
@@ -15335,7 +15402,7 @@ version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"syn 1.0.109",
]
@@ -15345,8 +15412,8 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62"
dependencies = [
- "proc-macro2 1.0.82",
- "syn 2.0.61",
+ "proc-macro2 1.0.75",
+ "syn 2.0.58",
]
[[package]]
@@ -15406,7 +15473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
"version_check",
@@ -15418,7 +15485,7 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"version_check",
]
@@ -15435,9 +15502,9 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15446,9 +15513,9 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15462,9 +15529,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.82"
+version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b"
+checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708"
dependencies = [
"unicode-ident",
]
@@ -15481,7 +15548,7 @@ dependencies = [
"hex",
"lazy_static",
"procfs-core",
- "rustix 0.38.21",
+ "rustix 0.38.25",
]
[[package]]
@@ -15527,9 +15594,9 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15608,9 +15675,9 @@ dependencies = [
[[package]]
name = "prost-build"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1"
+checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4"
dependencies = [
"bytes",
"heck 0.5.0",
@@ -15621,9 +15688,9 @@ dependencies = [
"petgraph",
"prettyplease 0.2.12",
"prost 0.12.6",
- "prost-types 0.12.4",
+ "prost-types 0.12.6",
"regex",
- "syn 2.0.61",
+ "syn 2.0.58",
"tempfile",
]
@@ -15635,7 +15702,7 @@ checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4"
dependencies = [
"anyhow",
"itertools 0.10.5",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -15648,9 +15715,9 @@ checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools 0.11.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -15664,9 +15731,9 @@ dependencies = [
[[package]]
name = "prost-types"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe"
+checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
dependencies = [
"prost 0.12.6",
]
@@ -15776,6 +15843,17 @@ dependencies = [
"rand",
]
+[[package]]
+name = "quicksink"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite 0.1.12",
+]
+
[[package]]
name = "quinn"
version = "0.9.4"
@@ -15783,11 +15861,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e"
dependencies = [
"bytes",
- "pin-project-lite",
- "quinn-proto 0.9.6",
+ "pin-project-lite 0.2.12",
+ "quinn-proto 0.9.5",
"quinn-udp 0.3.2",
"rustc-hash",
- "rustls 0.20.9",
+ "rustls 0.20.8",
"thiserror",
"tokio",
"tracing",
@@ -15802,7 +15880,7 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75"
dependencies = [
"bytes",
"futures-io",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"quinn-proto 0.10.6",
"quinn-udp 0.4.1",
"rustc-hash",
@@ -15814,15 +15892,15 @@ dependencies = [
[[package]]
name = "quinn-proto"
-version = "0.9.6"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863"
+checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989"
dependencies = [
"bytes",
"rand",
"ring 0.16.20",
"rustc-hash",
- "rustls 0.20.9",
+ "rustls 0.20.8",
"slab",
"thiserror",
"tinyvec",
@@ -15854,7 +15932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4"
dependencies = [
"libc",
- "quinn-proto 0.9.6",
+ "quinn-proto 0.9.5",
"socket2 0.4.9",
"tracing",
"windows-sys 0.42.0",
@@ -15888,7 +15966,7 @@ version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
]
[[package]]
@@ -16087,9 +16165,9 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -16265,10 +16343,10 @@ dependencies = [
"encoding_rs",
"futures-core",
"futures-util",
- "h2 0.3.26",
+ "h2 0.3.24",
"http 0.2.9",
"http-body 0.4.5",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"hyper-rustls 0.24.2",
"ipnet",
"js-sys",
@@ -16276,7 +16354,7 @@ dependencies = [
"mime",
"once_cell",
"percent-encoding",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"rustls 0.21.7",
"rustls-pemfile 1.0.3",
"serde",
@@ -16637,12 +16715,12 @@ checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605"
dependencies = [
"cfg-if",
"glob",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"regex",
"relative-path",
"rustc_version 0.4.0",
- "syn 2.0.61",
+ "syn 2.0.58",
"unicode-ident",
]
@@ -16785,22 +16863,22 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.21"
+version = "0.38.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
+checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e"
dependencies = [
"bitflags 2.6.0",
"errno",
"libc",
- "linux-raw-sys 0.4.10",
+ "linux-raw-sys 0.4.11",
"windows-sys 0.48.0",
]
[[package]]
name = "rustls"
-version = "0.20.9"
+version = "0.20.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99"
+checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
dependencies = [
"ring 0.16.20",
"sct",
@@ -16886,9 +16964,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
[[package]]
name = "rustls-platform-verifier"
-version = "0.3.1"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d"
+checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1"
dependencies = [
"core-foundation",
"core-foundation-sys",
@@ -17029,7 +17107,7 @@ dependencies = [
"multihash 0.19.1",
"parity-scale-codec",
"prost 0.12.6",
- "prost-build 0.12.4",
+ "prost-build 0.12.6",
"quickcheck",
"rand",
"sc-client-api",
@@ -17125,9 +17203,9 @@ name = "sc-chain-spec-derive"
version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -17775,7 +17853,7 @@ dependencies = [
"partial_sort",
"pin-project",
"prost 0.12.6",
- "prost-build 0.12.4",
+ "prost-build 0.12.6",
"rand",
"sc-block-builder",
"sc-client-api",
@@ -17820,7 +17898,7 @@ dependencies = [
"futures",
"libp2p-identity",
"parity-scale-codec",
- "prost-build 0.12.4",
+ "prost-build 0.12.6",
"sc-consensus",
"sc-network-types",
"sp-consensus",
@@ -17862,7 +17940,7 @@ dependencies = [
"log",
"parity-scale-codec",
"prost 0.12.6",
- "prost-build 0.12.4",
+ "prost-build 0.12.6",
"sc-client-api",
"sc-network",
"sc-network-types",
@@ -17906,7 +17984,7 @@ dependencies = [
"mockall 0.11.4",
"parity-scale-codec",
"prost 0.12.6",
- "prost-build 0.12.4",
+ "prost-build 0.12.6",
"quickcheck",
"sc-block-builder",
"sc-client-api",
@@ -18008,7 +18086,7 @@ dependencies = [
"fnv",
"futures",
"futures-timer",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"hyper-rustls 0.24.2",
"lazy_static",
"log",
@@ -18420,9 +18498,9 @@ name = "sc-tracing-proc-macro"
version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -18534,7 +18612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62"
dependencies = [
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -18572,7 +18650,7 @@ version = "0.8.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"serde_derive_internals",
"syn 1.0.109",
@@ -18611,7 +18689,7 @@ version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0"
dependencies = [
- "aead",
+ "aead 0.5.2",
"arrayref",
"arrayvec 0.7.4",
"curve25519-dalek",
@@ -18693,18 +18771,18 @@ dependencies = [
[[package]]
name = "secp256k1"
-version = "0.28.2"
+version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10"
+checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5"
dependencies = [
"secp256k1-sys",
]
[[package]]
name = "secp256k1-sys"
-version = "0.9.2"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb"
+checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7"
dependencies = [
"cc",
]
@@ -18841,9 +18919,9 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5"
[[package]]
name = "serde"
-version = "1.0.204"
+version = "1.0.206"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
+checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284"
dependencies = [
"serde_derive",
]
@@ -18868,13 +18946,13 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.204"
+version = "1.0.206"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
+checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -18883,7 +18961,7 @@ version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -18899,9 +18977,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.121"
+version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
+checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d"
dependencies = [
"indexmap 2.2.3",
"itoa",
@@ -18933,9 +19011,9 @@ dependencies = [
[[package]]
name = "serde_yaml"
-version = "0.9.34+deprecated"
+version = "0.9.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
+checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f"
dependencies = [
"indexmap 2.2.3",
"itoa",
@@ -18974,9 +19052,9 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -19017,9 +19095,9 @@ dependencies = [
[[package]]
name = "sha1-asm"
-version = "0.5.2"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ba6947745e7f86be3b8af00b7355857085dbdf8901393c89514510eb61f4e21"
+checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b"
dependencies = [
"cc",
]
@@ -19267,7 +19345,7 @@ dependencies = [
"bip39",
"blake2-rfc",
"bs58 0.5.1",
- "chacha20",
+ "chacha20 0.9.1",
"crossbeam-queue",
"derive_more",
"ed25519-zebra",
@@ -19289,7 +19367,7 @@ dependencies = [
"num-traits",
"pbkdf2",
"pin-project",
- "poly1305",
+ "poly1305 0.8.0",
"rand",
"rand_chacha",
"ruzstd",
@@ -19352,16 +19430,16 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831"
[[package]]
name = "snow"
-version = "0.9.6"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85"
+checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155"
dependencies = [
- "aes-gcm",
+ "aes-gcm 0.9.2",
"blake2 0.10.6",
"chacha20poly1305",
"curve25519-dalek",
"rand_core",
- "ring 0.17.7",
+ "ring 0.16.20",
"rustc_version 0.4.0",
"sha2 0.10.8",
"subtle 2.5.0",
@@ -19850,9 +19928,9 @@ dependencies = [
"blake2 0.10.6",
"expander",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20048,7 +20126,7 @@ dependencies = [
"sp-keystore",
"sp-mmr-primitives",
"sp-runtime",
- "strum 0.26.2",
+ "strum 0.26.3",
"w3f-bls",
]
@@ -20179,7 +20257,7 @@ dependencies = [
[[package]]
name = "sp-crypto-ec-utils"
version = "0.4.1"
-source = "git+https://github.com/paritytech/polkadot-sdk#82912acb33a9030c0ef3bf590a34fca09b72dc5f"
+source = "git+https://github.com/paritytech/polkadot-sdk#838a534da874cf6071fba1df07643c6c5b033ae0"
dependencies = [
"ark-bls12-377",
"ark-bls12-377-ext",
@@ -20236,7 +20314,7 @@ version = "0.1.0"
dependencies = [
"quote 1.0.36",
"sp-crypto-hashing",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20252,18 +20330,18 @@ name = "sp-debug-derive"
version = "8.0.0"
source = "git+https://github.com/paritytech/polkadot-sdk#82912acb33a9030c0ef3bf590a34fca09b72dc5f"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "sp-debug-derive"
version = "14.0.0"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20341,7 +20419,7 @@ version = "31.0.0"
dependencies = [
"sp-core",
"sp-runtime",
- "strum 0.26.2",
+ "strum 0.26.3",
]
[[package]]
@@ -20529,13 +20607,13 @@ dependencies = [
[[package]]
name = "sp-runtime-interface-proc-macro"
version = "11.0.0"
-source = "git+https://github.com/paritytech/polkadot-sdk#82912acb33a9030c0ef3bf590a34fca09b72dc5f"
+source = "git+https://github.com/paritytech/polkadot-sdk#838a534da874cf6071fba1df07643c6c5b033ae0"
dependencies = [
"Inflector",
"proc-macro-crate 1.3.1",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20545,9 +20623,9 @@ dependencies = [
"Inflector",
"expander",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20640,7 +20718,7 @@ dependencies = [
name = "sp-statement-store"
version = "10.0.0"
dependencies = [
- "aes-gcm",
+ "aes-gcm 0.10.3",
"curve25519-dalek",
"ed25519-dalek",
"hkdf",
@@ -20806,10 +20884,10 @@ name = "sp-version-proc-macro"
version = "13.0.0"
dependencies = [
"parity-scale-codec",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"sp-version",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -20891,7 +20969,7 @@ checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439"
dependencies = [
"Inflector",
"num-format",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"serde",
"serde_json",
@@ -20916,7 +20994,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f07d54c4d01a1713eb363b55ba51595da15f6f1211435b71466460da022aa140"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -21109,7 +21187,7 @@ checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf"
dependencies = [
"cfg_aliases",
"memchr",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -21182,7 +21260,7 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
dependencies = [
"heck 0.3.3",
"proc-macro-error",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -21204,11 +21282,11 @@ checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
[[package]]
name = "strum"
-version = "0.26.2"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
+checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
dependencies = [
- "strum_macros 0.26.2",
+ "strum_macros 0.26.4",
]
[[package]]
@@ -21218,7 +21296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
dependencies = [
"heck 0.4.1",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"rustversion",
"syn 1.0.109",
@@ -21231,23 +21309,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
dependencies = [
"heck 0.4.1",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"rustversion",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "strum_macros"
-version = "0.26.2"
+version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
+checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
dependencies = [
- "heck 0.4.1",
- "proc-macro2 1.0.82",
+ "heck 0.5.0",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"rustversion",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -21385,7 +21463,7 @@ dependencies = [
"sp-runtime",
"sp-trie",
"structopt",
- "strum 0.26.2",
+ "strum 0.26.3",
"thiserror",
]
@@ -21561,7 +21639,7 @@ dependencies = [
"sp-maybe-compressed-blob",
"sp-tracing 16.0.0",
"sp-version",
- "strum 0.26.2",
+ "strum 0.26.3",
"tempfile",
"toml 0.8.8",
"walkdir",
@@ -21694,18 +21772,18 @@ version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"unicode-ident",
]
[[package]]
name = "syn"
-version = "2.0.61"
+version = "2.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9"
+checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"unicode-ident",
]
@@ -21717,9 +21795,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b837ef12ab88835251726eb12237655e61ec8dc8a280085d1961cdc3dfd047"
dependencies = [
"paste",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -21728,7 +21806,7 @@ version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
"unicode-xid 0.2.4",
@@ -21740,16 +21818,16 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
name = "sysinfo"
-version = "0.30.5"
+version = "0.30.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
+checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae"
dependencies = [
"cfg-if",
"core-foundation-sys",
@@ -21813,7 +21891,7 @@ dependencies = [
"cfg-if",
"fastrand 2.1.0",
"redox_syscall 0.4.1",
- "rustix 0.38.21",
+ "rustix 0.38.25",
"windows-sys 0.48.0",
]
@@ -21832,7 +21910,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"
dependencies = [
- "rustix 0.38.21",
+ "rustix 0.38.25",
"windows-sys 0.48.0",
]
@@ -21859,9 +21937,9 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -22023,7 +22101,7 @@ version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"syn 1.0.109",
]
@@ -22034,9 +22112,9 @@ version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -22110,16 +22188,14 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.36"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
+checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07"
dependencies = [
"deranged",
"itoa",
"libc",
- "num-conv",
"num_threads",
- "powerfmt",
"serde",
"time-core",
"time-macros",
@@ -22127,17 +22203,16 @@ dependencies = [
[[package]]
name = "time-core"
-version = "0.1.2"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
+checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
[[package]]
name = "time-macros"
-version = "0.2.18"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
+checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9"
dependencies = [
- "num-conv",
"time-core",
]
@@ -22177,9 +22252,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.37.0"
+version = "1.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
+checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
dependencies = [
"backtrace",
"bytes",
@@ -22187,7 +22262,7 @@ dependencies = [
"mio",
"num_cpus",
"parking_lot 0.12.3",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"signal-hook-registry",
"socket2 0.5.7",
"tokio-macros",
@@ -22196,13 +22271,13 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "2.2.0"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
+checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -22244,7 +22319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842"
dependencies = [
"futures-core",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"tokio",
"tokio-util",
]
@@ -22287,7 +22362,7 @@ dependencies = [
"futures-core",
"futures-io",
"futures-sink",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"tokio",
]
@@ -22354,7 +22429,7 @@ dependencies = [
"futures-core",
"futures-util",
"pin-project",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"tokio",
"tower-layer",
"tower-service",
@@ -22372,7 +22447,7 @@ dependencies = [
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"tower-layer",
"tower-service",
]
@@ -22396,7 +22471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
"log",
- "pin-project-lite",
+ "pin-project-lite 0.2.12",
"tracing-attributes",
"tracing-core",
]
@@ -22407,9 +22482,9 @@ version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -22449,9 +22524,9 @@ dependencies = [
"assert_matches",
"expander",
"proc-macro-crate 3.1.0",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -22547,9 +22622,9 @@ dependencies = [
[[package]]
name = "trie-db"
-version = "0.29.0"
+version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65ed83be775d85ebb0e272914fff6462c39b3ddd6dc67b5c1c41271aad280c69"
+checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f"
dependencies = [
"hash-db",
"log",
@@ -22714,6 +22789,12 @@ dependencies = [
"static_assertions",
]
+[[package]]
+name = "typeid"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf"
+
[[package]]
name = "typenum"
version = "1.16.0"
@@ -22789,6 +22870,16 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
+[[package]]
+name = "universal-hash"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402"
+dependencies = [
+ "generic-array 0.14.7",
+ "subtle 2.5.0",
+]
+
[[package]]
name = "universal-hash"
version = "0.5.1"
@@ -22801,9 +22892,9 @@ dependencies = [
[[package]]
name = "unsafe-libyaml"
-version = "0.2.11"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
+checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b"
[[package]]
name = "unsigned-varint"
@@ -22841,12 +22932,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
-version = "2.5.2"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c"
+checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
dependencies = [
"form_urlencoded",
- "idna 0.5.0",
+ "idna 0.4.0",
"percent-encoding",
]
@@ -22876,9 +22967,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "value-bag"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fec26a25bd6fca441cdd0f769fd7f891bae119f996de31f86a5eddccef54c1d"
+checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101"
dependencies = [
"value-bag-serde1",
"value-bag-sval2",
@@ -22886,9 +22977,9 @@ dependencies = [
[[package]]
name = "value-bag-serde1"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ead5b693d906686203f19a49e88c477fb8c15798b68cf72f60b4b5521b4ad891"
+checksum = "ccacf50c5cb077a9abb723c5bcb5e0754c1a433f1e1de89edc328e2760b6328b"
dependencies = [
"erased-serde",
"serde",
@@ -22897,9 +22988,9 @@ dependencies = [
[[package]]
name = "value-bag-sval2"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b9d0f4a816370c3a0d7d82d603b62198af17675b12fe5e91de6b47ceb505882"
+checksum = "1785bae486022dfb9703915d42287dcb284c1ee37bd1080eeba78cc04721285b"
dependencies = [
"sval",
"sval_buffer",
@@ -23000,9 +23091,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
dependencies = [
"cfg-if",
"serde",
@@ -23012,16 +23103,16 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
dependencies = [
"bumpalo",
"log",
"once_cell",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
"wasm-bindgen-shared",
]
@@ -23039,9 +23130,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
dependencies = [
"quote 1.0.36",
"wasm-bindgen-macro-support",
@@ -23049,22 +23140,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
[[package]]
name = "wasm-bindgen-test"
@@ -23086,7 +23177,7 @@ version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
]
@@ -24152,10 +24243,10 @@ name = "xcm-procedural"
version = "7.0.0"
dependencies = [
"Inflector",
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
"staging-xcm",
- "syn 2.0.61",
+ "syn 2.0.58",
"trybuild",
]
@@ -24318,9 +24409,9 @@ version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
@@ -24338,9 +24429,9 @@ version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
- "proc-macro2 1.0.82",
+ "proc-macro2 1.0.75",
"quote 1.0.36",
- "syn 2.0.61",
+ "syn 2.0.58",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 7ae7c3bd1811..74b12f96603a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -819,7 +819,7 @@ lazy_static = { version = "1.4.0" }
libc = { version = "0.2.155" }
libfuzzer-sys = { version = "0.4" }
libp2p = { version = "0.52.4" }
-libp2p-identity = { version = "0.2.3" }
+libp2p-identity = { version = "0.2.9" }
libsecp256k1 = { version = "0.7.0", default-features = false }
linked-hash-map = { version = "0.5.4" }
linked_hash_set = { version = "0.1.4" }
@@ -1172,10 +1172,10 @@ secp256k1 = { version = "0.28.0", default-features = false }
secrecy = { version = "0.8.0", default-features = false }
seedling-runtime = { path = "cumulus/parachains/runtimes/starters/seedling" }
separator = { version = "0.4.1" }
-serde = { version = "1.0.204", default-features = false }
+serde = { version = "1.0.206", default-features = false }
serde-big-array = { version = "0.3.2" }
serde_derive = { version = "1.0.117" }
-serde_json = { version = "1.0.121", default-features = false }
+serde_json = { version = "1.0.124", default-features = false }
serde_yaml = { version = "0.9" }
serial_test = { version = "2.0.0" }
sha1 = { version = "0.10.6" }
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/genesis.rs
index 82f86e2b32ef..5b70ed490c63 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/genesis.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/genesis.rs
@@ -70,7 +70,7 @@ pub fn genesis() -> Storage {
},
assets: asset_hub_rococo_runtime::AssetsConfig {
assets: vec![
- (RESERVABLE_ASSET_ID, AssetHubRococoAssetOwner::get(), true, ED),
+ (RESERVABLE_ASSET_ID, AssetHubRococoAssetOwner::get(), false, ED),
(USDT_ID, AssetHubRococoAssetOwner::get(), true, ED),
],
..Default::default()
@@ -81,7 +81,7 @@ pub fn genesis() -> Storage {
(
PenpalTeleportableAssetLocation::get(),
PenpalSiblingSovereignAccount::get(),
- true,
+ false,
ED,
),
],
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/lib.rs
index 80d2376c6811..1f98d3ba964d 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo/src/lib.rs
@@ -59,5 +59,5 @@ impl_accounts_helpers_for_parachain!(AssetHubRococo);
impl_assert_events_helpers_for_parachain!(AssetHubRococo);
impl_assets_helpers_for_system_parachain!(AssetHubRococo, Rococo);
impl_assets_helpers_for_parachain!(AssetHubRococo);
-impl_foreign_assets_helpers_for_parachain!(AssetHubRococo, xcm::v3::Location);
+impl_foreign_assets_helpers_for_parachain!(AssetHubRococo, xcm::v4::Location);
impl_xcm_helpers_for_parachain!(AssetHubRococo);
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/genesis.rs
index fd84030ed13b..d20e059f9fea 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/genesis.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/genesis.rs
@@ -21,7 +21,7 @@ use sp_core::{sr25519, storage::Storage};
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed,
PenpalSiblingSovereignAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
- SAFE_XCM_VERSION,
+ SAFE_XCM_VERSION, USDT_ID,
};
use parachains_common::{AccountId, Balance};
@@ -65,7 +65,10 @@ pub fn genesis() -> Storage {
..Default::default()
},
assets: asset_hub_westend_runtime::AssetsConfig {
- assets: vec![(RESERVABLE_ASSET_ID, AssetHubWestendAssetOwner::get(), true, ED)],
+ assets: vec![
+ (RESERVABLE_ASSET_ID, AssetHubWestendAssetOwner::get(), false, ED),
+ (USDT_ID, AssetHubWestendAssetOwner::get(), true, ED),
+ ],
..Default::default()
},
foreign_assets: asset_hub_westend_runtime::ForeignAssetsConfig {
@@ -74,7 +77,7 @@ pub fn genesis() -> Storage {
(
PenpalTeleportableAssetLocation::get(),
PenpalSiblingSovereignAccount::get(),
- true,
+ false,
ED,
),
],
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/lib.rs
index 608690218d2f..6066adec52c3 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/lib.rs
@@ -59,5 +59,5 @@ impl_accounts_helpers_for_parachain!(AssetHubWestend);
impl_assert_events_helpers_for_parachain!(AssetHubWestend);
impl_assets_helpers_for_system_parachain!(AssetHubWestend, Westend);
impl_assets_helpers_for_parachain!(AssetHubWestend);
-impl_foreign_assets_helpers_for_parachain!(AssetHubWestend, xcm::v3::Location);
+impl_foreign_assets_helpers_for_parachain!(AssetHubWestend, xcm::v4::Location);
impl_xcm_helpers_for_parachain!(AssetHubWestend);
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs
index 43d182facdd5..36a701d24c27 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs
@@ -18,7 +18,9 @@ use sp_core::storage::Storage;
// Cumulus
use cumulus_primitives_core::ParaId;
-use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION};
+use emulated_integration_tests_common::{
+ accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
+};
use parachains_common::Balance;
pub const PARA_ID: u32 = 1004;
@@ -27,6 +29,9 @@ pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENT
pub fn genesis() -> Storage {
let genesis_config = people_rococo_runtime::RuntimeGenesisConfig {
system: people_rococo_runtime::SystemConfig::default(),
+ balances: people_rococo_runtime::BalancesConfig {
+ balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(),
+ },
parachain_info: people_rococo_runtime::ParachainInfoConfig {
parachain_id: ParaId::from(PARA_ID),
..Default::default()
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend/src/genesis.rs
index 0b99f19bc130..942ec1b31d2b 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend/src/genesis.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend/src/genesis.rs
@@ -18,7 +18,9 @@ use sp_core::storage::Storage;
// Cumulus
use cumulus_primitives_core::ParaId;
-use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION};
+use emulated_integration_tests_common::{
+ accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
+};
use parachains_common::Balance;
pub const PARA_ID: u32 = 1004;
@@ -27,6 +29,9 @@ pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTEN
pub fn genesis() -> Storage {
let genesis_config = people_westend_runtime::RuntimeGenesisConfig {
system: people_westend_runtime::SystemConfig::default(),
+ balances: people_westend_runtime::BalancesConfig {
+ balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(),
+ },
parachain_info: people_westend_runtime::ParachainInfoConfig {
parachain_id: ParaId::from(PARA_ID),
..Default::default()
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs
index 260875088bbc..38c94b34aa2e 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs
@@ -22,7 +22,7 @@ use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION,
};
use parachains_common::{AccountId, Balance};
-use penpal_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation};
+use penpal_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub};
// Penpal
pub const PARA_ID_A: u32 = 2000;
pub const PARA_ID_B: u32 = 2001;
@@ -81,6 +81,8 @@ pub fn genesis(para_id: u32) -> Storage {
(RelayLocation::get(), PenpalAssetOwner::get(), true, ED),
// Sufficient AssetHub asset representation
(LocalReservableFromAssetHub::get(), PenpalAssetOwner::get(), true, ED),
+ // USDT from Asset Hub
+ (UsdtFromAssetHub::get(), PenpalAssetOwner::get(), true, ED),
],
..Default::default()
},
diff --git a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs
index 7077fbbb0a9a..30e66ced1fb0 100644
--- a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs
@@ -63,11 +63,11 @@ pub const PENPAL_ID: u32 = 2000;
pub const ASSETS_PALLET_ID: u8 = 50;
parameter_types! {
- pub PenpalTeleportableAssetLocation: xcm::v3::Location
- = xcm::v3::Location::new(1, [
- xcm::v3::Junction::Parachain(PENPAL_ID),
- xcm::v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- xcm::v3::Junction::GeneralIndex(TELEPORTABLE_ASSET_ID.into()),
+ pub PenpalTeleportableAssetLocation: xcm::v4::Location
+ = xcm::v4::Location::new(1, [
+ xcm::v4::Junction::Parachain(PENPAL_ID),
+ xcm::v4::Junction::PalletInstance(ASSETS_PALLET_ID),
+ xcm::v4::Junction::GeneralIndex(TELEPORTABLE_ASSET_ID.into()),
]
);
pub PenpalSiblingSovereignAccount: AccountId = Sibling::from(PENPAL_ID).into_account_truncating();
@@ -132,6 +132,7 @@ pub mod accounts {
pub const EVE_STASH: &str = "Eve//stash";
pub const FERDIE_STASH: &str = "Ferdie//stash";
pub const FERDIE_BEEFY: &str = "Ferdie//stash";
+ pub const DUMMY_EMPTY: &str = "JohnDoe";
pub fn init_balances() -> Vec {
vec![
diff --git a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs
index b11adacbde5c..578bca84ce5a 100644
--- a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs
+++ b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs
@@ -228,7 +228,7 @@ macro_rules! test_parachain_is_trusted_teleporter_for_relay {
$crate::macros::paste::paste! {
// init Origin variables
let sender = [<$sender_para Sender>]::get();
- let mut para_sender_balance_before =
+ let para_sender_balance_before =
<$sender_para as $crate::macros::Chain>::account_data_of(sender.clone()).free;
let origin = <$sender_para as $crate::macros::Chain>::RuntimeOrigin::signed(sender.clone());
let assets: Assets = (Parent, $amount).into();
@@ -302,9 +302,6 @@ macro_rules! test_parachain_is_trusted_teleporter_for_relay {
assert_eq!(para_sender_balance_before - $amount - delivery_fees, para_sender_balance_after);
assert!(relay_receiver_balance_after > relay_receiver_balance_before);
-
- // Update sender balance
- para_sender_balance_before = <$sender_para as $crate::macros::Chain>::account_data_of(sender.clone()).free;
}
};
}
diff --git a/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs
index 76179c6d82c6..7a289a3f1ac6 100644
--- a/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs
+++ b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs
@@ -23,16 +23,15 @@ use xcm::{prelude::*, DoubleEncoded};
pub fn xcm_transact_paid_execution(
call: DoubleEncoded<()>,
origin_kind: OriginKind,
- native_asset: Asset,
+ fees: Asset,
beneficiary: AccountId,
) -> VersionedXcm<()> {
let weight_limit = WeightLimit::Unlimited;
let require_weight_at_most = Weight::from_parts(1000000000, 200000);
- let native_assets: Assets = native_asset.clone().into();
VersionedXcm::from(Xcm(vec![
- WithdrawAsset(native_assets),
- BuyExecution { fees: native_asset, weight_limit },
+ WithdrawAsset(fees.clone().into()),
+ BuyExecution { fees, weight_limit },
Transact { require_weight_at_most, origin_kind, call },
RefundSurplus,
DepositAsset {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs
index 6309c0584107..87a090bf1ae6 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs
@@ -35,7 +35,9 @@ mod imports {
// Cumulus
pub use asset_test_utils::xcm_helpers;
pub use emulated_integration_tests_common::{
- test_parachain_is_trusted_teleporter,
+ accounts::DUMMY_EMPTY,
+ get_account_id_from_seed, test_parachain_is_trusted_teleporter,
+ test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
xcm_emulator::{
assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test,
TestArgs, TestContext, TestExt,
@@ -90,7 +92,6 @@ mod imports {
pub const ASSET_ID: u32 = 3;
pub const ASSET_MIN_BALANCE: u128 = 1000;
- pub type RelayToSystemParaTest = Test;
pub type RelayToParaTest = Test;
pub type ParaToRelayTest = Test;
pub type SystemParaToRelayTest = Test;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs
index 8b9fedcd4947..70dde03d75a2 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs
@@ -493,9 +493,9 @@ fn para_to_para_through_relay_limited_reserve_transfer_assets(
)
}
-/// Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work
+/// Reserve Transfers of native asset from Relay Chain to the Asset Hub shouldn't work
#[test]
-fn reserve_transfer_native_asset_from_relay_to_system_para_fails() {
+fn reserve_transfer_native_asset_from_relay_to_asset_hub_fails() {
// Init values for Relay Chain
let signed_origin = ::RuntimeOrigin::signed(RococoSender::get().into());
let destination = Rococo::child_location_of(AssetHubRococo::para_id());
@@ -526,10 +526,10 @@ fn reserve_transfer_native_asset_from_relay_to_system_para_fails() {
});
}
-/// Reserve Transfers of native asset from System Parachain to Relay Chain shouldn't work
+/// Reserve Transfers of native asset from Asset Hub to Relay Chain shouldn't work
#[test]
-fn reserve_transfer_native_asset_from_system_para_to_relay_fails() {
- // Init values for System Parachain
+fn reserve_transfer_native_asset_from_asset_hub_to_relay_fails() {
+ // Init values for Asset Hub
let signed_origin =
::RuntimeOrigin::signed(AssetHubRococoSender::get().into());
let destination = AssetHubRococo::parent_location();
@@ -691,10 +691,10 @@ fn reserve_transfer_native_asset_from_para_to_relay() {
// =========================================================================
// ======= Reserve Transfers - Native Asset - AssetHub<>Parachain ==========
// =========================================================================
-/// Reserve Transfers of native asset from System Parachain to Parachain should work
+/// Reserve Transfers of native asset from Asset Hub to Parachain should work
#[test]
-fn reserve_transfer_native_asset_from_system_para_to_para() {
- // Init values for System Parachain
+fn reserve_transfer_native_asset_from_asset_hub_to_para() {
+ // Init values for Asset Hub
let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sender = AssetHubRococoSender::get();
let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000;
@@ -749,9 +749,9 @@ fn reserve_transfer_native_asset_from_system_para_to_para() {
assert!(receiver_assets_after < receiver_assets_before + amount_to_send);
}
-/// Reserve Transfers of native asset from Parachain to System Parachain should work
+/// Reserve Transfers of native asset from Parachain to Asset Hub should work
#[test]
-fn reserve_transfer_native_asset_from_para_to_system_para() {
+fn reserve_transfer_native_asset_from_para_to_asset_hub() {
// Init values for Parachain
let destination = PenpalA::sibling_location_of(AssetHubRococo::para_id());
let sender = PenpalASender::get();
@@ -768,12 +768,12 @@ fn reserve_transfer_native_asset_from_para_to_system_para() {
amount_to_send * 2,
);
- // Init values for System Parachain
+ // Init values for Asset Hub
let receiver = AssetHubRococoReceiver::get();
let penpal_location_as_seen_by_ahr = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location_as_seen_by_ahr);
- // fund Parachain's SA on System Parachain with the native tokens held in reserve
+ // fund Parachain's SA on Asset Hub with the native tokens held in reserve
AssetHubRococo::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]);
// Init Test
@@ -824,11 +824,11 @@ fn reserve_transfer_native_asset_from_para_to_system_para() {
// ==================================================================================
// ======= Reserve Transfers - Native + Non-system Asset - AssetHub<>Parachain ======
// ==================================================================================
-/// Reserve Transfers of a local asset and native asset from System Parachain to Parachain should
+/// Reserve Transfers of a local asset and native asset from Asset Hub to Parachain should
/// work
#[test]
-fn reserve_transfer_assets_from_system_para_to_para() {
- // Init values for System Parachain
+fn reserve_transfer_multiple_assets_from_asset_hub_to_para() {
+ // Init values for Asset Hub
let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(destination.clone());
let sender = AssetHubRococoSender::get();
@@ -939,10 +939,12 @@ fn reserve_transfer_assets_from_system_para_to_para() {
);
}
-/// Reserve Transfers of a foreign asset and native asset from Parachain to System Para should
-/// work
+/// Reserve Transfers of a random asset and native asset from Parachain to Asset Hub should work
+/// Receiver is empty account to show deposit works as long as transfer includes enough DOT for ED.
+/// Once we have https://github.com/paritytech/polkadot-sdk/issues/5298,
+/// we should do equivalent test with USDT instead of DOT.
#[test]
-fn reserve_transfer_assets_from_para_to_system_para() {
+fn reserve_transfer_multiple_assets_from_para_to_asset_hub() {
// Init values for Parachain
let destination = PenpalA::sibling_location_of(AssetHubRococo::para_id());
let sender = PenpalASender::get();
@@ -965,24 +967,23 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Fund Parachain's sender account with some foreign assets
PenpalA::mint_foreign_asset(
penpal_asset_owner_signer.clone(),
- asset_location_on_penpal,
+ asset_location_on_penpal.clone(),
sender.clone(),
asset_amount_to_send * 2,
);
// Fund Parachain's sender account with some system assets
PenpalA::mint_foreign_asset(
penpal_asset_owner_signer,
- system_asset_location_on_penpal,
+ system_asset_location_on_penpal.clone(),
sender.clone(),
fee_amount_to_send * 2,
);
- // Init values for System Parachain
- let receiver = AssetHubRococoReceiver::get();
+ // Beneficiary is a new (empty) account
+ let receiver = get_account_id_from_seed::(DUMMY_EMPTY);
+ // Init values for Asset Hub
let penpal_location_as_seen_by_ahr = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location_as_seen_by_ahr);
- let system_para_native_asset_location = RelayLocation::get();
- let system_para_foreign_asset_location = PenpalLocalReservableFromAssetHub::get();
let ah_asset_owner = AssetHubRococoAssetOwner::get();
let ah_asset_owner_signer = ::RuntimeOrigin::signed(ah_asset_owner);
@@ -1017,11 +1018,11 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Query initial balances
let sender_system_assets_before = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_native_asset_location.clone(), &sender)
+ >::balance(system_asset_location_on_penpal.clone(), &sender)
});
let sender_foreign_assets_before = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_foreign_asset_location.clone(), &sender)
+ >::balance(asset_location_on_penpal.clone(), &sender)
});
let receiver_balance_before = test.receiver.balance;
let receiver_assets_before = AssetHubRococo::execute_with(|| {
@@ -1038,11 +1039,11 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Query final balances
let sender_system_assets_after = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_native_asset_location.clone(), &sender)
+ >::balance(system_asset_location_on_penpal, &sender)
});
let sender_foreign_assets_after = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_foreign_asset_location, &sender)
+ >::balance(asset_location_on_penpal, &sender)
});
let receiver_balance_after = test.receiver.balance;
let receiver_assets_after = AssetHubRococo::execute_with(|| {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs
index 364fbd0d439f..29eaa9694643 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs
@@ -18,7 +18,7 @@ use crate::imports::*;
/// Relay Chain should be able to execute `Transact` instructions in System Parachain
/// when `OriginKind::Superuser`.
#[test]
-fn send_transact_as_superuser_from_relay_to_system_para_works() {
+fn send_transact_as_superuser_from_relay_to_asset_hub_works() {
AssetHubRococo::force_create_asset_from_relay_as_root(
ASSET_ID,
ASSET_MIN_BALANCE,
@@ -29,28 +29,25 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() {
}
/// We tests two things here:
-/// - Parachain should be able to send XCM paying its fee with system asset in the System Parachain
-/// - Parachain should be able to create a new Foreign Asset in the System Parachain
+/// - Parachain should be able to send XCM paying its fee at Asset Hub using system asset
+/// - Parachain should be able to create a new Foreign Asset at Asset Hub
#[test]
-fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
+fn send_xcm_from_para_to_asset_hub_paying_fee_with_system_asset() {
let para_sovereign_account = AssetHubRococo::sovereign_account_id_of(
AssetHubRococo::sibling_location_of(PenpalA::para_id()),
);
- let asset_location_on_penpal = v3::Location::new(
+ let asset_location_on_penpal = Location::new(
0,
- [
- v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- v3::Junction::GeneralIndex(ASSET_ID.into()),
- ],
+ [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(ASSET_ID.into())],
);
let foreign_asset_at_asset_hub =
- v3::Location::new(1, [v3::Junction::Parachain(PenpalA::para_id().into())])
+ Location::new(1, [Junction::Parachain(PenpalA::para_id().into())])
.appended_with(asset_location_on_penpal)
.unwrap();
// Encoded `create_asset` call to be executed in AssetHub
let call = AssetHubRococo::create_foreign_asset_call(
- foreign_asset_at_asset_hub,
+ foreign_asset_at_asset_hub.clone(),
ASSET_MIN_BALANCE,
para_sovereign_account.clone(),
);
@@ -86,12 +83,7 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
AssetHubRococo::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubRococo::assert_xcmp_queue_success(Some(Weight::from_parts(
- 15_594_564_000,
- 562_893,
- )));
-
+ AssetHubRococo::assert_xcmp_queue_success(None);
assert_expected_events!(
AssetHubRococo,
vec![
@@ -115,15 +107,15 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
}
/// We tests two things here:
-/// - Parachain should be able to send XCM paying its fee with system assets in the System Parachain
-/// - Parachain should be able to create a new Asset in the System Parachain
+/// - Parachain should be able to send XCM paying its fee at Asset Hub using sufficient asset
+/// - Parachain should be able to create a new Asset at Asset Hub
#[test]
-fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
+fn send_xcm_from_para_to_asset_hub_paying_fee_with_sufficient_asset() {
let para_sovereign_account = AssetHubRococo::sovereign_account_id_of(
AssetHubRococo::sibling_location_of(PenpalA::para_id()),
);
- // Force create and mint assets for Parachain's sovereign account
+ // Force create and mint sufficient assets for Parachain's sovereign account
AssetHubRococo::force_create_and_mint_asset(
ASSET_ID,
ASSET_MIN_BALANCE,
@@ -170,12 +162,7 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
AssetHubRococo::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubRococo::assert_xcmp_queue_success(Some(Weight::from_parts(
- 15_594_564_000,
- 562_893,
- )));
-
+ AssetHubRococo::assert_xcmp_queue_success(None);
assert_expected_events!(
AssetHubRococo,
vec![
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs
index 16e0512da960..ac0c90ba198d 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs
@@ -17,13 +17,10 @@ use crate::imports::*;
#[test]
fn swap_locally_on_chain_using_local_assets() {
- let asset_native = Box::new(v3::Location::try_from(RelayLocation::get()).unwrap());
- let asset_one = Box::new(v3::Location::new(
+ let asset_native = Box::new(Location::try_from(RelayLocation::get()).unwrap());
+ let asset_one = Box::new(Location::new(
0,
- [
- v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- v3::Junction::GeneralIndex(ASSET_ID.into()),
- ],
+ [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(ASSET_ID.into())],
));
AssetHubRococo::execute_with(|| {
@@ -112,11 +109,11 @@ fn swap_locally_on_chain_using_local_assets() {
#[test]
fn swap_locally_on_chain_using_foreign_assets() {
- let asset_native = Box::new(v3::Location::try_from(RelayLocation::get()).unwrap());
+ let asset_native = Box::new(Location::try_from(RelayLocation::get()).unwrap());
let asset_location_on_penpal =
- v3::Location::try_from(PenpalLocalTeleportableToAssetHub::get()).unwrap();
+ Location::try_from(PenpalLocalTeleportableToAssetHub::get()).unwrap();
let foreign_asset_at_asset_hub_rococo =
- v3::Location::new(1, [v3::Junction::Parachain(PenpalA::para_id().into())])
+ Location::new(1, [Junction::Parachain(PenpalA::para_id().into())])
.appended_with(asset_location_on_penpal)
.unwrap();
@@ -141,7 +138,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
// 1. Mint foreign asset (in reality this should be a teleport or some such)
assert_ok!(::ForeignAssets::mint(
::RuntimeOrigin::signed(sov_penpal_on_ahr.clone().into()),
- foreign_asset_at_asset_hub_rococo,
+ foreign_asset_at_asset_hub_rococo.clone(),
sov_penpal_on_ahr.clone().into(),
ASSET_HUB_ROCOCO_ED * 3_000_000_000_000,
));
@@ -157,7 +154,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
assert_ok!(::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubRococoSender::get()),
asset_native.clone(),
- Box::new(foreign_asset_at_asset_hub_rococo),
+ Box::new(foreign_asset_at_asset_hub_rococo.clone()),
));
assert_expected_events!(
@@ -171,7 +168,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
assert_ok!(::AssetConversion::add_liquidity(
::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()),
asset_native.clone(),
- Box::new(foreign_asset_at_asset_hub_rococo),
+ Box::new(foreign_asset_at_asset_hub_rococo.clone()),
1_000_000_000_000,
2_000_000_000_000,
0,
@@ -189,7 +186,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
);
// 4. Swap!
- let path = vec![asset_native.clone(), Box::new(foreign_asset_at_asset_hub_rococo)];
+ let path = vec![asset_native.clone(), Box::new(foreign_asset_at_asset_hub_rococo.clone())];
assert_ok!(
::AssetConversion::swap_exact_tokens_for_tokens(
@@ -216,7 +213,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
assert_ok!(::AssetConversion::remove_liquidity(
::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()),
asset_native.clone(),
- Box::new(foreign_asset_at_asset_hub_rococo),
+ Box::new(foreign_asset_at_asset_hub_rococo.clone()),
1414213562273 - ASSET_HUB_ROCOCO_ED * 2, // all but the 2 EDs can't be retrieved.
0,
0,
@@ -252,8 +249,8 @@ fn cannot_create_pool_from_pool_assets() {
assert_matches::assert_matches!(
::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubRococoSender::get()),
- Box::new(v3::Location::try_from(asset_native).unwrap()),
- Box::new(v3::Location::try_from(asset_one).unwrap()),
+ Box::new(Location::try_from(asset_native).unwrap()),
+ Box::new(Location::try_from(asset_one).unwrap()),
),
Err(DispatchError::Module(ModuleError{index: _, error: _, message})) => assert_eq!(message, Some("Unknown"))
);
@@ -262,12 +259,12 @@ fn cannot_create_pool_from_pool_assets() {
#[test]
fn pay_xcm_fee_with_some_asset_swapped_for_native() {
- let asset_native = v3::Location::try_from(RelayLocation::get()).unwrap();
- let asset_one = xcm::v3::Location {
+ let asset_native = Location::try_from(RelayLocation::get()).unwrap();
+ let asset_one = Location {
parents: 0,
interior: [
- xcm::v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- xcm::v3::Junction::GeneralIndex(ASSET_ID.into()),
+ Junction::PalletInstance(ASSETS_PALLET_ID),
+ Junction::GeneralIndex(ASSET_ID.into()),
]
.into(),
};
@@ -296,8 +293,8 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
assert_ok!(::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubRococoSender::get()),
- Box::new(asset_native),
- Box::new(asset_one),
+ Box::new(asset_native.clone()),
+ Box::new(asset_one.clone()),
));
assert_expected_events!(
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs
index f74378d7631a..c8da801a14bf 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs
@@ -15,53 +15,6 @@
use crate::imports::*;
-fn relay_origin_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Rococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(631_531_000, 7_186)));
-
- assert_expected_events!(
- Rococo,
- vec![
- // Amount to teleport is withdrawn from Sender
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == t.sender.account_id,
- amount: *amount == t.args.amount,
- },
- // Amount to teleport is deposited in Relay's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- ]
- );
-}
-
-fn relay_dest_assertions(t: SystemParaToRelayTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Rococo::assert_ump_queue_processed(
- true,
- Some(AssetHubRococo::para_id()),
- Some(Weight::from_parts(307_225_000, 7_186)),
- );
-
- assert_expected_events!(
- Rococo,
- vec![
- // Amount is withdrawn from Relay Chain's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) {
Rococo::assert_ump_queue_processed(
false,
@@ -92,22 +45,6 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
);
}
-fn para_dest_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubRococo::assert_dmp_queue_complete(Some(Weight::from_parts(157_718_000, 3593)));
-
- assert_expected_events!(
- AssetHubRococo,
- vec![
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) {
type RuntimeEvent = ::RuntimeEvent;
let system_para_native_asset_location = RelayLocation::get();
@@ -141,7 +78,6 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
);
let (expected_foreign_asset_id, expected_foreign_asset_amount) =
non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap();
- let expected_foreign_asset_id_v3: v3::Location = expected_foreign_asset_id.try_into().unwrap();
AssetHubRococo::assert_xcmp_queue_success(None);
@@ -159,7 +95,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
who: *who == t.receiver.account_id,
},
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => {
- asset_id: *asset_id == expected_foreign_asset_id_v3,
+ asset_id: *asset_id == expected_foreign_asset_id,
owner: *owner == t.receiver.account_id,
amount: *amount == expected_foreign_asset_amount,
},
@@ -173,7 +109,6 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) {
AssetHubRococo::assert_xcm_pallet_attempted_complete(None);
let (expected_foreign_asset_id, expected_foreign_asset_amount) =
non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap();
- let expected_foreign_asset_id_v3: v3::Location = expected_foreign_asset_id.try_into().unwrap();
assert_expected_events!(
AssetHubRococo,
vec![
@@ -189,7 +124,7 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) {
},
// foreign asset is burned locally as part of teleportation
RuntimeEvent::ForeignAssets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
- asset_id: *asset_id == expected_foreign_asset_id_v3,
+ asset_id: *asset_id == expected_foreign_asset_id,
owner: *owner == t.sender.account_id,
balance: *balance == expected_foreign_asset_amount,
},
@@ -232,17 +167,6 @@ fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) {
);
}
-fn relay_limited_teleport_assets(t: RelayToSystemParaTest) -> DispatchResult {
- ::XcmPallet::limited_teleport_assets(
- t.signed_origin,
- bx!(t.args.dest.into()),
- bx!(t.args.beneficiary.into()),
- bx!(t.args.assets.into()),
- t.args.fee_asset_item,
- t.args.weight_limit,
- )
-}
-
fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult {
::PolkadotXcm::limited_teleport_assets(
t.signed_origin,
@@ -276,90 +200,41 @@ fn system_para_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResul
)
}
-/// Limited Teleport of native asset from Relay Chain to the System Parachain should work
#[test]
-fn limited_teleport_native_assets_from_relay_to_system_para_works() {
- // Init values for Relay Chain
- let amount_to_send: Balance = ROCOCO_ED * 1000;
- let dest = Rococo::child_location_of(AssetHubRococo::para_id());
- let beneficiary_id = AssetHubRococoReceiver::get();
- let test_args = TestContext {
- sender: RococoSender::get(),
- receiver: AssetHubRococoReceiver::get(),
- args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send),
- };
-
- let mut test = RelayToSystemParaTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(relay_origin_assertions);
- test.set_assertion::(para_dest_assertions);
- test.set_dispatchable::(relay_limited_teleport_assets);
- test.assert();
-
- let delivery_fees = Rococo::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
+fn teleport_to_other_system_parachains_works() {
+ let amount = ASSET_HUB_ROCOCO_ED * 100;
+ let native_asset: Assets = (Parent, amount).into();
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
+ test_parachain_is_trusted_teleporter!(
+ AssetHubRococo, // Origin
+ AssetHubRococoXcmConfig, // XCM Configuration
+ vec![BridgeHubRococo], // Destinations
+ (native_asset, amount)
+ );
}
-/// Limited Teleport of native asset from System Parachain to Relay Chain
-/// should work when there is enough balance in Relay Chain's `CheckAccount`
#[test]
-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();
-
- // Init values for Relay Chain
- let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 1000;
- let destination = AssetHubRococo::parent_location();
- let beneficiary_id = RococoReceiver::get();
- let assets = (Parent, amount_to_send).into();
-
- let test_args = TestContext {
- sender: AssetHubRococoSender::get(),
- receiver: RococoReceiver::get(),
- args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0),
- };
-
- let mut test = SystemParaToRelayTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(para_origin_assertions);
- test.set_assertion::(relay_dest_assertions);
- test.set_dispatchable::(system_para_limited_teleport_assets);
- test.assert();
+fn teleport_from_and_to_relay() {
+ let amount = ROCOCO_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- let delivery_fees = AssetHubRococo::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
+ test_relay_is_trusted_teleporter!(
+ Rococo,
+ RococoXcmConfig,
+ vec![AssetHubRococo],
+ (native_asset, amount)
+ );
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
+ test_parachain_is_trusted_teleporter_for_relay!(
+ AssetHubRococo,
+ AssetHubRococoXcmConfig,
+ Rococo,
+ amount
+ );
}
/// 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`
+/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount`
#[test]
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
// Init values for Relay Chain
@@ -399,19 +274,6 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
assert_eq!(receiver_balance_after, receiver_balance_before);
}
-#[test]
-fn teleport_to_other_system_parachains_works() {
- let amount = ASSET_HUB_ROCOCO_ED * 100;
- let native_asset: Assets = (Parent, amount).into();
-
- test_parachain_is_trusted_teleporter!(
- AssetHubRococo, // Origin
- AssetHubRococoXcmConfig, // XCM Configuration
- vec![BridgeHubRococo], // Destinations
- (native_asset, amount)
- );
-}
-
/// Bidirectional teleports of local Penpal assets to Asset Hub as foreign assets while paying
/// fees using (reserve transferred) native asset.
pub fn do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt(
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs
index f8190e11c51c..3320392b495d 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs
@@ -14,7 +14,10 @@
// limitations under the License.
use crate::imports::*;
-use emulated_integration_tests_common::accounts::{ALICE, BOB};
+use emulated_integration_tests_common::{
+ accounts::{ALICE, BOB},
+ USDT_ID,
+};
use frame_support::{
dispatch::RawOrigin,
sp_runtime::traits::Dispatchable,
@@ -161,7 +164,6 @@ fn spend_roc_on_asset_hub() {
#[test]
fn create_and_claim_treasury_spend_in_usdt() {
- const ASSET_ID: u32 = 1984;
const SPEND_AMOUNT: u128 = 10_000_000;
// treasury location from a sibling parachain.
let treasury_location: Location = Location::new(1, PalletInstance(18));
@@ -175,7 +177,7 @@ fn create_and_claim_treasury_spend_in_usdt() {
let asset_kind = VersionedLocatableAsset::V3 {
location: asset_hub_location,
asset_id: v3::AssetId::Concrete(
- (v3::Junction::PalletInstance(50), v3::Junction::GeneralIndex(ASSET_ID.into())).into(),
+ (v3::Junction::PalletInstance(50), v3::Junction::GeneralIndex(USDT_ID.into())).into(),
),
};
// treasury spend beneficiary.
@@ -187,9 +189,9 @@ fn create_and_claim_treasury_spend_in_usdt() {
type Assets = ::Assets;
// USDT created at genesis, mint some assets to the treasury account.
- assert_ok!(>::mint_into(ASSET_ID, &treasury_account, SPEND_AMOUNT * 4));
+ assert_ok!(>::mint_into(USDT_ID, &treasury_account, SPEND_AMOUNT * 4));
// beneficiary has zero balance.
- assert_eq!(>::balance(ASSET_ID, &alice,), 0u128,);
+ assert_eq!(>::balance(USDT_ID, &alice,), 0u128,);
});
Rococo::execute_with(|| {
@@ -231,7 +233,7 @@ fn create_and_claim_treasury_spend_in_usdt() {
AssetHubRococo,
vec![
RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => {
- id: id == &ASSET_ID,
+ id: id == &USDT_ID,
from: from == &treasury_account,
to: to == &alice,
amount: amount == &SPEND_AMOUNT,
@@ -241,7 +243,7 @@ fn create_and_claim_treasury_spend_in_usdt() {
]
);
// beneficiary received the assets from the treasury.
- assert_eq!(>::balance(ASSET_ID, &alice,), SPEND_AMOUNT,);
+ assert_eq!(>::balance(USDT_ID, &alice,), SPEND_AMOUNT,);
});
Rococo::execute_with(|| {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs
index 060c3fb39254..a887ee6a532a 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs
@@ -26,16 +26,15 @@ mod imports {
};
// Polkadot
- pub use xcm::{
- prelude::{AccountId32 as AccountId32Junction, *},
- v3,
- };
+ pub use xcm::prelude::{AccountId32 as AccountId32Junction, *};
pub use xcm_executor::traits::TransferType;
// Cumulus
pub use asset_test_utils::xcm_helpers;
pub use emulated_integration_tests_common::{
- test_parachain_is_trusted_teleporter,
+ accounts::DUMMY_EMPTY,
+ get_account_id_from_seed, test_parachain_is_trusted_teleporter,
+ test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
xcm_emulator::{
assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test,
TestArgs, TestContext, TestExt,
@@ -90,7 +89,6 @@ mod imports {
pub const ASSET_ID: u32 = 3;
pub const ASSET_MIN_BALANCE: u128 = 1000;
- pub type RelayToSystemParaTest = Test;
pub type RelayToParaTest = Test;
pub type ParaToRelayTest = Test;
pub type SystemParaToRelayTest = Test;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/fellowship_treasury.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/fellowship_treasury.rs
index 15f4fe33bddc..9520659712fc 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/fellowship_treasury.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/fellowship_treasury.rs
@@ -14,15 +14,17 @@
// limitations under the License.
use crate::imports::*;
-use emulated_integration_tests_common::accounts::{ALICE, BOB};
-use frame_support::traits::fungibles::{Create, Inspect, Mutate};
+use emulated_integration_tests_common::{
+ accounts::{ALICE, BOB},
+ USDT_ID,
+};
+use frame_support::traits::fungibles::{Inspect, Mutate};
use polkadot_runtime_common::impls::VersionedLocatableAsset;
use xcm_executor::traits::ConvertLocation;
#[test]
fn create_and_claim_treasury_spend() {
- const ASSET_ID: u32 = 1984;
- const SPEND_AMOUNT: u128 = 1_000_000;
+ const SPEND_AMOUNT: u128 = 1_000_000_000;
// treasury location from a sibling parachain.
let treasury_location: Location =
Location::new(1, [Parachain(CollectivesWestend::para_id().into()), PalletInstance(65)]);
@@ -34,7 +36,7 @@ fn create_and_claim_treasury_spend() {
// asset kind to be spent from the treasury.
let asset_kind = VersionedLocatableAsset::V4 {
location: asset_hub_location,
- asset_id: AssetId((PalletInstance(50), GeneralIndex(ASSET_ID.into())).into()),
+ asset_id: AssetId((PalletInstance(50), GeneralIndex(USDT_ID.into())).into()),
};
// treasury spend beneficiary.
let alice: AccountId = Westend::account_id_of(ALICE);
@@ -44,16 +46,10 @@ fn create_and_claim_treasury_spend() {
AssetHubWestend::execute_with(|| {
type Assets = ::Assets;
- // create an asset class and mint some assets to the treasury account.
- assert_ok!(>::create(
- ASSET_ID,
- treasury_account.clone(),
- true,
- SPEND_AMOUNT / 2
- ));
- assert_ok!(>::mint_into(ASSET_ID, &treasury_account, SPEND_AMOUNT * 4));
+ // USDT created at genesis, mint some assets to the fellowship treasury account.
+ assert_ok!(>::mint_into(USDT_ID, &treasury_account, SPEND_AMOUNT * 4));
// beneficiary has zero balance.
- assert_eq!(>::balance(ASSET_ID, &alice,), 0u128,);
+ assert_eq!(>::balance(USDT_ID, &alice,), 0u128,);
});
CollectivesWestend::execute_with(|| {
@@ -96,7 +92,7 @@ fn create_and_claim_treasury_spend() {
AssetHubWestend,
vec![
RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => {
- id: id == &ASSET_ID,
+ id: id == &USDT_ID,
from: from == &treasury_account,
to: to == &alice,
amount: amount == &SPEND_AMOUNT,
@@ -106,7 +102,7 @@ fn create_and_claim_treasury_spend() {
]
);
// beneficiary received the assets from the treasury.
- assert_eq!(>::balance(ASSET_ID, &alice,), SPEND_AMOUNT,);
+ assert_eq!(>::balance(USDT_ID, &alice,), SPEND_AMOUNT,);
});
CollectivesWestend::execute_with(|| {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs
index 65d013a0eec4..59f63d380590 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs
@@ -493,9 +493,9 @@ fn para_to_para_through_relay_limited_reserve_transfer_assets(
)
}
-/// Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work
+/// Reserve Transfers of native asset from Relay Chain to the Asset Hub shouldn't work
#[test]
-fn reserve_transfer_native_asset_from_relay_to_system_para_fails() {
+fn reserve_transfer_native_asset_from_relay_to_asset_hub_fails() {
// Init values for Relay Chain
let signed_origin = ::RuntimeOrigin::signed(WestendSender::get().into());
let destination = Westend::child_location_of(AssetHubWestend::para_id());
@@ -526,10 +526,10 @@ fn reserve_transfer_native_asset_from_relay_to_system_para_fails() {
});
}
-/// Reserve Transfers of native asset from System Parachain to Relay Chain shouldn't work
+/// Reserve Transfers of native asset from Asset Hub to Relay Chain shouldn't work
#[test]
-fn reserve_transfer_native_asset_from_system_para_to_relay_fails() {
- // Init values for System Parachain
+fn reserve_transfer_native_asset_from_asset_hub_to_relay_fails() {
+ // Init values for Asset Hub
let signed_origin =
::RuntimeOrigin::signed(AssetHubWestendSender::get().into());
let destination = AssetHubWestend::parent_location();
@@ -691,10 +691,10 @@ fn reserve_transfer_native_asset_from_para_to_relay() {
// =========================================================================
// ======= Reserve Transfers - Native Asset - AssetHub<>Parachain ==========
// =========================================================================
-/// Reserve Transfers of native asset from System Parachain to Parachain should work
+/// Reserve Transfers of native asset from Asset Hub to Parachain should work
#[test]
-fn reserve_transfer_native_asset_from_system_para_to_para() {
- // Init values for System Parachain
+fn reserve_transfer_native_asset_from_asset_hub_to_para() {
+ // Init values for Asset Hub
let destination = AssetHubWestend::sibling_location_of(PenpalA::para_id());
let sender = AssetHubWestendSender::get();
let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 2000;
@@ -749,9 +749,9 @@ fn reserve_transfer_native_asset_from_system_para_to_para() {
assert!(receiver_assets_after < receiver_assets_before + amount_to_send);
}
-/// Reserve Transfers of native asset from Parachain to System Parachain should work
+/// Reserve Transfers of native asset from Parachain to Asset Hub should work
#[test]
-fn reserve_transfer_native_asset_from_para_to_system_para() {
+fn reserve_transfer_native_asset_from_para_to_asset_hub() {
// Init values for Parachain
let destination = PenpalA::sibling_location_of(AssetHubWestend::para_id());
let sender = PenpalASender::get();
@@ -768,13 +768,13 @@ fn reserve_transfer_native_asset_from_para_to_system_para() {
amount_to_send * 2,
);
- // Init values for System Parachain
+ // Init values for Asset Hub
let receiver = AssetHubWestendReceiver::get();
let penpal_location_as_seen_by_ahr = AssetHubWestend::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr =
AssetHubWestend::sovereign_account_id_of(penpal_location_as_seen_by_ahr);
- // fund Parachain's SA on System Parachain with the native tokens held in reserve
+ // fund Parachain's SA on Asset Hub with the native tokens held in reserve
AssetHubWestend::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]);
// Init Test
@@ -825,11 +825,11 @@ fn reserve_transfer_native_asset_from_para_to_system_para() {
// =========================================================================
// ======= Reserve Transfers - Non-system Asset - AssetHub<>Parachain ======
// =========================================================================
-/// Reserve Transfers of a local asset and native asset from System Parachain to Parachain should
+/// Reserve Transfers of a local asset and native asset from Asset Hub to Parachain should
/// work
#[test]
-fn reserve_transfer_assets_from_system_para_to_para() {
- // Init values for System Parachain
+fn reserve_transfer_multiple_assets_from_asset_hub_to_para() {
+ // Init values for Asset Hub
let destination = AssetHubWestend::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubWestend::sovereign_account_id_of(destination.clone());
let sender = AssetHubWestendSender::get();
@@ -940,10 +940,12 @@ fn reserve_transfer_assets_from_system_para_to_para() {
);
}
-/// Reserve Transfers of a foreign asset and native asset from Parachain to System Para should
-/// work
+/// Reserve Transfers of a random asset and native asset from Parachain to Asset Hub should work
+/// Receiver is empty account to show deposit works as long as transfer includes enough DOT for ED.
+/// Once we have https://github.com/paritytech/polkadot-sdk/issues/5298,
+/// we should do equivalent test with USDT instead of DOT.
#[test]
-fn reserve_transfer_assets_from_para_to_system_para() {
+fn reserve_transfer_multiple_assets_from_para_to_asset_hub() {
// Init values for Parachain
let destination = PenpalA::sibling_location_of(AssetHubWestend::para_id());
let sender = PenpalASender::get();
@@ -966,25 +968,24 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Fund Parachain's sender account with some foreign assets
PenpalA::mint_foreign_asset(
penpal_asset_owner_signer.clone(),
- asset_location_on_penpal,
+ asset_location_on_penpal.clone(),
sender.clone(),
asset_amount_to_send * 2,
);
// Fund Parachain's sender account with some system assets
PenpalA::mint_foreign_asset(
penpal_asset_owner_signer,
- system_asset_location_on_penpal,
+ system_asset_location_on_penpal.clone(),
sender.clone(),
fee_amount_to_send * 2,
);
- // Init values for System Parachain
- let receiver = AssetHubWestendReceiver::get();
+ // Beneficiary is a new (empty) account
+ let receiver = get_account_id_from_seed::(DUMMY_EMPTY);
+ // Init values for Asset Hub
let penpal_location_as_seen_by_ahr = AssetHubWestend::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr =
AssetHubWestend::sovereign_account_id_of(penpal_location_as_seen_by_ahr);
- let system_para_native_asset_location = RelayLocation::get();
- let system_para_foreign_asset_location = PenpalLocalReservableFromAssetHub::get();
let ah_asset_owner = AssetHubWestendAssetOwner::get();
let ah_asset_owner_signer = ::RuntimeOrigin::signed(ah_asset_owner);
@@ -1019,11 +1020,11 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Query initial balances
let sender_system_assets_before = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_native_asset_location.clone(), &sender)
+ >::balance(system_asset_location_on_penpal.clone(), &sender)
});
let sender_foreign_assets_before = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_foreign_asset_location.clone(), &sender)
+ >::balance(asset_location_on_penpal.clone(), &sender)
});
let receiver_balance_before = test.receiver.balance;
let receiver_assets_before = AssetHubWestend::execute_with(|| {
@@ -1040,11 +1041,11 @@ fn reserve_transfer_assets_from_para_to_system_para() {
// Query final balances
let sender_system_assets_after = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_native_asset_location, &sender)
+ >::balance(system_asset_location_on_penpal, &sender)
});
let sender_foreign_assets_after = PenpalA::execute_with(|| {
type ForeignAssets = ::ForeignAssets;
- >::balance(system_para_foreign_asset_location, &sender)
+ >::balance(asset_location_on_penpal, &sender)
});
let receiver_balance_after = test.receiver.balance;
let receiver_assets_after = AssetHubWestend::execute_with(|| {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/send.rs
index eb0e985cc0ce..761c7c12255c 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/send.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/send.rs
@@ -18,7 +18,7 @@ use crate::imports::*;
/// Relay Chain should be able to execute `Transact` instructions in System Parachain
/// when `OriginKind::Superuser`.
#[test]
-fn send_transact_as_superuser_from_relay_to_system_para_works() {
+fn send_transact_as_superuser_from_relay_to_asset_hub_works() {
AssetHubWestend::force_create_asset_from_relay_as_root(
ASSET_ID,
ASSET_MIN_BALANCE,
@@ -29,28 +29,25 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() {
}
/// We tests two things here:
-/// - Parachain should be able to send XCM paying its fee with system asset in the System Parachain
-/// - Parachain should be able to create a new Foreign Asset in the System Parachain
+/// - Parachain should be able to send XCM paying its fee at Asset Hub using system asset
+/// - Parachain should be able to create a new Foreign Asset at Asset Hub
#[test]
-fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
+fn send_xcm_from_para_to_asset_hub_paying_fee_with_system_asset() {
let para_sovereign_account = AssetHubWestend::sovereign_account_id_of(
AssetHubWestend::sibling_location_of(PenpalA::para_id()),
);
- let asset_location_on_penpal = v3::Location::new(
+ let asset_location_on_penpal = Location::new(
0,
- [
- v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- v3::Junction::GeneralIndex(ASSET_ID.into()),
- ],
+ [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(ASSET_ID.into())],
);
let foreign_asset_at_asset_hub =
- v3::Location::new(1, [v3::Junction::Parachain(PenpalA::para_id().into())])
+ Location::new(1, [Junction::Parachain(PenpalA::para_id().into())])
.appended_with(asset_location_on_penpal)
.unwrap();
// Encoded `create_asset` call to be executed in AssetHub
let call = AssetHubWestend::create_foreign_asset_call(
- foreign_asset_at_asset_hub,
+ foreign_asset_at_asset_hub.clone(),
ASSET_MIN_BALANCE,
para_sovereign_account.clone(),
);
@@ -86,12 +83,7 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
AssetHubWestend::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts(
- 15_594_564_000,
- 562_893,
- )));
-
+ AssetHubWestend::assert_xcmp_queue_success(None);
assert_expected_events!(
AssetHubWestend,
vec![
@@ -115,15 +107,15 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
}
/// We tests two things here:
-/// - Parachain should be able to send XCM paying its fee with system assets in the System Parachain
-/// - Parachain should be able to create a new Asset in the System Parachain
+/// - Parachain should be able to send XCM paying its fee at Asset Hub using sufficient asset
+/// - Parachain should be able to create a new Asset at Asset Hub
#[test]
-fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
+fn send_xcm_from_para_to_asset_hub_paying_fee_with_sufficient_asset() {
let para_sovereign_account = AssetHubWestend::sovereign_account_id_of(
AssetHubWestend::sibling_location_of(PenpalA::para_id()),
);
- // Force create and mint assets for Parachain's sovereign account
+ // Force create and mint sufficient assets for Parachain's sovereign account
AssetHubWestend::force_create_and_mint_asset(
ASSET_ID,
ASSET_MIN_BALANCE,
@@ -170,12 +162,7 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
AssetHubWestend::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts(
- 15_594_564_000,
- 562_893,
- )));
-
+ AssetHubWestend::assert_xcmp_queue_success(None);
assert_expected_events!(
AssetHubWestend,
vec![
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/swap.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/swap.rs
index cf429378cf6d..1a2821452155 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/swap.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/swap.rs
@@ -18,12 +18,12 @@ use crate::imports::*;
#[test]
fn swap_locally_on_chain_using_local_assets() {
let asset_native =
- Box::new(v3::Location::try_from(RelayLocation::get()).expect("conversion works"));
- let asset_one = Box::new(v3::Location {
+ Box::new(Location::try_from(RelayLocation::get()).expect("conversion works"));
+ let asset_one = Box::new(Location {
parents: 0,
interior: [
- v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- v3::Junction::GeneralIndex(ASSET_ID.into()),
+ Junction::PalletInstance(ASSETS_PALLET_ID),
+ Junction::GeneralIndex(ASSET_ID.into()),
]
.into(),
});
@@ -112,11 +112,11 @@ fn swap_locally_on_chain_using_local_assets() {
#[test]
fn swap_locally_on_chain_using_foreign_assets() {
- let asset_native = Box::new(v3::Location::try_from(RelayLocation::get()).unwrap());
+ let asset_native = Box::new(Location::try_from(RelayLocation::get()).unwrap());
let asset_location_on_penpal =
- v3::Location::try_from(PenpalLocalTeleportableToAssetHub::get()).expect("conversion_works");
+ Location::try_from(PenpalLocalTeleportableToAssetHub::get()).expect("conversion_works");
let foreign_asset_at_asset_hub_westend =
- v3::Location::new(1, [v3::Junction::Parachain(PenpalA::para_id().into())])
+ Location::new(1, [Junction::Parachain(PenpalA::para_id().into())])
.appended_with(asset_location_on_penpal)
.unwrap();
@@ -141,7 +141,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
// 1. Mint foreign asset (in reality this should be a teleport or some such)
assert_ok!(::ForeignAssets::mint(
::RuntimeOrigin::signed(sov_penpal_on_ahr.clone().into()),
- foreign_asset_at_asset_hub_westend,
+ foreign_asset_at_asset_hub_westend.clone(),
sov_penpal_on_ahr.clone().into(),
ASSET_HUB_WESTEND_ED * 3_000_000_000_000,
));
@@ -157,7 +157,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
assert_ok!(::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubWestendSender::get()),
asset_native.clone(),
- Box::new(foreign_asset_at_asset_hub_westend),
+ Box::new(foreign_asset_at_asset_hub_westend.clone()),
));
assert_expected_events!(
@@ -171,7 +171,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
assert_ok!(::AssetConversion::add_liquidity(
::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()),
asset_native.clone(),
- Box::new(foreign_asset_at_asset_hub_westend),
+ Box::new(foreign_asset_at_asset_hub_westend.clone()),
1_000_000_000_000_000,
2_000_000_000_000_000,
0,
@@ -189,7 +189,7 @@ fn swap_locally_on_chain_using_foreign_assets() {
);
// 4. Swap!
- let path = vec![asset_native.clone(), Box::new(foreign_asset_at_asset_hub_westend)];
+ let path = vec![asset_native.clone(), Box::new(foreign_asset_at_asset_hub_westend.clone())];
assert_ok!(
::AssetConversion::swap_exact_tokens_for_tokens(
@@ -252,8 +252,8 @@ fn cannot_create_pool_from_pool_assets() {
assert_matches::assert_matches!(
::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubWestendSender::get()),
- Box::new(v3::Location::try_from(asset_native).expect("conversion works")),
- Box::new(v3::Location::try_from(asset_one).expect("conversion works")),
+ Box::new(Location::try_from(asset_native).expect("conversion works")),
+ Box::new(Location::try_from(asset_one).expect("conversion works")),
),
Err(DispatchError::Module(ModuleError{index: _, error: _, message})) => assert_eq!(message, Some("Unknown"))
);
@@ -262,12 +262,12 @@ fn cannot_create_pool_from_pool_assets() {
#[test]
fn pay_xcm_fee_with_some_asset_swapped_for_native() {
- let asset_native = v3::Location::try_from(RelayLocation::get()).expect("conversion works");
- let asset_one = xcm::v3::Location {
+ let asset_native = Location::try_from(RelayLocation::get()).expect("conversion works");
+ let asset_one = Location {
parents: 0,
interior: [
- xcm::v3::Junction::PalletInstance(ASSETS_PALLET_ID),
- xcm::v3::Junction::GeneralIndex(ASSET_ID.into()),
+ Junction::PalletInstance(ASSETS_PALLET_ID),
+ Junction::GeneralIndex(ASSET_ID.into()),
]
.into(),
};
@@ -296,8 +296,8 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
assert_ok!(::AssetConversion::create_pool(
::RuntimeOrigin::signed(AssetHubWestendSender::get()),
- Box::new(asset_native),
- Box::new(asset_one),
+ Box::new(asset_native.clone()),
+ Box::new(asset_one.clone()),
));
assert_expected_events!(
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/teleport.rs
index a524b87b2daf..15d39858acca 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/teleport.rs
@@ -15,53 +15,6 @@
use crate::imports::*;
-fn relay_origin_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Westend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(631_531_000, 7_186)));
-
- assert_expected_events!(
- Westend,
- vec![
- // Amount to teleport is withdrawn from Sender
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == t.sender.account_id,
- amount: *amount == t.args.amount,
- },
- // Amount to teleport is deposited in Relay's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- ]
- );
-}
-
-fn relay_dest_assertions(t: SystemParaToRelayTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Westend::assert_ump_queue_processed(
- true,
- Some(AssetHubWestend::para_id()),
- Some(Weight::from_parts(307_225_000, 7_186)),
- );
-
- assert_expected_events!(
- Westend,
- vec![
- // Amount is withdrawn from Relay Chain's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) {
Westend::assert_ump_queue_processed(
false,
@@ -92,22 +45,6 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
);
}
-fn para_dest_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- AssetHubWestend::assert_dmp_queue_complete(Some(Weight::from_parts(157_718_000, 3593)));
-
- assert_expected_events!(
- AssetHubWestend,
- vec![
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) {
type RuntimeEvent = ::RuntimeEvent;
let system_para_native_asset_location = RelayLocation::get();
@@ -141,7 +78,6 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
);
let (expected_foreign_asset_id, expected_foreign_asset_amount) =
non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap();
- let expected_foreign_asset_id_v3: v3::Location = expected_foreign_asset_id.try_into().unwrap();
AssetHubWestend::assert_xcmp_queue_success(None);
@@ -159,7 +95,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
who: *who == t.receiver.account_id,
},
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => {
- asset_id: *asset_id == expected_foreign_asset_id_v3,
+ asset_id: *asset_id == expected_foreign_asset_id,
owner: *owner == t.receiver.account_id,
amount: *amount == expected_foreign_asset_amount,
},
@@ -173,7 +109,6 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) {
AssetHubWestend::assert_xcm_pallet_attempted_complete(None);
let (expected_foreign_asset_id, expected_foreign_asset_amount) =
non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap();
- let expected_foreign_asset_id_v3: v3::Location = expected_foreign_asset_id.try_into().unwrap();
assert_expected_events!(
AssetHubWestend,
vec![
@@ -189,7 +124,7 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) {
},
// foreign asset is burned locally as part of teleportation
RuntimeEvent::ForeignAssets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
- asset_id: *asset_id == expected_foreign_asset_id_v3,
+ asset_id: *asset_id == expected_foreign_asset_id,
owner: *owner == t.sender.account_id,
balance: *balance == expected_foreign_asset_amount,
},
@@ -232,17 +167,6 @@ fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) {
);
}
-fn relay_limited_teleport_assets(t: RelayToSystemParaTest) -> DispatchResult {
- ::XcmPallet::limited_teleport_assets(
- t.signed_origin,
- bx!(t.args.dest.into()),
- bx!(t.args.beneficiary.into()),
- bx!(t.args.assets.into()),
- t.args.fee_asset_item,
- t.args.weight_limit,
- )
-}
-
fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult {
::PolkadotXcm::limited_teleport_assets(
t.signed_origin,
@@ -276,90 +200,41 @@ fn system_para_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResul
)
}
-/// Limited Teleport of native asset from Relay Chain to the System Parachain should work
#[test]
-fn limited_teleport_native_assets_from_relay_to_system_para_works() {
- // Init values for Relay Chain
- let amount_to_send: Balance = WESTEND_ED * 1000;
- let dest = Westend::child_location_of(AssetHubWestend::para_id());
- let beneficiary_id = AssetHubWestendReceiver::get();
- let test_args = TestContext {
- sender: WestendSender::get(),
- receiver: AssetHubWestendReceiver::get(),
- args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send),
- };
-
- let mut test = RelayToSystemParaTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(relay_origin_assertions);
- test.set_assertion::(para_dest_assertions);
- test.set_dispatchable::(relay_limited_teleport_assets);
- test.assert();
-
- let delivery_fees = Westend::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
+fn teleport_to_other_system_parachains_works() {
+ let amount = ASSET_HUB_WESTEND_ED * 100;
+ let native_asset: Assets = (Parent, amount).into();
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
+ test_parachain_is_trusted_teleporter!(
+ AssetHubWestend, // Origin
+ AssetHubWestendXcmConfig, // XCM Configuration
+ vec![BridgeHubWestend], // Destinations
+ (native_asset, amount)
+ );
}
-/// Limited Teleport of native asset from System Parachain to Relay Chain
-/// should work when there is enough balance in Relay Chain's `CheckAccount`
#[test]
-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();
-
- // Init values for Relay Chain
- let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000;
- let destination = AssetHubWestend::parent_location();
- let beneficiary_id = WestendReceiver::get();
- let assets = (Parent, amount_to_send).into();
-
- let test_args = TestContext {
- sender: AssetHubWestendSender::get(),
- receiver: WestendReceiver::get(),
- args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0),
- };
-
- let mut test = SystemParaToRelayTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(para_origin_assertions);
- test.set_assertion::(relay_dest_assertions);
- test.set_dispatchable::(system_para_limited_teleport_assets);
- test.assert();
+fn teleport_from_and_to_relay() {
+ let amount = WESTEND_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- let delivery_fees = AssetHubWestend::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
+ test_relay_is_trusted_teleporter!(
+ Westend,
+ WestendXcmConfig,
+ vec![AssetHubWestend],
+ (native_asset, amount)
+ );
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
+ test_parachain_is_trusted_teleporter_for_relay!(
+ AssetHubWestend,
+ AssetHubWestendXcmConfig,
+ Westend,
+ amount
+ );
}
/// 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`
+/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount`
#[test]
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
// Init values for Relay Chain
@@ -399,19 +274,6 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
assert_eq!(receiver_balance_after, receiver_balance_before);
}
-#[test]
-fn teleport_to_other_system_parachains_works() {
- let amount = ASSET_HUB_WESTEND_ED * 100;
- let native_asset: Assets = (Parent, amount).into();
-
- test_parachain_is_trusted_teleporter!(
- AssetHubWestend, // Origin
- AssetHubWestendXcmConfig, // XCM Configuration
- vec![BridgeHubWestend], // Destinations
- (native_asset, amount)
- );
-}
-
/// Bidirectional teleports of local Penpal assets to Asset Hub as foreign assets while paying
/// fees using (reserve transferred) native asset.
pub fn do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt(
diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/treasury.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/treasury.rs
index 8cbce3e0d223..b70967184387 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/treasury.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/treasury.rs
@@ -14,15 +14,17 @@
// limitations under the License.
use crate::imports::*;
-use emulated_integration_tests_common::accounts::{ALICE, BOB};
-use frame_support::traits::fungibles::{Create, Inspect, Mutate};
+use emulated_integration_tests_common::{
+ accounts::{ALICE, BOB},
+ USDT_ID,
+};
+use frame_support::traits::fungibles::{Inspect, Mutate};
use polkadot_runtime_common::impls::VersionedLocatableAsset;
use xcm_executor::traits::ConvertLocation;
#[test]
fn create_and_claim_treasury_spend() {
- const ASSET_ID: u32 = 1984;
- const SPEND_AMOUNT: u128 = 1_000_000;
+ const SPEND_AMOUNT: u128 = 1_000_000_000;
// treasury location from a sibling parachain.
let treasury_location: Location = Location::new(1, PalletInstance(37));
// treasury account on a sibling parachain.
@@ -33,7 +35,7 @@ fn create_and_claim_treasury_spend() {
// asset kind to be spend from the treasury.
let asset_kind = VersionedLocatableAsset::V4 {
location: asset_hub_location,
- asset_id: AssetId([PalletInstance(50), GeneralIndex(ASSET_ID.into())].into()),
+ asset_id: AssetId([PalletInstance(50), GeneralIndex(USDT_ID.into())].into()),
};
// treasury spend beneficiary.
let alice: AccountId = Westend::account_id_of(ALICE);
@@ -43,16 +45,10 @@ fn create_and_claim_treasury_spend() {
AssetHubWestend::execute_with(|| {
type Assets = ::Assets;
- // create an asset class and mint some assets to the treasury account.
- assert_ok!(>::create(
- ASSET_ID,
- treasury_account.clone(),
- true,
- SPEND_AMOUNT / 2
- ));
- assert_ok!(>::mint_into(ASSET_ID, &treasury_account, SPEND_AMOUNT * 4));
+ // USDT created at genesis, mint some assets to the treasury account.
+ assert_ok!(>::mint_into(USDT_ID, &treasury_account, SPEND_AMOUNT * 4));
// beneficiary has zero balance.
- assert_eq!(>::balance(ASSET_ID, &alice,), 0u128,);
+ assert_eq!(>::balance(USDT_ID, &alice,), 0u128,);
});
Westend::execute_with(|| {
@@ -94,7 +90,7 @@ fn create_and_claim_treasury_spend() {
AssetHubWestend,
vec![
RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => {
- id: id == &ASSET_ID,
+ id: id == &USDT_ID,
from: from == &treasury_account,
to: to == &alice,
amount: amount == &SPEND_AMOUNT,
@@ -104,7 +100,7 @@ fn create_and_claim_treasury_spend() {
]
);
// beneficiary received the assets from the treasury.
- assert_eq!(>::balance(ASSET_ID, &alice,), SPEND_AMOUNT,);
+ assert_eq!(>::balance(USDT_ID, &alice,), SPEND_AMOUNT,);
});
Westend::execute_with(|| {
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs
index 3ee509389c67..ac08e48ded68 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs
@@ -23,7 +23,8 @@ mod imports {
pub use xcm::{
latest::ParentThen,
prelude::{AccountId32 as AccountId32Junction, *},
- v3::{self, NetworkId::Westend as WestendId},
+ v4,
+ v4::NetworkId::Westend as WestendId,
};
pub use xcm_executor::traits::TransferType;
@@ -31,7 +32,8 @@ mod imports {
pub use emulated_integration_tests_common::{
accounts::ALICE,
impls::Inspect,
- test_parachain_is_trusted_teleporter,
+ test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay,
+ test_relay_is_trusted_teleporter,
xcm_emulator::{
assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, TestExt,
},
@@ -59,15 +61,20 @@ mod imports {
},
PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner,
},
- rococo_emulated_chain::{genesis::ED as ROCOCO_ED, RococoRelayPallet as RococoPallet},
+ rococo_emulated_chain::{
+ genesis::ED as ROCOCO_ED, rococo_runtime::xcm_config::XcmConfig as RococoXcmConfig,
+ RococoRelayPallet as RococoPallet,
+ },
AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver,
AssetHubRococoParaSender as AssetHubRococoSender, AssetHubWestendPara as AssetHubWestend,
AssetHubWestendParaReceiver as AssetHubWestendReceiver,
AssetHubWestendParaSender as AssetHubWestendSender, BridgeHubRococoPara as BridgeHubRococo,
+ BridgeHubRococoParaReceiver as BridgeHubRococoReceiver,
BridgeHubRococoParaSender as BridgeHubRococoSender,
BridgeHubWestendPara as BridgeHubWestend, PenpalAPara as PenpalA,
PenpalAParaReceiver as PenpalAReceiver, PenpalAParaSender as PenpalASender,
- RococoRelay as Rococo,
+ RococoRelay as Rococo, RococoRelayReceiver as RococoReceiver,
+ RococoRelaySender as RococoSender,
};
pub const ASSET_MIN_BALANCE: u128 = 1000;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs
index 6053936487b2..8a674f89c9ef 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs
@@ -36,10 +36,10 @@ fn send_assets_over_bridge(send_fn: F) {
fn set_up_rocs_for_penpal_rococo_through_ahr_to_ahw(
sender: &AccountId,
amount: u128,
-) -> (Location, v3::Location) {
+) -> (Location, v4::Location) {
let roc_at_rococo_parachains = roc_at_ah_rococo();
- let roc_at_asset_hub_westend = bridged_roc_at_ah_westend().try_into().unwrap();
- create_foreign_on_ah_westend(roc_at_asset_hub_westend, true);
+ let roc_at_asset_hub_westend = bridged_roc_at_ah_westend();
+ create_foreign_on_ah_westend(roc_at_asset_hub_westend.clone(), true);
let penpal_location = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location);
@@ -121,11 +121,11 @@ fn send_roc_usdt_and_weth_from_asset_hub_rococo_to_asset_hub_westend() {
let amount = ASSET_HUB_ROCOCO_ED * 1_000_000;
let sender = AssetHubRococoSender::get();
let receiver = AssetHubWestendReceiver::get();
- let roc_at_asset_hub_rococo: v3::Location = roc_at_ah_rococo().try_into().unwrap();
- let bridged_roc_at_asset_hub_westend = bridged_roc_at_ah_westend().try_into().unwrap();
+ let roc_at_asset_hub_rococo = roc_at_ah_rococo();
+ let bridged_roc_at_asset_hub_westend = bridged_roc_at_ah_westend();
- create_foreign_on_ah_westend(bridged_roc_at_asset_hub_westend, true);
- set_up_pool_with_wnd_on_ah_westend(bridged_roc_at_asset_hub_westend);
+ create_foreign_on_ah_westend(bridged_roc_at_asset_hub_westend.clone(), true);
+ set_up_pool_with_wnd_on_ah_westend(bridged_roc_at_asset_hub_westend.clone());
////////////////////////////////////////////////////////////
// Let's first send over just some ROCs as a simple example
@@ -138,12 +138,13 @@ fn send_roc_usdt_and_weth_from_asset_hub_rococo_to_asset_hub_westend() {
::account_data_of(sov_ahw_on_ahr.clone()).free;
let sender_rocs_before = ::account_data_of(sender.clone()).free;
let receiver_rocs_before =
- foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend, &receiver);
+ foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend.clone(), &receiver);
// send ROCs, use them for fees
send_assets_over_bridge(|| {
let destination = asset_hub_westend_location();
- let assets: Assets = (Location::try_from(roc_at_asset_hub_rococo).unwrap(), amount).into();
+ let assets: Assets =
+ (Location::try_from(roc_at_asset_hub_rococo.clone()).unwrap(), amount).into();
let fee_idx = 0;
assert_ok!(send_assets_from_asset_hub_rococo(destination, assets, fee_idx));
});
@@ -185,9 +186,9 @@ fn send_roc_usdt_and_weth_from_asset_hub_rococo_to_asset_hub_westend() {
/////////////////////////////////////////////////////////////
let usdt_at_asset_hub_rococo = usdt_at_ah_rococo();
- let bridged_usdt_at_asset_hub_westend = bridged_usdt_at_ah_westend().try_into().unwrap();
+ let bridged_usdt_at_asset_hub_westend = bridged_usdt_at_ah_westend();
// wETH has same relative location on both Rococo and Westend AssetHubs
- let bridged_weth_at_ah = weth_at_asset_hubs().try_into().unwrap();
+ let bridged_weth_at_ah = weth_at_asset_hubs();
// mint USDT in sender's account (USDT already created in genesis)
AssetHubRococo::mint_asset(
@@ -197,19 +198,23 @@ fn send_roc_usdt_and_weth_from_asset_hub_rococo_to_asset_hub_westend() {
amount * 2,
);
// create wETH at src and dest and prefund sender's account
- create_foreign_on_ah_rococo(bridged_weth_at_ah, true, vec![(sender.clone(), amount * 2)]);
- create_foreign_on_ah_westend(bridged_weth_at_ah, true);
- create_foreign_on_ah_westend(bridged_usdt_at_asset_hub_westend, true);
- set_up_pool_with_wnd_on_ah_westend(bridged_usdt_at_asset_hub_westend);
+ create_foreign_on_ah_rococo(
+ bridged_weth_at_ah.clone(),
+ true,
+ vec![(sender.clone(), amount * 2)],
+ );
+ create_foreign_on_ah_westend(bridged_weth_at_ah.clone(), true);
+ create_foreign_on_ah_westend(bridged_usdt_at_asset_hub_westend.clone(), true);
+ set_up_pool_with_wnd_on_ah_westend(bridged_usdt_at_asset_hub_westend.clone());
let receiver_usdts_before =
- foreign_balance_on_ah_westend(bridged_usdt_at_asset_hub_westend, &receiver);
- let receiver_weth_before = foreign_balance_on_ah_westend(bridged_weth_at_ah, &receiver);
+ foreign_balance_on_ah_westend(bridged_usdt_at_asset_hub_westend.clone(), &receiver);
+ let receiver_weth_before = foreign_balance_on_ah_westend(bridged_weth_at_ah.clone(), &receiver);
// send USDTs and wETHs
let assets: Assets = vec![
(usdt_at_asset_hub_rococo.clone(), amount).into(),
- (Location::try_from(bridged_weth_at_ah).unwrap(), amount).into(),
+ (Location::try_from(bridged_weth_at_ah.clone()).unwrap(), amount).into(),
]
.into();
// use USDT for fees
@@ -258,9 +263,8 @@ fn send_back_wnds_from_asset_hub_rococo_to_asset_hub_westend() {
let sender = AssetHubRococoSender::get();
let receiver = AssetHubWestendReceiver::get();
let wnd_at_asset_hub_rococo = bridged_wnd_at_ah_rococo();
- let wnd_at_asset_hub_rococo_v3 = wnd_at_asset_hub_rococo.clone().try_into().unwrap();
let prefund_accounts = vec![(sender.clone(), prefund_amount)];
- create_foreign_on_ah_rococo(wnd_at_asset_hub_rococo_v3, true, prefund_accounts);
+ create_foreign_on_ah_rococo(wnd_at_asset_hub_rococo.clone(), true, prefund_accounts);
// fund the AHR's SA on AHW with the WND tokens held in reserve
let sov_ahr_on_ahw = AssetHubWestend::sovereign_account_of_parachain_on_other_global_consensus(
@@ -273,14 +277,14 @@ fn send_back_wnds_from_asset_hub_rococo_to_asset_hub_westend() {
::account_data_of(sov_ahr_on_ahw.clone()).free;
assert_eq!(wnds_in_reserve_on_ahw_before, prefund_amount);
- let sender_wnds_before = foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo_v3, &sender);
+ let sender_wnds_before = foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo.clone(), &sender);
assert_eq!(sender_wnds_before, prefund_amount);
let receiver_wnds_before = ::account_data_of(receiver.clone()).free;
// send back WNDs, use them for fees
send_assets_over_bridge(|| {
let destination = asset_hub_westend_location();
- let assets: Assets = (wnd_at_asset_hub_rococo, amount_to_send).into();
+ let assets: Assets = (wnd_at_asset_hub_rococo.clone(), amount_to_send).into();
let fee_idx = 0;
assert_ok!(send_assets_from_asset_hub_rococo(destination, assets, fee_idx));
});
@@ -309,7 +313,7 @@ fn send_back_wnds_from_asset_hub_rococo_to_asset_hub_westend() {
);
});
- let sender_wnds_after = foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo_v3, &sender);
+ let sender_wnds_after = foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo, &sender);
let receiver_wnds_after = ::account_data_of(receiver).free;
let wnds_in_reserve_on_ahw_after =
::account_data_of(sov_ahr_on_ahw).free;
@@ -341,7 +345,8 @@ fn send_rocs_from_penpal_rococo_through_asset_hub_rococo_to_asset_hub_westend()
type ForeignAssets = ::ForeignAssets;
>::balance(roc_at_rococo_parachains.clone(), &sender)
});
- let receiver_rocs_before = foreign_balance_on_ah_westend(roc_at_asset_hub_westend, &receiver);
+ let receiver_rocs_before =
+ foreign_balance_on_ah_westend(roc_at_asset_hub_westend.clone(), &receiver);
// Send ROCs over bridge
{
@@ -372,7 +377,7 @@ fn send_rocs_from_penpal_rococo_through_asset_hub_rococo_to_asset_hub_westend()
vec![
// issue ROCs on AHW
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => {
- asset_id: *asset_id == roc_at_rococo_parachains.clone().try_into().unwrap(),
+ asset_id: *asset_id == roc_at_rococo_parachains.clone(),
owner: owner == &receiver,
},
// message processed successfully
@@ -403,7 +408,6 @@ fn send_rocs_from_penpal_rococo_through_asset_hub_rococo_to_asset_hub_westend()
#[test]
fn send_back_wnds_from_penpal_rococo_through_asset_hub_rococo_to_asset_hub_westend() {
let wnd_at_rococo_parachains = bridged_wnd_at_ah_rococo();
- let wnd_at_rococo_parachains_v3 = wnd_at_rococo_parachains.clone().try_into().unwrap();
let amount = ASSET_HUB_ROCOCO_ED * 10_000_000;
let sender = PenpalASender::get();
let receiver = AssetHubWestendReceiver::get();
@@ -416,7 +420,7 @@ fn send_back_wnds_from_penpal_rococo_through_asset_hub_rococo_to_asset_hub_weste
let penpal_location = AssetHubRococo::sibling_location_of(PenpalA::para_id());
let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location);
let prefund_accounts = vec![(sov_penpal_on_ahr, amount * 2)];
- create_foreign_on_ah_rococo(wnd_at_rococo_parachains_v3, true, prefund_accounts);
+ create_foreign_on_ah_rococo(wnd_at_rococo_parachains.clone(), true, prefund_accounts);
let asset_owner: AccountId = AssetHubRococo::account_id_of(ALICE);
PenpalA::force_create_foreign_asset(
wnd_at_rococo_parachains.clone(),
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/mod.rs
index ceccf98a0240..6ce8ecef0df3 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/mod.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/mod.rs
@@ -69,7 +69,7 @@ pub(crate) fn weth_at_asset_hubs() -> Location {
}
pub(crate) fn create_foreign_on_ah_rococo(
- id: v3::Location,
+ id: v4::Location,
sufficient: bool,
prefund_accounts: Vec<(AccountId, u128)>,
) {
@@ -78,18 +78,18 @@ pub(crate) fn create_foreign_on_ah_rococo(
AssetHubRococo::force_create_foreign_asset(id, owner, sufficient, min, prefund_accounts);
}
-pub(crate) fn create_foreign_on_ah_westend(id: v3::Location, sufficient: bool) {
+pub(crate) fn create_foreign_on_ah_westend(id: v4::Location, sufficient: bool) {
let owner = AssetHubWestend::account_id_of(ALICE);
AssetHubWestend::force_create_foreign_asset(id, owner, sufficient, ASSET_MIN_BALANCE, vec![]);
}
-pub(crate) fn foreign_balance_on_ah_rococo(id: v3::Location, who: &AccountId) -> u128 {
+pub(crate) fn foreign_balance_on_ah_rococo(id: v4::Location, who: &AccountId) -> u128 {
AssetHubRococo::execute_with(|| {
type Assets = ::ForeignAssets;
>::balance(id, who)
})
}
-pub(crate) fn foreign_balance_on_ah_westend(id: v3::Location, who: &AccountId) -> u128 {
+pub(crate) fn foreign_balance_on_ah_westend(id: v4::Location, who: &AccountId) -> u128 {
AssetHubWestend::execute_with(|| {
type Assets = ::ForeignAssets;
>::balance(id, who)
@@ -97,8 +97,8 @@ pub(crate) fn foreign_balance_on_ah_westend(id: v3::Location, who: &AccountId) -
}
// set up pool
-pub(crate) fn set_up_pool_with_wnd_on_ah_westend(foreign_asset: v3::Location) {
- let wnd: v3::Location = v3::Parent.into();
+pub(crate) fn set_up_pool_with_wnd_on_ah_westend(foreign_asset: v4::Location) {
+ let wnd: v4::Location = v4::Parent.into();
AssetHubWestend::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
let owner = AssetHubWestendSender::get();
@@ -106,14 +106,14 @@ pub(crate) fn set_up_pool_with_wnd_on_ah_westend(foreign_asset: v3::Location) {
assert_ok!(::ForeignAssets::mint(
signed_owner.clone(),
- foreign_asset.into(),
+ foreign_asset.clone().into(),
owner.clone().into(),
3_000_000_000_000,
));
assert_ok!(::AssetConversion::create_pool(
signed_owner.clone(),
- Box::new(wnd),
- Box::new(foreign_asset),
+ Box::new(wnd.clone()),
+ Box::new(foreign_asset.clone()),
));
assert_expected_events!(
AssetHubWestend,
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs
index 652447fa5601..3f2038b4bdd1 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs
@@ -29,7 +29,7 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable
let xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit, check_origin },
ExportMessage {
- network: WestendId.into(),
+ network: WestendId,
destination: [Parachain(AssetHubWestend::para_id().into())].into(),
xcm: remote_xcm,
},
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
index 40a1968ec557..84328fb7c6d2 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
@@ -560,7 +560,6 @@ fn send_token_from_ethereum_to_asset_hub_with_fee(account_id: [u8; 32], fee: u12
2,
[EthereumNetwork::get().into(), AccountKey20 { network: None, key: WETH }],
);
- // (Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH })
// Fund asset hub sovereign on bridge hub
let asset_hub_sovereign = BridgeHubRococo::sovereign_account_id_of(Location::new(
1,
@@ -669,8 +668,8 @@ fn send_token_from_ethereum_to_non_existent_account_on_asset_hub_with_insufficie
#[test]
fn send_token_from_ethereum_to_non_existent_account_on_asset_hub_with_sufficient_fee_but_do_not_satisfy_ed(
) {
- // On AH the xcm fee is 33_873_024 and the ED is 3_300_000
- send_token_from_ethereum_to_asset_hub_with_fee([1; 32], 36_000_000);
+ // On AH the xcm fee is 26_789_690 and the ED is 3_300_000
+ send_token_from_ethereum_to_asset_hub_with_fee([1; 32], 30_000_000);
AssetHubRococo::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/teleport.rs
index 1fb03748d926..8cdd9613dc52 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/teleport.rs
@@ -27,3 +27,23 @@ fn teleport_to_other_system_parachains_works() {
(native_asset, amount)
);
}
+
+#[test]
+fn teleport_from_and_to_relay() {
+ let amount = ROCOCO_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
+
+ test_relay_is_trusted_teleporter!(
+ Rococo,
+ RococoXcmConfig,
+ vec![BridgeHubRococo],
+ (native_asset, amount)
+ );
+
+ test_parachain_is_trusted_teleporter_for_relay!(
+ BridgeHubRococo,
+ BridgeHubRococoXcmConfig,
+ Rococo,
+ amount
+ );
+}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs
index 782b83bac475..5e0462d14882 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs
@@ -23,8 +23,7 @@ mod imports {
pub use xcm::{
latest::ParentThen,
prelude::{AccountId32 as AccountId32Junction, *},
- v3,
- v4::NetworkId::Rococo as RococoId,
+ v4::{self, NetworkId::Rococo as RococoId},
};
pub use xcm_executor::traits::TransferType;
@@ -32,7 +31,8 @@ mod imports {
pub use emulated_integration_tests_common::{
accounts::ALICE,
impls::Inspect,
- test_parachain_is_trusted_teleporter,
+ test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay,
+ test_relay_is_trusted_teleporter,
xcm_emulator::{
assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, TestExt,
},
@@ -55,14 +55,19 @@ mod imports {
penpal_runtime::xcm_config::UniversalLocation as PenpalUniversalLocation,
PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet,
},
- westend_emulated_chain::WestendRelayPallet as WestendPallet,
+ westend_emulated_chain::{
+ genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig,
+ WestendRelayPallet as WestendPallet,
+ },
AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver,
AssetHubRococoParaSender as AssetHubRococoSender, AssetHubWestendPara as AssetHubWestend,
AssetHubWestendParaReceiver as AssetHubWestendReceiver,
AssetHubWestendParaSender as AssetHubWestendSender, BridgeHubRococoPara as BridgeHubRococo,
BridgeHubWestendPara as BridgeHubWestend,
+ BridgeHubWestendParaReceiver as BridgeHubWestendReceiver,
BridgeHubWestendParaSender as BridgeHubWestendSender, PenpalBPara as PenpalB,
PenpalBParaSender as PenpalBSender, WestendRelay as Westend,
+ WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender,
};
pub const ASSET_MIN_BALANCE: u128 = 1000;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs
index 0c0b04cd45a9..fc8b772a9c7e 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs
@@ -35,10 +35,10 @@ fn send_assets_over_bridge(send_fn: F) {
fn set_up_wnds_for_penpal_westend_through_ahw_to_ahr(
sender: &AccountId,
amount: u128,
-) -> (Location, v3::Location) {
+) -> (Location, v4::Location) {
let wnd_at_westend_parachains = wnd_at_ah_westend();
- let wnd_at_asset_hub_rococo = bridged_wnd_at_ah_rococo().try_into().unwrap();
- create_foreign_on_ah_rococo(wnd_at_asset_hub_rococo, true);
+ let wnd_at_asset_hub_rococo = bridged_wnd_at_ah_rococo();
+ create_foreign_on_ah_rococo(wnd_at_asset_hub_rococo.clone(), true);
let penpal_location = AssetHubWestend::sibling_location_of(PenpalB::para_id());
let sov_penpal_on_ahw = AssetHubWestend::sovereign_account_id_of(penpal_location);
@@ -116,10 +116,10 @@ fn send_wnds_from_asset_hub_westend_to_asset_hub_rococo() {
let sender = AssetHubWestendSender::get();
let receiver = AssetHubRococoReceiver::get();
let wnd_at_asset_hub_westend = wnd_at_ah_westend();
- let bridged_wnd_at_asset_hub_rococo = bridged_wnd_at_ah_rococo().try_into().unwrap();
- create_foreign_on_ah_rococo(bridged_wnd_at_asset_hub_rococo, true);
+ let bridged_wnd_at_asset_hub_rococo = bridged_wnd_at_ah_rococo();
+ create_foreign_on_ah_rococo(bridged_wnd_at_asset_hub_rococo.clone(), true);
- set_up_pool_with_roc_on_ah_rococo(bridged_wnd_at_asset_hub_rococo, true);
+ set_up_pool_with_roc_on_ah_rococo(bridged_wnd_at_asset_hub_rococo.clone(), true);
let sov_ahr_on_ahw = AssetHubWestend::sovereign_account_of_parachain_on_other_global_consensus(
Rococo,
@@ -129,7 +129,7 @@ fn send_wnds_from_asset_hub_westend_to_asset_hub_rococo() {
::account_data_of(sov_ahr_on_ahw.clone()).free;
let sender_wnds_before = ::account_data_of(sender.clone()).free;
let receiver_wnds_before =
- foreign_balance_on_ah_rococo(bridged_wnd_at_asset_hub_rococo, &receiver);
+ foreign_balance_on_ah_rococo(bridged_wnd_at_asset_hub_rococo.clone(), &receiver);
// send WNDs, use them for fees
send_assets_over_bridge(|| {
@@ -187,10 +187,8 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
let sender = AssetHubWestendSender::get();
let receiver = AssetHubRococoReceiver::get();
let bridged_roc_at_asset_hub_westend = bridged_roc_at_ah_westend();
- let bridged_roc_at_asset_hub_westend_v3 =
- bridged_roc_at_asset_hub_westend.clone().try_into().unwrap();
let prefund_accounts = vec![(sender.clone(), prefund_amount)];
- create_foreign_on_ah_westend(bridged_roc_at_asset_hub_westend_v3, true, prefund_accounts);
+ create_foreign_on_ah_westend(bridged_roc_at_asset_hub_westend.clone(), true, prefund_accounts);
////////////////////////////////////////////////////////////
// Let's first send back just some ROCs as a simple example
@@ -208,14 +206,14 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
assert_eq!(rocs_in_reserve_on_ahr_before, prefund_amount);
let sender_rocs_before =
- foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend_v3, &sender);
+ foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend.clone(), &sender);
assert_eq!(sender_rocs_before, prefund_amount);
let receiver_rocs_before = ::account_data_of(receiver.clone()).free;
// send back ROCs, use them for fees
send_assets_over_bridge(|| {
let destination = asset_hub_rococo_location();
- let assets: Assets = (bridged_roc_at_asset_hub_westend, amount_to_send).into();
+ let assets: Assets = (bridged_roc_at_asset_hub_westend.clone(), amount_to_send).into();
let fee_idx = 0;
assert_ok!(send_assets_from_asset_hub_westend(destination, assets, fee_idx));
});
@@ -245,7 +243,7 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
});
let sender_rocs_after =
- foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend_v3, &sender);
+ foreign_balance_on_ah_westend(bridged_roc_at_asset_hub_westend, &sender);
let receiver_rocs_after = ::account_data_of(receiver.clone()).free;
let rocs_in_reserve_on_ahr_after =
::account_data_of(sov_ahw_on_ahr.clone()).free;
@@ -262,14 +260,14 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
//////////////////////////////////////////////////////////////////
// wETH has same relative location on both Rococo and Westend AssetHubs
- let bridged_weth_at_ah = weth_at_asset_hubs().try_into().unwrap();
- let bridged_usdt_at_asset_hub_westend = bridged_usdt_at_ah_westend().try_into().unwrap();
+ let bridged_weth_at_ah = weth_at_asset_hubs();
+ let bridged_usdt_at_asset_hub_westend = bridged_usdt_at_ah_westend();
// set up destination chain AH Rococo:
// create a ROC/USDT pool to be able to pay fees with USDT (USDT created in genesis)
- set_up_pool_with_roc_on_ah_rococo(usdt_at_ah_rococo().try_into().unwrap(), false);
+ set_up_pool_with_roc_on_ah_rococo(usdt_at_ah_rococo(), false);
// create wETH on Rococo (IRL it's already created by Snowbridge)
- create_foreign_on_ah_rococo(bridged_weth_at_ah, true);
+ create_foreign_on_ah_rococo(bridged_weth_at_ah.clone(), true);
// prefund AHW's sovereign account on AHR to be able to withdraw USDT and wETH from reserves
let sov_ahw_on_ahr = AssetHubRococo::sovereign_account_of_parachain_on_other_global_consensus(
Westend,
@@ -283,7 +281,7 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
);
AssetHubRococo::mint_foreign_asset(
::RuntimeOrigin::signed(AssetHubRococo::account_id_of(ALICE)),
- bridged_weth_at_ah,
+ bridged_weth_at_ah.clone(),
sov_ahw_on_ahr,
amount_to_send * 2,
);
@@ -291,21 +289,21 @@ fn send_back_rocs_usdt_and_weth_from_asset_hub_westend_to_asset_hub_rococo() {
// set up source chain AH Westend:
// create wETH and USDT foreign assets on Westend and prefund sender's account
let prefund_accounts = vec![(sender.clone(), amount_to_send * 2)];
- create_foreign_on_ah_westend(bridged_weth_at_ah, true, prefund_accounts.clone());
- create_foreign_on_ah_westend(bridged_usdt_at_asset_hub_westend, true, prefund_accounts);
+ create_foreign_on_ah_westend(bridged_weth_at_ah.clone(), true, prefund_accounts.clone());
+ create_foreign_on_ah_westend(bridged_usdt_at_asset_hub_westend.clone(), true, prefund_accounts);
// check balances before
let receiver_usdts_before = AssetHubRococo::execute_with(|| {
type Assets = ::Assets;
>::balance(USDT_ID, &receiver)
});
- let receiver_weth_before = foreign_balance_on_ah_rococo(bridged_weth_at_ah, &receiver);
+ let receiver_weth_before = foreign_balance_on_ah_rococo(bridged_weth_at_ah.clone(), &receiver);
let usdt_id: AssetId = Location::try_from(bridged_usdt_at_asset_hub_westend).unwrap().into();
// send USDTs and wETHs
let assets: Assets = vec![
(usdt_id.clone(), amount_to_send).into(),
- (Location::try_from(bridged_weth_at_ah).unwrap(), amount_to_send).into(),
+ (Location::try_from(bridged_weth_at_ah.clone()).unwrap(), amount_to_send).into(),
]
.into();
// use USDT for fees
@@ -367,7 +365,8 @@ fn send_wnds_from_penpal_westend_through_asset_hub_westend_to_asset_hub_rococo()
type ForeignAssets = ::ForeignAssets;
>::balance(wnd_at_westend_parachains.clone(), &sender)
});
- let receiver_wnds_before = foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo, &receiver);
+ let receiver_wnds_before =
+ foreign_balance_on_ah_rococo(wnd_at_asset_hub_rococo.clone(), &receiver);
// Send WNDs over bridge
{
@@ -398,7 +397,7 @@ fn send_wnds_from_penpal_westend_through_asset_hub_westend_to_asset_hub_rococo()
vec![
// issue WNDs on AHR
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => {
- asset_id: *asset_id == wnd_at_westend_parachains.clone().try_into().unwrap(),
+ asset_id: *asset_id == wnd_at_westend_parachains.clone(),
owner: owner == &receiver,
},
// message processed successfully
@@ -429,7 +428,6 @@ fn send_wnds_from_penpal_westend_through_asset_hub_westend_to_asset_hub_rococo()
#[test]
fn send_back_rocs_from_penpal_westend_through_asset_hub_westend_to_asset_hub_rococo() {
let roc_at_westend_parachains = bridged_roc_at_ah_westend();
- let roc_at_westend_parachains_v3 = roc_at_westend_parachains.clone().try_into().unwrap();
let amount = ASSET_HUB_WESTEND_ED * 10_000_000;
let sender = PenpalBSender::get();
let receiver = AssetHubRococoReceiver::get();
@@ -442,7 +440,7 @@ fn send_back_rocs_from_penpal_westend_through_asset_hub_westend_to_asset_hub_roc
let penpal_location = AssetHubWestend::sibling_location_of(PenpalB::para_id());
let sov_penpal_on_ahr = AssetHubWestend::sovereign_account_id_of(penpal_location);
let prefund_accounts = vec![(sov_penpal_on_ahr, amount * 2)];
- create_foreign_on_ah_westend(roc_at_westend_parachains_v3, true, prefund_accounts);
+ create_foreign_on_ah_westend(roc_at_westend_parachains.clone(), true, prefund_accounts);
let asset_owner: AccountId = AssetHubWestend::account_id_of(ALICE);
PenpalB::force_create_foreign_asset(
roc_at_westend_parachains.clone(),
@@ -454,7 +452,7 @@ fn send_back_rocs_from_penpal_westend_through_asset_hub_westend_to_asset_hub_roc
// fund the AHW's SA on AHR with the ROC tokens held in reserve
let sov_ahw_on_ahr = AssetHubRococo::sovereign_account_of_parachain_on_other_global_consensus(
- NetworkId::Westend,
+ Westend,
AssetHubWestend::para_id(),
);
AssetHubRococo::fund_accounts(vec![(sov_ahw_on_ahr.clone(), amount * 2)]);
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/mod.rs
index 87ae9aedd6f1..bf894a3baf58 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/mod.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/mod.rs
@@ -69,13 +69,13 @@ pub(crate) fn weth_at_asset_hubs() -> Location {
)
}
-pub(crate) fn create_foreign_on_ah_rococo(id: v3::Location, sufficient: bool) {
+pub(crate) fn create_foreign_on_ah_rococo(id: v4::Location, sufficient: bool) {
let owner = AssetHubRococo::account_id_of(ALICE);
AssetHubRococo::force_create_foreign_asset(id, owner, sufficient, ASSET_MIN_BALANCE, vec![]);
}
pub(crate) fn create_foreign_on_ah_westend(
- id: v3::Location,
+ id: v4::Location,
sufficient: bool,
prefund_accounts: Vec<(AccountId, u128)>,
) {
@@ -84,13 +84,13 @@ pub(crate) fn create_foreign_on_ah_westend(
AssetHubWestend::force_create_foreign_asset(id, owner, sufficient, min, prefund_accounts);
}
-pub(crate) fn foreign_balance_on_ah_rococo(id: v3::Location, who: &AccountId) -> u128 {
+pub(crate) fn foreign_balance_on_ah_rococo(id: v4::Location, who: &AccountId) -> u128 {
AssetHubRococo::execute_with(|| {
type Assets = ::ForeignAssets;
>::balance(id, who)
})
}
-pub(crate) fn foreign_balance_on_ah_westend(id: v3::Location, who: &AccountId) -> u128 {
+pub(crate) fn foreign_balance_on_ah_westend(id: v4::Location, who: &AccountId) -> u128 {
AssetHubWestend::execute_with(|| {
type Assets = ::ForeignAssets;
>::balance(id, who)
@@ -98,8 +98,8 @@ pub(crate) fn foreign_balance_on_ah_westend(id: v3::Location, who: &AccountId) -
}
// set up pool
-pub(crate) fn set_up_pool_with_roc_on_ah_rococo(asset: v3::Location, is_foreign: bool) {
- let roc: v3::Location = v3::Parent.into();
+pub(crate) fn set_up_pool_with_roc_on_ah_rococo(asset: v4::Location, is_foreign: bool) {
+ let roc: v4::Location = v4::Parent.into();
AssetHubRococo::execute_with(|| {
type RuntimeEvent = ::RuntimeEvent;
let owner = AssetHubRococoSender::get();
@@ -108,13 +108,13 @@ pub(crate) fn set_up_pool_with_roc_on_ah_rococo(asset: v3::Location, is_foreign:
if is_foreign {
assert_ok!(::ForeignAssets::mint(
signed_owner.clone(),
- asset.into(),
+ asset.clone().into(),
owner.clone().into(),
3_000_000_000_000,
));
} else {
- let asset_id = match asset.interior.split_last() {
- (_, Some(v3::Junction::GeneralIndex(id))) => id as u32,
+ let asset_id = match asset.interior.last() {
+ Some(v4::Junction::GeneralIndex(id)) => *id as u32,
_ => unreachable!(),
};
assert_ok!(::Assets::mint(
@@ -126,8 +126,8 @@ pub(crate) fn set_up_pool_with_roc_on_ah_rococo(asset: v3::Location, is_foreign:
}
assert_ok!(::AssetConversion::create_pool(
signed_owner.clone(),
- Box::new(roc),
- Box::new(asset),
+ Box::new(roc.clone()),
+ Box::new(asset.clone()),
));
assert_expected_events!(
AssetHubRococo,
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/teleport.rs
index 64378a844f52..a5add3b82957 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/teleport.rs
@@ -27,3 +27,23 @@ fn teleport_to_other_system_parachains_works() {
(native_asset, amount)
);
}
+
+#[test]
+fn teleport_from_and_to_relay() {
+ let amount = WESTEND_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
+
+ test_relay_is_trusted_teleporter!(
+ Westend,
+ WestendXcmConfig,
+ vec![BridgeHubWestend],
+ (native_asset, amount)
+ );
+
+ test_parachain_is_trusted_teleporter_for_relay!(
+ BridgeHubWestend,
+ BridgeHubWestendXcmConfig,
+ Westend,
+ amount
+ );
+}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml
index 3012e2b19f53..c4d281b75a77 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/Cargo.toml
@@ -23,6 +23,7 @@ pallet-assets = { workspace = true }
pallet-treasury = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-utility = { workspace = true }
+pallet-whitelist = { workspace = true }
# Polkadot
polkadot-runtime-common = { workspace = true, default-features = true }
diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship.rs b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship.rs
new file mode 100644
index 000000000000..f97599bda7f0
--- /dev/null
+++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship.rs
@@ -0,0 +1,72 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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::*;
+use codec::Encode;
+use collectives_fellowship::pallet_fellowship_origins::Origin::Fellows as FellowsOrigin;
+use frame_support::{assert_ok, sp_runtime::traits::Dispatchable};
+
+#[test]
+fn fellows_whitelist_call() {
+ CollectivesWestend::execute_with(|| {
+ type RuntimeEvent = ::RuntimeEvent;
+ type RuntimeCall = ::RuntimeCall;
+ type RuntimeOrigin = ::RuntimeOrigin;
+ type Runtime = ::Runtime;
+ type WestendCall = ::RuntimeCall;
+ type WestendRuntime = ::Runtime;
+
+ let call_hash = [1u8; 32].into();
+
+ let whitelist_call = RuntimeCall::PolkadotXcm(pallet_xcm::Call::::send {
+ dest: bx!(VersionedLocation::from(Location::parent())),
+ message: bx!(VersionedXcm::from(Xcm(vec![
+ UnpaidExecution { weight_limit: Unlimited, check_origin: None },
+ Transact {
+ origin_kind: OriginKind::Xcm,
+ require_weight_at_most: Weight::from_parts(5_000_000_000, 500_000),
+ call: WestendCall::Whitelist(
+ pallet_whitelist::Call::::whitelist_call { call_hash }
+ )
+ .encode()
+ .into(),
+ }
+ ]))),
+ });
+
+ let fellows_origin: RuntimeOrigin = FellowsOrigin.into();
+
+ assert_ok!(whitelist_call.dispatch(fellows_origin));
+
+ assert_expected_events!(
+ CollectivesWestend,
+ vec![
+ RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {},
+ ]
+ );
+ });
+
+ Westend::execute_with(|| {
+ type RuntimeEvent = ::RuntimeEvent;
+
+ assert_expected_events!(
+ Westend,
+ vec![
+ RuntimeEvent::Whitelist(pallet_whitelist::Event::CallWhitelisted { .. }) => {},
+ RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {},
+ ]
+ );
+ });
+}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs
new file mode 100644
index 000000000000..840d2da49463
--- /dev/null
+++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/fellowship_salary.rs
@@ -0,0 +1,66 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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::*;
+use collectives_fellowship::FellowshipSalaryPaymaster;
+use frame_support::{
+ assert_ok,
+ traits::{fungibles::Mutate, tokens::Pay},
+};
+use xcm_executor::traits::ConvertLocation;
+
+const FELLOWSHIP_SALARY_PALLET_ID: u8 = 64;
+
+#[test]
+fn pay_salary() {
+ let asset_id: u32 = 1984;
+ let fellowship_salary = (
+ Parent,
+ Parachain(CollectivesWestend::para_id().into()),
+ PalletInstance(FELLOWSHIP_SALARY_PALLET_ID),
+ );
+ let pay_from =
+ AssetHubLocationToAccountId::convert_location(&fellowship_salary.into()).unwrap();
+ let pay_to = Westend::account_id_of(ALICE);
+ let pay_amount = 9_000_000_000;
+
+ AssetHubWestend::execute_with(|| {
+ type AssetHubAssets = ::Assets;
+ assert_ok!(>::mint_into(asset_id, &pay_from, pay_amount * 2));
+ });
+
+ CollectivesWestend::execute_with(|| {
+ type RuntimeEvent = ::RuntimeEvent;
+
+ assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount));
+ assert_expected_events!(
+ CollectivesWestend,
+ vec![
+ RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
+ ]
+ );
+ });
+
+ AssetHubWestend::execute_with(|| {
+ type RuntimeEvent = ::RuntimeEvent;
+ assert_expected_events!(
+ AssetHubWestend,
+ vec![
+ RuntimeEvent::Assets(pallet_assets::Event::Transferred { .. }) => {},
+ RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {},
+ ]
+ );
+ });
+}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs
index 40e98a8b6869..ef4e4885183d 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend/src/tests/mod.rs
@@ -13,5 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+mod fellowship;
+mod fellowship_salary;
mod fellowship_treasury;
mod teleport;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs
index 3c0533f775e2..06b0b6ba6005 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs
@@ -15,15 +15,8 @@
#[cfg(test)]
mod imports {
- pub use codec::Encode;
-
// Substrate
- pub use frame_support::{
- assert_ok,
- pallet_prelude::Weight,
- sp_runtime::{AccountId32, DispatchResult},
- traits::fungibles::Inspect,
- };
+ pub use frame_support::{assert_ok, sp_runtime::DispatchResult, traits::fungibles::Inspect};
// Polkadot
pub use xcm::prelude::*;
@@ -37,20 +30,14 @@ mod imports {
pub use parachains_common::Balance;
pub use rococo_system_emulated_network::{
people_rococo_emulated_chain::{
- genesis::ED as PEOPLE_ROCOCO_ED,
people_rococo_runtime::{
- people, xcm_config::XcmConfig as PeopleRococoXcmConfig,
- ExistentialDeposit as PeopleRococoExistentialDeposit, Runtime as PeopleRuntime,
+ xcm_config::XcmConfig as PeopleRococoXcmConfig,
+ ExistentialDeposit as PeopleRococoExistentialDeposit,
},
PeopleRococoParaPallet as PeopleRococoPallet,
},
rococo_emulated_chain::{
- genesis::ED as ROCOCO_ED,
- rococo_runtime::{
- xcm_config::XcmConfig as RococoXcmConfig, BasicDeposit, ByteDeposit,
- MaxAdditionalFields, MaxSubAccounts, Runtime as RococoRuntime,
- RuntimeOrigin as RococoOrigin, SubAccountDeposit,
- },
+ genesis::ED as ROCOCO_ED, rococo_runtime::xcm_config::XcmConfig as RococoXcmConfig,
RococoRelayPallet as RococoPallet,
},
PeopleRococoPara as PeopleRococo, PeopleRococoParaReceiver as PeopleRococoReceiver,
@@ -58,7 +45,6 @@ mod imports {
RococoRelayReceiver as RococoReceiver, RococoRelaySender as RococoSender,
};
- pub type RelayToSystemParaTest = Test;
pub type SystemParaToRelayTest = Test;
}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs
index 3f18621224ac..08749b295dc2 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs
@@ -14,5 +14,4 @@
// limitations under the License.
mod claim_assets;
-mod reap_identity;
mod teleport;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/reap_identity.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/reap_identity.rs
deleted file mode 100644
index 10f0c61ed63c..000000000000
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/reap_identity.rs
+++ /dev/null
@@ -1,545 +0,0 @@
-// Copyright (C) Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! # OnReapIdentity Tests
-//!
-//! This file contains the test cases for migrating Identity data away from the Rococo Relay
-//! chain and to the PeopleRococo parachain. This migration is part of the broader Minimal Relay
-//! effort:
-//! https://github.com/polkadot-fellows/RFCs/blob/main/text/0032-minimal-relay.md
-//!
-//! ## Overview
-//!
-//! The tests validate the robustness and correctness of the `OnReapIdentityHandler`
-//! ensuring that it behaves as expected in various scenarios. Key aspects tested include:
-//!
-//! - **Deposit Handling**: Confirming that deposits are correctly migrated from the Relay Chain to
-//! the People parachain in various scenarios (different `IdentityInfo` fields and different
-//! numbers of sub-accounts).
-//!
-//! ### Test Scenarios
-//!
-//! The tests are categorized into several scenarios, each resulting in different deposits required
-//! on the destination parachain. The tests ensure:
-//!
-//! - Reserved deposits on the Relay Chain are fully released;
-//! - The freed deposit from the Relay Chain is sufficient for the parachain deposit; and
-//! - The account will exist on the parachain.
-
-use crate::imports::*;
-use frame_support::BoundedVec;
-use pallet_balances::Event as BalancesEvent;
-use pallet_identity::{legacy::IdentityInfo, Data, Event as IdentityEvent, IdentityOf, SubsOf};
-use people::{
- BasicDeposit as BasicDepositParachain, ByteDeposit as ByteDepositParachain,
- IdentityInfo as IdentityInfoParachain, SubAccountDeposit as SubAccountDepositParachain,
-};
-use rococo_runtime_constants::currency::*;
-use rococo_system_emulated_network::{
- rococo_emulated_chain::RococoRelayPallet, RococoRelay, RococoRelaySender,
-};
-
-type Balance = u128;
-type RococoIdentity = ::Identity;
-type RococoBalances = ::Balances;
-type RococoIdentityMigrator = ::IdentityMigrator;
-type PeopleRococoIdentity = ::Identity;
-type PeopleRococoBalances = ::Balances;
-
-#[derive(Clone, Debug)]
-struct Identity {
- relay: IdentityInfo,
- para: IdentityInfoParachain,
- subs: Subs,
-}
-
-impl Identity {
- fn new(
- full: bool,
- additional: Option>,
- subs: Subs,
- ) -> Self {
- let pgp_fingerprint = [
- 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
- 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC,
- ];
- let make_data = |data: &[u8], full: bool| -> Data {
- if full {
- Data::Raw(data.to_vec().try_into().unwrap())
- } else {
- Data::None
- }
- };
- let (github, discord) = additional
- .as_ref()
- .and_then(|vec| vec.first())
- .map(|(g, d)| (g.clone(), d.clone()))
- .unwrap_or((Data::None, Data::None));
- Self {
- relay: IdentityInfo {
- display: make_data(b"xcm-test", full),
- legal: make_data(b"The Xcm Test, Esq.", full),
- web: make_data(b"https://visitme/", full),
- riot: make_data(b"xcm-riot", full),
- email: make_data(b"xcm-test@gmail.com", full),
- pgp_fingerprint: Some(pgp_fingerprint),
- image: make_data(b"xcm-test.png", full),
- twitter: make_data(b"@xcm-test", full),
- additional: additional.unwrap_or_default(),
- },
- para: IdentityInfoParachain {
- display: make_data(b"xcm-test", full),
- legal: make_data(b"The Xcm Test, Esq.", full),
- web: make_data(b"https://visitme/", full),
- matrix: make_data(b"xcm-matrix@server", full),
- email: make_data(b"xcm-test@gmail.com", full),
- pgp_fingerprint: Some(pgp_fingerprint),
- image: make_data(b"xcm-test.png", full),
- twitter: make_data(b"@xcm-test", full),
- github,
- discord,
- },
- subs,
- }
- }
-}
-
-#[derive(Clone, Debug)]
-enum Subs {
- Zero,
- Many(u32),
-}
-
-enum IdentityOn<'a> {
- Relay(&'a IdentityInfo),
- Para(&'a IdentityInfoParachain),
-}
-
-impl IdentityOn<'_> {
- fn calculate_deposit(self) -> Balance {
- match self {
- IdentityOn::Relay(id) => {
- let base_deposit = BasicDeposit::get();
- let byte_deposit =
- ByteDeposit::get() * TryInto::::try_into(id.encoded_size()).unwrap();
- base_deposit + byte_deposit
- },
- IdentityOn::Para(id) => {
- let base_deposit = BasicDepositParachain::get();
- let byte_deposit = ByteDepositParachain::get() *
- TryInto::::try_into(id.encoded_size()).unwrap();
- base_deposit + byte_deposit
- },
- }
- }
-}
-
-/// Generate an `AccountId32` from a `u32`.
-/// This creates a 32-byte array, initially filled with `255`, and then repeatedly fills it
-/// with the 4-byte little-endian representation of the `u32` value, until the array is full.
-///
-/// **Example**:
-///
-/// `account_from_u32(5)` will return an `AccountId32` with the bytes
-/// `[0, 5, 0, 0, 0, 0, 0, 0, 0, 5 ... ]`
-fn account_from_u32(id: u32) -> AccountId32 {
- let mut buffer = [255u8; 32];
- let id_bytes = id.to_le_bytes();
- let id_size = id_bytes.len();
- for chunk in buffer.chunks_mut(id_size) {
- chunk.clone_from_slice(&id_bytes);
- }
- AccountId32::new(buffer)
-}
-
-// Set up the Relay Chain with an identity.
-fn set_id_relay(id: &Identity) -> Balance {
- let mut total_deposit: Balance = 0;
-
- // Set identity and Subs on Relay Chain
- RococoRelay::execute_with(|| {
- type RuntimeEvent = ::RuntimeEvent;
-
- assert_ok!(RococoIdentity::set_identity(
- RococoOrigin::signed(RococoRelaySender::get()),
- Box::new(id.relay.clone())
- ));
-
- if let Subs::Many(n) = id.subs {
- let subs: Vec<_> = (0..n)
- .map(|i| (account_from_u32(i), Data::Raw(b"name".to_vec().try_into().unwrap())))
- .collect();
-
- assert_ok!(RococoIdentity::set_subs(
- RococoOrigin::signed(RococoRelaySender::get()),
- subs,
- ));
- }
-
- let reserved_balance = RococoBalances::reserved_balance(RococoRelaySender::get());
- let id_deposit = IdentityOn::Relay(&id.relay).calculate_deposit();
-
- let total_deposit = match id.subs {
- Subs::Zero => {
- total_deposit = id_deposit; // No subs
- assert_expected_events!(
- RococoRelay,
- vec![
- RuntimeEvent::Identity(IdentityEvent::IdentitySet { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == RococoRelaySender::get(),
- amount: *amount == id_deposit,
- },
- ]
- );
- total_deposit
- },
- Subs::Many(n) => {
- let sub_account_deposit = n as Balance * SubAccountDeposit::get();
- total_deposit =
- sub_account_deposit + IdentityOn::Relay(&id.relay).calculate_deposit();
- assert_expected_events!(
- RococoRelay,
- vec![
- RuntimeEvent::Identity(IdentityEvent::IdentitySet { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == RococoRelaySender::get(),
- amount: *amount == id_deposit,
- },
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == RococoRelaySender::get(),
- amount: *amount == sub_account_deposit,
- },
- ]
- );
- total_deposit
- },
- };
-
- assert_eq!(reserved_balance, total_deposit);
- });
- total_deposit
-}
-
-// Set up the parachain with an identity and (maybe) sub accounts, but with zero deposits.
-fn assert_set_id_parachain(id: &Identity) {
- // Set identity and Subs on Parachain with zero deposit
- PeopleRococo::execute_with(|| {
- let free_bal = PeopleRococoBalances::free_balance(PeopleRococoSender::get());
- let reserved_balance = PeopleRococoBalances::reserved_balance(PeopleRococoSender::get());
-
- // total balance at Genesis should be zero
- assert_eq!(reserved_balance + free_bal, 0);
-
- assert_ok!(PeopleRococoIdentity::set_identity_no_deposit(
- &PeopleRococoSender::get(),
- id.para.clone(),
- ));
-
- match id.subs {
- Subs::Zero => {},
- Subs::Many(n) => {
- let subs: Vec<_> = (0..n)
- .map(|ii| {
- (account_from_u32(ii), Data::Raw(b"name".to_vec().try_into().unwrap()))
- })
- .collect();
- assert_ok!(PeopleRococoIdentity::set_subs_no_deposit(
- &PeopleRococoSender::get(),
- subs,
- ));
- },
- }
-
- // No amount should be reserved as deposit amounts are set to 0.
- let reserved_balance = PeopleRococoBalances::reserved_balance(PeopleRococoSender::get());
- assert_eq!(reserved_balance, 0);
- assert!(IdentityOf::::get(PeopleRococoSender::get()).is_some());
-
- let (_, sub_accounts) = SubsOf::::get(PeopleRococoSender::get());
-
- match id.subs {
- Subs::Zero => assert_eq!(sub_accounts.len(), 0),
- Subs::Many(n) => assert_eq!(sub_accounts.len(), n as usize),
- }
- });
-}
-
-// Reap the identity on the Relay Chain and assert that the correct things happen there.
-fn assert_reap_id_relay(total_deposit: Balance, id: &Identity) {
- RococoRelay::execute_with(|| {
- type RuntimeEvent = ::RuntimeEvent;
- let free_bal_before_reap = RococoBalances::free_balance(RococoRelaySender::get());
- let reserved_balance = RococoBalances::reserved_balance(RococoRelaySender::get());
-
- assert_eq!(reserved_balance, total_deposit);
-
- assert_ok!(RococoIdentityMigrator::reap_identity(
- RococoOrigin::signed(RococoRelaySender::get()),
- RococoRelaySender::get()
- ));
-
- let remote_deposit = match id.subs {
- Subs::Zero => calculate_remote_deposit(id.relay.encoded_size() as u32, 0),
- Subs::Many(n) => calculate_remote_deposit(id.relay.encoded_size() as u32, n),
- };
-
- assert_expected_events!(
- RococoRelay,
- vec![
- // `reap_identity` sums the identity and subs deposits and unreserves them in one
- // call. Therefore, we only expect one `Unreserved` event.
- RuntimeEvent::Balances(BalancesEvent::Unreserved { who, amount }) => {
- who: *who == RococoRelaySender::get(),
- amount: *amount == total_deposit,
- },
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::IdentityReaped {
- who,
- }) => {
- who: *who == PeopleRococoSender::get(),
- },
- ]
- );
- // Identity should be gone.
- assert!(IdentityOf::::get(RococoRelaySender::get()).is_none());
-
- // Subs should be gone.
- let (_, sub_accounts) = SubsOf::::get(RococoRelaySender::get());
- assert_eq!(sub_accounts.len(), 0);
-
- let reserved_balance = RococoBalances::reserved_balance(RococoRelaySender::get());
- assert_eq!(reserved_balance, 0);
-
- // Free balance should be greater (i.e. the teleport should work even if 100% of an
- // account's balance is reserved for Identity).
- let free_bal_after_reap = RococoBalances::free_balance(RococoRelaySender::get());
- assert!(free_bal_after_reap > free_bal_before_reap);
-
- // Implicit: total_deposit > remote_deposit. As in, accounts should always have enough
- // reserved for the parachain deposit.
- assert_eq!(free_bal_after_reap, free_bal_before_reap + total_deposit - remote_deposit);
- });
-}
-
-// Reaping the identity on the Relay Chain will have sent an XCM program to the parachain. Ensure
-// that everything happens as expected.
-fn assert_reap_parachain(id: &Identity) {
- PeopleRococo::execute_with(|| {
- let reserved_balance = PeopleRococoBalances::reserved_balance(PeopleRococoSender::get());
- let id_deposit = IdentityOn::Para(&id.para).calculate_deposit();
- let total_deposit = match id.subs {
- Subs::Zero => id_deposit,
- Subs::Many(n) => id_deposit + n as Balance * SubAccountDepositParachain::get(),
- };
- assert_reap_events(id_deposit, id);
- assert_eq!(reserved_balance, total_deposit);
-
- // Should have at least one ED after in free balance after the reap.
- assert!(PeopleRococoBalances::free_balance(PeopleRococoSender::get()) >= PEOPLE_ROCOCO_ED);
- });
-}
-
-// Assert the events that should happen on the parachain upon reaping an identity on the Relay
-// Chain.
-fn assert_reap_events(id_deposit: Balance, id: &Identity) {
- type RuntimeEvent = ::RuntimeEvent;
- match id.subs {
- Subs::Zero => {
- assert_expected_events!(
- PeopleRococo,
- vec![
- // Deposit and Endowed from teleport
- RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
- // Amount reserved for identity info
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleRococoSender::get(),
- amount: *amount == id_deposit,
- },
- // Confirmation from Migrator with individual identity and subs deposits
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::DepositUpdated {
- who, identity, subs
- }) => {
- who: *who == PeopleRococoSender::get(),
- identity: *identity == id_deposit,
- subs: *subs == 0,
- },
- RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { .. }) => {},
- ]
- );
- },
- Subs::Many(n) => {
- let subs_deposit = n as Balance * SubAccountDepositParachain::get();
- assert_expected_events!(
- PeopleRococo,
- vec![
- // Deposit and Endowed from teleport
- RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
- // Amount reserved for identity info
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleRococoSender::get(),
- amount: *amount == id_deposit,
- },
- // Amount reserved for subs
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleRococoSender::get(),
- amount: *amount == subs_deposit,
- },
- // Confirmation from Migrator with individual identity and subs deposits
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::DepositUpdated {
- who, identity, subs
- }) => {
- who: *who == PeopleRococoSender::get(),
- identity: *identity == id_deposit,
- subs: *subs == subs_deposit,
- },
- RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { .. }) => {},
- ]
- );
- },
- };
-}
-
-/// Duplicate of the impl of `ToParachainIdentityReaper` in the Rococo runtime.
-fn calculate_remote_deposit(bytes: u32, subs: u32) -> Balance {
- // Note: These `deposit` functions and `EXISTENTIAL_DEPOSIT` correspond to the Relay Chain's.
- // Pulled in: use rococo_runtime_constants::currency::*;
- let para_basic_deposit = deposit(1, 17) / 100;
- let para_byte_deposit = deposit(0, 1) / 100;
- let para_sub_account_deposit = deposit(1, 53) / 100;
- let para_existential_deposit = EXISTENTIAL_DEPOSIT / 10;
-
- // pallet deposits
- let id_deposit =
- para_basic_deposit.saturating_add(para_byte_deposit.saturating_mul(bytes as Balance));
- let subs_deposit = para_sub_account_deposit.saturating_mul(subs as Balance);
-
- id_deposit
- .saturating_add(subs_deposit)
- .saturating_add(para_existential_deposit.saturating_mul(2))
-}
-
-// Represent some `additional` data that would not be migrated to the parachain. The encoded size,
-// and thus the byte deposit, should decrease.
-fn nonsensical_additional() -> BoundedVec<(Data, Data), MaxAdditionalFields> {
- BoundedVec::try_from(vec![(
- Data::Raw(b"fOo".to_vec().try_into().unwrap()),
- Data::Raw(b"baR".to_vec().try_into().unwrap()),
- )])
- .unwrap()
-}
-
-// Represent some `additional` data that will be migrated to the parachain as first-class fields.
-fn meaningful_additional() -> BoundedVec<(Data, Data), MaxAdditionalFields> {
- BoundedVec::try_from(vec![
- (
- Data::Raw(b"github".to_vec().try_into().unwrap()),
- Data::Raw(b"niels-username".to_vec().try_into().unwrap()),
- ),
- (
- Data::Raw(b"discord".to_vec().try_into().unwrap()),
- Data::Raw(b"bohr-username".to_vec().try_into().unwrap()),
- ),
- ])
- .unwrap()
-}
-
-// Execute a single test case.
-fn assert_relay_para_flow(id: &Identity) {
- let total_deposit = set_id_relay(id);
- assert_set_id_parachain(id);
- assert_reap_id_relay(total_deposit, id);
- assert_reap_parachain(id);
-}
-
-// Tests with empty `IdentityInfo`.
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity_with_zero_subs() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity_with_max_subs() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Many(MaxSubAccounts::get())));
-}
-
-// Tests with full `IdentityInfo`.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Many(MaxSubAccounts::get())));
-}
-
-// Tests with full `IdentityInfo` and `additional` fields that will _not_ be migrated.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, Some(nonsensical_additional()), Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional() {
- assert_relay_para_flow(&Identity::new(true, Some(nonsensical_additional()), Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(
- true,
- Some(nonsensical_additional()),
- Subs::Many(MaxSubAccounts::get()),
- ));
-}
-
-// Tests with full `IdentityInfo` and `additional` fields that will be migrated.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, Some(meaningful_additional()), Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional() {
- assert_relay_para_flow(&Identity::new(true, Some(meaningful_additional()), Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(
- true,
- Some(meaningful_additional()),
- Subs::Many(MaxSubAccounts::get()),
- ));
-}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs
index 4410d1bd40dc..44e6b3934f0e 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs
@@ -14,68 +14,38 @@
// limitations under the License.
use crate::imports::*;
+use emulated_integration_tests_common::{
+ test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
+};
-fn relay_origin_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
- Rococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(627_959_000, 7_200)));
+#[test]
+fn teleport_from_and_to_relay() {
+ let amount = ROCOCO_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
- assert_expected_events!(
+ test_relay_is_trusted_teleporter!(
Rococo,
- vec![
- // Amount to teleport is withdrawn from Sender
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == t.sender.account_id,
- amount: *amount == t.args.amount,
- },
- // Amount to teleport is deposited in Relay's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- ]
- );
-}
-
-fn relay_dest_assertions(t: SystemParaToRelayTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Rococo::assert_ump_queue_processed(
- true,
- Some(PeopleRococo::para_id()),
- Some(Weight::from_parts(304_266_000, 7_186)),
+ RococoXcmConfig,
+ vec![PeopleRococo],
+ (native_asset, amount)
);
- assert_expected_events!(
+ test_parachain_is_trusted_teleporter_for_relay!(
+ PeopleRococo,
+ PeopleRococoXcmConfig,
Rococo,
- vec![
- // Amount is withdrawn from Relay Chain's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
+ amount
);
}
fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) {
- Rococo::assert_ump_queue_processed(
- false,
- Some(PeopleRococo::para_id()),
- Some(Weight::from_parts(157_718_000, 3_593)),
- );
+ Rococo::assert_ump_queue_processed(false, Some(PeopleRococo::para_id()), None);
}
fn para_origin_assertions(t: SystemParaToRelayTest) {
type RuntimeEvent = ::RuntimeEvent;
- PeopleRococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(
- 600_000_000,
- 7_000,
- )));
+ PeopleRococo::assert_xcm_pallet_attempted_complete(None);
PeopleRococo::assert_parachain_system_ump_sent();
@@ -91,33 +61,6 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
);
}
-fn para_dest_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- PeopleRococo::assert_dmp_queue_complete(Some(Weight::from_parts(162_456_000, 0)));
-
- assert_expected_events!(
- PeopleRococo,
- vec![
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
-fn relay_limited_teleport_assets(t: RelayToSystemParaTest) -> DispatchResult {
- ::XcmPallet::limited_teleport_assets(
- t.signed_origin,
- bx!(t.args.dest.into()),
- bx!(t.args.beneficiary.into()),
- bx!(t.args.assets.into()),
- t.args.fee_asset_item,
- t.args.weight_limit,
- )
-}
-
fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult {
::PolkadotXcm::limited_teleport_assets(
t.signed_origin,
@@ -129,92 +72,8 @@ fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResu
)
}
-/// Limited Teleport of native asset from Relay Chain to the System Parachain should work
-#[test]
-fn limited_teleport_native_assets_from_relay_to_system_para_works() {
- // Init values for Relay Chain
- let amount_to_send: Balance = ROCOCO_ED * 1000;
- let dest = Rococo::child_location_of(PeopleRococo::para_id());
- let beneficiary_id = PeopleRococoReceiver::get();
- let test_args = TestContext {
- sender: RococoSender::get(),
- receiver: PeopleRococoReceiver::get(),
- args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send),
- };
-
- let mut test = RelayToSystemParaTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(relay_origin_assertions);
- test.set_assertion::(para_dest_assertions);
- test.set_dispatchable::(relay_limited_teleport_assets);
- test.assert();
-
- let delivery_fees = Rococo::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
-}
-
-/// Limited Teleport of native asset from System Parachain to Relay Chain
-/// should work when there is enough balance in Relay Chain's `CheckAccount`
-#[test]
-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();
-
- let amount_to_send: Balance = PEOPLE_ROCOCO_ED * 1000;
- let destination = PeopleRococo::parent_location();
- let beneficiary_id = RococoReceiver::get();
- let assets = (Parent, amount_to_send).into();
-
- // Fund a sender
- PeopleRococo::fund_accounts(vec![(PeopleRococoSender::get(), ROCOCO_ED * 2_000u128)]);
-
- let test_args = TestContext {
- sender: PeopleRococoSender::get(),
- receiver: RococoReceiver::get(),
- args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0),
- };
-
- let mut test = SystemParaToRelayTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(para_origin_assertions);
- test.set_assertion::(relay_dest_assertions);
- test.set_dispatchable::(system_para_limited_teleport_assets);
- test.assert();
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- let delivery_fees = PeopleRococo::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
-}
-
/// 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`
+/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount`
#[test]
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
// Init values for Relay Chain
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/Cargo.toml
index f7e1cce85a2c..aa6eebc5458f 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/Cargo.toml
@@ -15,6 +15,7 @@ frame-support = { workspace = true }
pallet-balances = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-identity = { workspace = true }
+pallet-xcm = { workspace = true }
sp-runtime = { workspace = true }
# Polkadot
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/lib.rs
index 689409fe5040..418cfea07ddc 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/lib.rs
@@ -15,14 +15,8 @@
#[cfg(test)]
mod imports {
- pub use codec::Encode;
// Substrate
- pub use frame_support::{
- assert_ok,
- pallet_prelude::Weight,
- sp_runtime::{AccountId32, DispatchResult},
- traits::fungibles::Inspect,
- };
+ pub use frame_support::{assert_ok, sp_runtime::DispatchResult, traits::fungibles::Inspect};
// Polkadot
pub use xcm::prelude::*;
@@ -37,20 +31,14 @@ mod imports {
pub use westend_system_emulated_network::{
self,
people_westend_emulated_chain::{
- genesis::ED as PEOPLE_WESTEND_ED,
people_westend_runtime::{
- people, xcm_config::XcmConfig as PeopleWestendXcmConfig,
- ExistentialDeposit as PeopleWestendExistentialDeposit, Runtime as PeopleRuntime,
+ xcm_config::XcmConfig as PeopleWestendXcmConfig,
+ ExistentialDeposit as PeopleWestendExistentialDeposit,
},
PeopleWestendParaPallet as PeopleWestendPallet,
},
westend_emulated_chain::{
- genesis::ED as WESTEND_ED,
- westend_runtime::{
- xcm_config::XcmConfig as WestendXcmConfig, BasicDeposit, ByteDeposit,
- MaxAdditionalFields, MaxSubAccounts, Runtime as WestendRuntime,
- RuntimeOrigin as WestendOrigin, SubAccountDeposit,
- },
+ genesis::ED as WESTEND_ED, westend_runtime::xcm_config::XcmConfig as WestendXcmConfig,
WestendRelayPallet as WestendPallet,
},
PeopleWestendPara as PeopleWestend, PeopleWestendParaReceiver as PeopleWestendReceiver,
@@ -58,7 +46,6 @@ mod imports {
WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender,
};
- pub type RelayToSystemParaTest = Test;
pub type SystemParaToRelayTest = Test;
}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/mod.rs
index 3f18621224ac..08749b295dc2 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/mod.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/mod.rs
@@ -14,5 +14,4 @@
// limitations under the License.
mod claim_assets;
-mod reap_identity;
mod teleport;
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/reap_identity.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/reap_identity.rs
deleted file mode 100644
index cfbf4d7d9580..000000000000
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/reap_identity.rs
+++ /dev/null
@@ -1,547 +0,0 @@
-// Copyright (C) Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! # OnReapIdentity Tests
-//!
-//! This file contains the test cases for migrating Identity data away from the Westend Relay
-//! chain and to the PeopleWestend parachain. This migration is part of the broader Minimal Relay
-//! effort:
-//! https://github.com/polkadot-fellows/RFCs/blob/main/text/0032-minimal-relay.md
-//!
-//! ## Overview
-//!
-//! The tests validate the robustness and correctness of the `OnReapIdentityHandler`
-//! ensuring that it behaves as expected in various scenarios. Key aspects tested include:
-//!
-//! - **Deposit Handling**: Confirming that deposits are correctly migrated from the Relay Chain to
-//! the People parachain in various scenarios (different `IdentityInfo` fields and different
-//! numbers of sub-accounts).
-//!
-//! ### Test Scenarios
-//!
-//! The tests are categorized into several scenarios, each resulting in different deposits required
-//! on the destination parachain. The tests ensure:
-//!
-//! - Reserved deposits on the Relay Chain are fully released;
-//! - The freed deposit from the Relay Chain is sufficient for the parachain deposit; and
-//! - The account will exist on the parachain.
-
-use crate::imports::*;
-use frame_support::BoundedVec;
-use pallet_balances::Event as BalancesEvent;
-use pallet_identity::{legacy::IdentityInfo, Data, Event as IdentityEvent, IdentityOf, SubsOf};
-use people::{
- BasicDeposit as BasicDepositParachain, ByteDeposit as ByteDepositParachain,
- IdentityInfo as IdentityInfoParachain, SubAccountDeposit as SubAccountDepositParachain,
-};
-use westend_runtime_constants::currency::*;
-use westend_system_emulated_network::{
- westend_emulated_chain::WestendRelayPallet, WestendRelay, WestendRelaySender,
-};
-
-type Balance = u128;
-type WestendIdentity = ::Identity;
-type WestendBalances = ::Balances;
-type WestendIdentityMigrator = ::IdentityMigrator;
-type PeopleWestendIdentity = ::Identity;
-type PeopleWestendBalances = ::Balances;
-
-#[derive(Clone, Debug)]
-struct Identity {
- relay: IdentityInfo,
- para: IdentityInfoParachain,
- subs: Subs,
-}
-
-impl Identity {
- fn new(
- full: bool,
- additional: Option>,
- subs: Subs,
- ) -> Self {
- let pgp_fingerprint = [
- 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
- 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC,
- ];
- let make_data = |data: &[u8], full: bool| -> Data {
- if full {
- Data::Raw(data.to_vec().try_into().unwrap())
- } else {
- Data::None
- }
- };
- let (github, discord) = additional
- .as_ref()
- .and_then(|vec| vec.first())
- .map(|(g, d)| (g.clone(), d.clone()))
- .unwrap_or((Data::None, Data::None));
- Self {
- relay: IdentityInfo {
- display: make_data(b"xcm-test", full),
- legal: make_data(b"The Xcm Test, Esq.", full),
- web: make_data(b"https://visitme/", full),
- riot: make_data(b"xcm-riot", full),
- email: make_data(b"xcm-test@gmail.com", full),
- pgp_fingerprint: Some(pgp_fingerprint),
- image: make_data(b"xcm-test.png", full),
- twitter: make_data(b"@xcm-test", full),
- additional: additional.unwrap_or_default(),
- },
- para: IdentityInfoParachain {
- display: make_data(b"xcm-test", full),
- legal: make_data(b"The Xcm Test, Esq.", full),
- web: make_data(b"https://visitme/", full),
- matrix: make_data(b"xcm-matrix@server", full),
- email: make_data(b"xcm-test@gmail.com", full),
- pgp_fingerprint: Some(pgp_fingerprint),
- image: make_data(b"xcm-test.png", full),
- twitter: make_data(b"@xcm-test", full),
- github,
- discord,
- },
- subs,
- }
- }
-}
-
-#[derive(Clone, Debug)]
-enum Subs {
- Zero,
- Many(u32),
-}
-
-enum IdentityOn<'a> {
- Relay(&'a IdentityInfo),
- Para(&'a IdentityInfoParachain),
-}
-
-impl IdentityOn<'_> {
- fn calculate_deposit(self) -> Balance {
- match self {
- IdentityOn::Relay(id) => {
- let base_deposit = BasicDeposit::get();
- let byte_deposit =
- ByteDeposit::get() * TryInto::::try_into(id.encoded_size()).unwrap();
- base_deposit + byte_deposit
- },
- IdentityOn::Para(id) => {
- let base_deposit = BasicDepositParachain::get();
- let byte_deposit = ByteDepositParachain::get() *
- TryInto::::try_into(id.encoded_size()).unwrap();
- base_deposit + byte_deposit
- },
- }
- }
-}
-
-/// Generate an `AccountId32` from a `u32`.
-/// This creates a 32-byte array, initially filled with `255`, and then repeatedly fills it
-/// with the 4-byte little-endian representation of the `u32` value, until the array is full.
-///
-/// **Example**:
-///
-/// `account_from_u32(5)` will return an `AccountId32` with the bytes
-/// `[0, 5, 0, 0, 0, 0, 0, 0, 0, 5 ... ]`
-fn account_from_u32(id: u32) -> AccountId32 {
- let mut buffer = [255u8; 32];
- let id_bytes = id.to_le_bytes();
- let id_size = id_bytes.len();
- for chunk in buffer.chunks_mut(id_size) {
- chunk.clone_from_slice(&id_bytes);
- }
- AccountId32::new(buffer)
-}
-
-// Set up the Relay Chain with an identity.
-fn set_id_relay(id: &Identity) -> Balance {
- let mut total_deposit: Balance = 0;
-
- // Set identity and Subs on Relay Chain
- WestendRelay::execute_with(|| {
- type RuntimeEvent = ::RuntimeEvent;
-
- assert_ok!(WestendIdentity::set_identity(
- WestendOrigin::signed(WestendRelaySender::get()),
- Box::new(id.relay.clone())
- ));
-
- if let Subs::Many(n) = id.subs {
- let subs: Vec<_> = (0..n)
- .map(|i| (account_from_u32(i), Data::Raw(b"name".to_vec().try_into().unwrap())))
- .collect();
-
- assert_ok!(WestendIdentity::set_subs(
- WestendOrigin::signed(WestendRelaySender::get()),
- subs,
- ));
- }
-
- let reserved_balance = WestendBalances::reserved_balance(WestendRelaySender::get());
- let id_deposit = IdentityOn::Relay(&id.relay).calculate_deposit();
-
- let total_deposit = match id.subs {
- Subs::Zero => {
- total_deposit = id_deposit; // No subs
- assert_expected_events!(
- WestendRelay,
- vec![
- RuntimeEvent::Identity(IdentityEvent::IdentitySet { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == WestendRelaySender::get(),
- amount: *amount == id_deposit,
- },
- ]
- );
- total_deposit
- },
- Subs::Many(n) => {
- let sub_account_deposit = n as Balance * SubAccountDeposit::get();
- total_deposit =
- sub_account_deposit + IdentityOn::Relay(&id.relay).calculate_deposit();
- assert_expected_events!(
- WestendRelay,
- vec![
- RuntimeEvent::Identity(IdentityEvent::IdentitySet { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == WestendRelaySender::get(),
- amount: *amount == id_deposit,
- },
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == WestendRelaySender::get(),
- amount: *amount == sub_account_deposit,
- },
- ]
- );
- total_deposit
- },
- };
-
- assert_eq!(reserved_balance, total_deposit);
- });
- total_deposit
-}
-
-// Set up the parachain with an identity and (maybe) sub accounts, but with zero deposits.
-fn assert_set_id_parachain(id: &Identity) {
- // Set identity and Subs on Parachain with zero deposit
- PeopleWestend::execute_with(|| {
- let free_bal = PeopleWestendBalances::free_balance(PeopleWestendSender::get());
- let reserved_balance = PeopleWestendBalances::reserved_balance(PeopleWestendSender::get());
-
- // total balance at Genesis should be zero
- assert_eq!(reserved_balance + free_bal, 0);
-
- assert_ok!(PeopleWestendIdentity::set_identity_no_deposit(
- &PeopleWestendSender::get(),
- id.para.clone(),
- ));
-
- match id.subs {
- Subs::Zero => {},
- Subs::Many(n) => {
- let subs: Vec<_> = (0..n)
- .map(|ii| {
- (account_from_u32(ii), Data::Raw(b"name".to_vec().try_into().unwrap()))
- })
- .collect();
- assert_ok!(PeopleWestendIdentity::set_subs_no_deposit(
- &PeopleWestendSender::get(),
- subs,
- ));
- },
- }
-
- // No amount should be reserved as deposit amounts are set to 0.
- let reserved_balance = PeopleWestendBalances::reserved_balance(PeopleWestendSender::get());
- assert_eq!(reserved_balance, 0);
- assert!(IdentityOf::::get(PeopleWestendSender::get()).is_some());
-
- let (_, sub_accounts) = SubsOf::::get(PeopleWestendSender::get());
-
- match id.subs {
- Subs::Zero => assert_eq!(sub_accounts.len(), 0),
- Subs::Many(n) => assert_eq!(sub_accounts.len(), n as usize),
- }
- });
-}
-
-// Reap the identity on the Relay Chain and assert that the correct things happen there.
-fn assert_reap_id_relay(total_deposit: Balance, id: &Identity) {
- WestendRelay::execute_with(|| {
- type RuntimeEvent = ::RuntimeEvent;
- let free_bal_before_reap = WestendBalances::free_balance(WestendRelaySender::get());
- let reserved_balance = WestendBalances::reserved_balance(WestendRelaySender::get());
-
- assert_eq!(reserved_balance, total_deposit);
-
- assert_ok!(WestendIdentityMigrator::reap_identity(
- WestendOrigin::signed(WestendRelaySender::get()),
- WestendRelaySender::get()
- ));
-
- let remote_deposit = match id.subs {
- Subs::Zero => calculate_remote_deposit(id.relay.encoded_size() as u32, 0),
- Subs::Many(n) => calculate_remote_deposit(id.relay.encoded_size() as u32, n),
- };
-
- assert_expected_events!(
- WestendRelay,
- vec![
- // `reap_identity` sums the identity and subs deposits and unreserves them in one
- // call. Therefore, we only expect one `Unreserved` event.
- RuntimeEvent::Balances(BalancesEvent::Unreserved { who, amount }) => {
- who: *who == WestendRelaySender::get(),
- amount: *amount == total_deposit,
- },
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::IdentityReaped {
- who,
- }) => {
- who: *who == PeopleWestendSender::get(),
- },
- ]
- );
- // Identity should be gone.
- assert!(IdentityOf::::get(WestendRelaySender::get()).is_none());
-
- // Subs should be gone.
- let (_, sub_accounts) = SubsOf::::get(WestendRelaySender::get());
- assert_eq!(sub_accounts.len(), 0);
-
- let reserved_balance = WestendBalances::reserved_balance(WestendRelaySender::get());
- assert_eq!(reserved_balance, 0);
-
- // Free balance should be greater (i.e. the teleport should work even if 100% of an
- // account's balance is reserved for Identity).
- let free_bal_after_reap = WestendBalances::free_balance(WestendRelaySender::get());
- assert!(free_bal_after_reap > free_bal_before_reap);
-
- // Implicit: total_deposit > remote_deposit. As in, accounts should always have enough
- // reserved for the parachain deposit.
- assert_eq!(free_bal_after_reap, free_bal_before_reap + total_deposit - remote_deposit);
- });
-}
-
-// Reaping the identity on the Relay Chain will have sent an XCM program to the parachain. Ensure
-// that everything happens as expected.
-fn assert_reap_parachain(id: &Identity) {
- PeopleWestend::execute_with(|| {
- let reserved_balance = PeopleWestendBalances::reserved_balance(PeopleWestendSender::get());
- let id_deposit = IdentityOn::Para(&id.para).calculate_deposit();
- let total_deposit = match id.subs {
- Subs::Zero => id_deposit,
- Subs::Many(n) => id_deposit + n as Balance * SubAccountDepositParachain::get(),
- };
- assert_reap_events(id_deposit, id);
- assert_eq!(reserved_balance, total_deposit);
-
- // Should have at least one ED after in free balance after the reap.
- assert!(
- PeopleWestendBalances::free_balance(PeopleWestendSender::get()) >= PEOPLE_WESTEND_ED
- );
- });
-}
-
-// Assert the events that should happen on the parachain upon reaping an identity on the Relay
-// Chain.
-fn assert_reap_events(id_deposit: Balance, id: &Identity) {
- type RuntimeEvent = ::RuntimeEvent;
- match id.subs {
- Subs::Zero => {
- assert_expected_events!(
- PeopleWestend,
- vec![
- // Deposit and Endowed from teleport
- RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
- // Amount reserved for identity info
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleWestendSender::get(),
- amount: *amount == id_deposit,
- },
- // Confirmation from Migrator with individual identity and subs deposits
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::DepositUpdated {
- who, identity, subs
- }) => {
- who: *who == PeopleWestendSender::get(),
- identity: *identity == id_deposit,
- subs: *subs == 0,
- },
- RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { .. }) => {},
- ]
- );
- },
- Subs::Many(n) => {
- let subs_deposit = n as Balance * SubAccountDepositParachain::get();
- assert_expected_events!(
- PeopleWestend,
- vec![
- // Deposit and Endowed from teleport
- RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
- RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
- // Amount reserved for identity info
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleWestendSender::get(),
- amount: *amount == id_deposit,
- },
- // Amount reserved for subs
- RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
- who: *who == PeopleWestendSender::get(),
- amount: *amount == subs_deposit,
- },
- // Confirmation from Migrator with individual identity and subs deposits
- RuntimeEvent::IdentityMigrator(
- polkadot_runtime_common::identity_migrator::Event::DepositUpdated {
- who, identity, subs
- }) => {
- who: *who == PeopleWestendSender::get(),
- identity: *identity == id_deposit,
- subs: *subs == subs_deposit,
- },
- RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { .. }) => {},
- ]
- );
- },
- };
-}
-
-/// Duplicate of the impl of `ToParachainIdentityReaper` in the Westend runtime.
-fn calculate_remote_deposit(bytes: u32, subs: u32) -> Balance {
- // Note: These `deposit` functions and `EXISTENTIAL_DEPOSIT` correspond to the Relay Chain's.
- // Pulled in: use westend_runtime_constants::currency::*;
- let para_basic_deposit = deposit(1, 17) / 100;
- let para_byte_deposit = deposit(0, 1) / 100;
- let para_sub_account_deposit = deposit(1, 53) / 100;
- let para_existential_deposit = EXISTENTIAL_DEPOSIT / 10;
-
- // pallet deposits
- let id_deposit =
- para_basic_deposit.saturating_add(para_byte_deposit.saturating_mul(bytes as Balance));
- let subs_deposit = para_sub_account_deposit.saturating_mul(subs as Balance);
-
- id_deposit
- .saturating_add(subs_deposit)
- .saturating_add(para_existential_deposit.saturating_mul(2))
-}
-
-// Represent some `additional` data that would not be migrated to the parachain. The encoded size,
-// and thus the byte deposit, should decrease.
-fn nonsensical_additional() -> BoundedVec<(Data, Data), MaxAdditionalFields> {
- BoundedVec::try_from(vec![(
- Data::Raw(b"fOo".to_vec().try_into().unwrap()),
- Data::Raw(b"baR".to_vec().try_into().unwrap()),
- )])
- .unwrap()
-}
-
-// Represent some `additional` data that will be migrated to the parachain as first-class fields.
-fn meaningful_additional() -> BoundedVec<(Data, Data), MaxAdditionalFields> {
- BoundedVec::try_from(vec![
- (
- Data::Raw(b"github".to_vec().try_into().unwrap()),
- Data::Raw(b"niels-username".to_vec().try_into().unwrap()),
- ),
- (
- Data::Raw(b"discord".to_vec().try_into().unwrap()),
- Data::Raw(b"bohr-username".to_vec().try_into().unwrap()),
- ),
- ])
- .unwrap()
-}
-
-// Execute a single test case.
-fn assert_relay_para_flow(id: &Identity) {
- let total_deposit = set_id_relay(id);
- assert_set_id_parachain(id);
- assert_reap_id_relay(total_deposit, id);
- assert_reap_parachain(id);
-}
-
-// Tests with empty `IdentityInfo`.
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity_with_zero_subs() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_minimal_identity_with_max_subs() {
- assert_relay_para_flow(&Identity::new(false, None, Subs::Many(MaxSubAccounts::get())));
-}
-
-// Tests with full `IdentityInfo`.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_no_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(true, None, Subs::Many(MaxSubAccounts::get())));
-}
-
-// Tests with full `IdentityInfo` and `additional` fields that will _not_ be migrated.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, Some(nonsensical_additional()), Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional() {
- assert_relay_para_flow(&Identity::new(true, Some(nonsensical_additional()), Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_nonsense_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(
- true,
- Some(nonsensical_additional()),
- Subs::Many(MaxSubAccounts::get()),
- ));
-}
-
-// Tests with full `IdentityInfo` and `additional` fields that will be migrated.
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional_zero_subs() {
- assert_relay_para_flow(&Identity::new(true, Some(meaningful_additional()), Subs::Zero));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional() {
- assert_relay_para_flow(&Identity::new(true, Some(meaningful_additional()), Subs::Many(1)));
-}
-
-#[test]
-fn on_reap_identity_works_for_full_identity_meaningful_additional_max_subs() {
- assert_relay_para_flow(&Identity::new(
- true,
- Some(meaningful_additional()),
- Subs::Many(MaxSubAccounts::get()),
- ));
-}
diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/teleport.rs
index 6fd3cdeb61fb..83888031723f 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/teleport.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/people/people-westend/src/tests/teleport.rs
@@ -14,68 +14,38 @@
// limitations under the License.
use crate::imports::*;
+use emulated_integration_tests_common::{
+ test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
+};
-fn relay_origin_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
- Westend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(627_959_000, 7_200)));
+#[test]
+fn teleport_from_and_to_relay() {
+ let amount = WESTEND_ED * 100;
+ let native_asset: Assets = (Here, amount).into();
- assert_expected_events!(
+ test_relay_is_trusted_teleporter!(
Westend,
- vec![
- // Amount to teleport is withdrawn from Sender
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == t.sender.account_id,
- amount: *amount == t.args.amount,
- },
- // Amount to teleport is deposited in Relay's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- ]
- );
-}
-
-fn relay_dest_assertions(t: SystemParaToRelayTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- Westend::assert_ump_queue_processed(
- true,
- Some(PeopleWestend::para_id()),
- Some(Weight::from_parts(304_266_000, 7_186)),
+ WestendXcmConfig,
+ vec![PeopleWestend],
+ (native_asset, amount)
);
- assert_expected_events!(
+ test_parachain_is_trusted_teleporter_for_relay!(
+ PeopleWestend,
+ PeopleWestendXcmConfig,
Westend,
- vec![
- // Amount is withdrawn from Relay Chain's `CheckAccount`
- RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
- who: *who == ::XcmPallet::check_account(),
- amount: *amount == t.args.amount,
- },
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
+ amount
);
}
fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) {
- Westend::assert_ump_queue_processed(
- false,
- Some(PeopleWestend::para_id()),
- Some(Weight::from_parts(157_718_000, 3_593)),
- );
+ Westend::assert_ump_queue_processed(false, Some(PeopleWestend::para_id()), None);
}
fn para_origin_assertions(t: SystemParaToRelayTest) {
type RuntimeEvent = ::RuntimeEvent;
- PeopleWestend::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(
- 351_425_000,
- 3_593,
- )));
+ PeopleWestend::assert_xcm_pallet_attempted_complete(None);
PeopleWestend::assert_parachain_system_ump_sent();
@@ -91,33 +61,6 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
);
}
-fn para_dest_assertions(t: RelayToSystemParaTest) {
- type RuntimeEvent = ::RuntimeEvent;
-
- PeopleWestend::assert_dmp_queue_complete(Some(Weight::from_parts(162_456_000, 0)));
-
- assert_expected_events!(
- PeopleWestend,
- vec![
- // Amount minus fees are deposited in Receiver's account
- RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
- who: *who == t.receiver.account_id,
- },
- ]
- );
-}
-
-fn relay_limited_teleport_assets(t: RelayToSystemParaTest) -> DispatchResult {
- ::XcmPallet::limited_teleport_assets(
- t.signed_origin,
- bx!(t.args.dest.into()),
- bx!(t.args.beneficiary.into()),
- bx!(t.args.assets.into()),
- t.args.fee_asset_item,
- t.args.weight_limit,
- )
-}
-
fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult {
::PolkadotXcm::limited_teleport_assets(
t.signed_origin,
@@ -129,92 +72,8 @@ fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResu
)
}
-/// Limited Teleport of native asset from Relay Chain to the System Parachain should work
-#[test]
-fn limited_teleport_native_assets_from_relay_to_system_para_works() {
- // Init values for Relay Chain
- let amount_to_send: Balance = WESTEND_ED * 1000;
- let dest = Westend::child_location_of(PeopleWestend::para_id());
- let beneficiary_id = PeopleWestendReceiver::get();
- let test_args = TestContext {
- sender: WestendSender::get(),
- receiver: PeopleWestendReceiver::get(),
- args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send),
- };
-
- let mut test = RelayToSystemParaTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(relay_origin_assertions);
- test.set_assertion::(para_dest_assertions);
- test.set_dispatchable::(relay_limited_teleport_assets);
- test.assert();
-
- let delivery_fees = Westend::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
-}
-
-/// Limited Teleport of native asset from System Parachain to Relay Chain
-/// should work when there is enough balance in Relay Chain's `CheckAccount`
-#[test]
-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();
-
- let amount_to_send: Balance = PEOPLE_WESTEND_ED * 1000;
- let destination = PeopleWestend::parent_location();
- let beneficiary_id = WestendReceiver::get();
- let assets = (Parent, amount_to_send).into();
-
- // Fund a sender
- PeopleWestend::fund_accounts(vec![(PeopleWestendSender::get(), WESTEND_ED * 2_000u128)]);
-
- let test_args = TestContext {
- sender: PeopleWestendSender::get(),
- receiver: WestendReceiver::get(),
- args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0),
- };
-
- let mut test = SystemParaToRelayTest::new(test_args);
-
- let sender_balance_before = test.sender.balance;
- let receiver_balance_before = test.receiver.balance;
-
- test.set_assertion::(para_origin_assertions);
- test.set_assertion::(relay_dest_assertions);
- test.set_dispatchable::(system_para_limited_teleport_assets);
- test.assert();
-
- let sender_balance_after = test.sender.balance;
- let receiver_balance_after = test.receiver.balance;
-
- let delivery_fees = PeopleWestend::execute_with(|| {
- xcm_helpers::teleport_assets_delivery_fees::<
- ::XcmSender,
- >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
- });
-
- // Sender's balance is reduced
- assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
- // Receiver's balance is increased
- assert!(receiver_balance_after > receiver_balance_before);
-}
-
/// 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`
+/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount`
#[test]
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
// Init values for Relay Chain
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
index 7414adacc448..4c7356707ab6 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
@@ -83,10 +83,13 @@ use sp_runtime::{Perbill, RuntimeDebug};
use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*};
use xcm_config::{
ForeignAssetsConvertedConcreteId, ForeignCreatorsSovereignAccountOf, GovernanceLocation,
- PoolAssetsConvertedConcreteId, TokenLocation, TokenLocationV3,
- TrustBackedAssetsConvertedConcreteId, TrustBackedAssetsPalletLocationV3,
+ PoolAssetsConvertedConcreteId, TokenLocation, TrustBackedAssetsConvertedConcreteId,
+ TrustBackedAssetsPalletLocation,
};
+#[cfg(test)]
+mod tests;
+
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
@@ -324,11 +327,11 @@ pub type LocalAndForeignAssets = fungibles::UnionOf<
Assets,
ForeignAssets,
LocalFromLeft<
- AssetIdForTrustBackedAssetsConvert,
+ AssetIdForTrustBackedAssetsConvert,
AssetIdForTrustBackedAssets,
- xcm::v3::Location,
+ xcm::v4::Location,
>,
- xcm::v3::Location,
+ xcm::v4::Location,
AccountId,
>;
@@ -336,25 +339,25 @@ pub type LocalAndForeignAssets = fungibles::UnionOf<
pub type NativeAndAssets = fungible::UnionOf<
Balances,
LocalAndForeignAssets,
- TargetFromLeft,
- xcm::v3::Location,
+ TargetFromLeft,
+ xcm::v4::Location,
AccountId,
>;
pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter<
AssetConversionPalletId,
- (xcm::v3::Location, xcm::v3::Location),
+ (xcm::v4::Location, xcm::v4::Location),
>;
impl pallet_asset_conversion::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type HigherPrecisionBalance = sp_core::U256;
- type AssetKind = xcm::v3::Location;
+ type AssetKind = xcm::v4::Location;
type Assets = NativeAndAssets;
type PoolId = (Self::AssetKind, Self::AssetKind);
type PoolLocator = pallet_asset_conversion::WithFirstAsset<
- TokenLocationV3,
+ TokenLocation,
AccountId,
Self::AssetKind,
PoolIdToAccountId,
@@ -362,7 +365,7 @@ impl pallet_asset_conversion::Config for Runtime {
type PoolAssetId = u32;
type PoolAssets = PoolAssets;
type PoolSetupFee = ConstU128<0>; // Asset class deposit fees are sufficient to prevent spam
- type PoolSetupFeeAsset = TokenLocationV3;
+ type PoolSetupFeeAsset = TokenLocation;
type PoolSetupFeeTarget = ResolveAssetTo;
type LiquidityWithdrawalFee = LiquidityWithdrawalFee;
type LPFee = ConstU32<3>;
@@ -372,10 +375,10 @@ impl pallet_asset_conversion::Config for Runtime {
type WeightInfo = weights::pallet_asset_conversion::WeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = assets_common::benchmarks::AssetPairFactory<
- TokenLocationV3,
+ TokenLocation,
parachain_info::Pallet,
xcm_config::TrustBackedAssetsPalletIndex,
- xcm::v3::Location,
+ xcm::v4::Location,
>;
}
@@ -409,17 +412,17 @@ pub type ForeignAssetsInstance = pallet_assets::Instance2;
impl pallet_assets::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
- type AssetId = xcm::v3::Location;
- type AssetIdParameter = xcm::v3::Location;
+ type AssetId = xcm::v4::Location;
+ type AssetIdParameter = xcm::v4::Location;
type Currency = Balances;
type CreateOrigin = ForeignCreators<
(
- FromSiblingParachain, xcm::v3::Location>,
- FromNetwork,
+ FromSiblingParachain