Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/foreign assets as thin proxy #1024

Merged
merged 65 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c652c1e
refactor: draft foreign assets as proxy to collections
mrshiposha Oct 17, 2023
5bde44b
feat: draft xcm deposit_asset
mrshiposha Oct 17, 2023
e2da42b
feat: xcm nft support
mrshiposha Oct 18, 2023
11758e7
doc: foreign assets
mrshiposha Oct 18, 2023
fd75004
fix: forbid foreign collection duplication
mrshiposha Oct 18, 2023
68fcead
chore: foreign-assets docs and minor improvements
mrshiposha Oct 18, 2023
383b7ef
refactor: remove redundant foreign flag, use foreign-assets pallet in…
mrshiposha Oct 18, 2023
a07e655
refactor: create collection with optional payer
mrshiposha Oct 18, 2023
1524c99
chore: fix kb
mrshiposha Oct 18, 2023
cfd2e2a
fix: reserved field 0 in collection helpers
mrshiposha Oct 18, 2023
9c50a8c
fix: benchmarks
mrshiposha Oct 18, 2023
dbb52bb
fix: use feature gate for foreign-assets gov
mrshiposha Oct 18, 2023
e4369d0
fix: tests around foreign flag
mrshiposha Oct 18, 2023
799ca39
fix: pallet-presence test
mrshiposha Oct 18, 2023
907025f
Revert "fix: tests around foreign flag"
mrshiposha Oct 19, 2023
f566769
Revert "fix: reserved field 0 in collection helpers"
mrshiposha Oct 19, 2023
56fde60
Revert "chore: fix kb"
mrshiposha Oct 19, 2023
1eed41e
fix: restore foreign flag, minor fixes
mrshiposha Oct 19, 2023
a8213d4
fix: remove tokens from unique chain-spec
mrshiposha Oct 23, 2023
05427f7
fix: rfts are unsupported in XCM
mrshiposha Oct 23, 2023
cafc907
fix: XCM tests
mrshiposha Oct 23, 2023
9c3e59a
fix: clippy
mrshiposha Oct 24, 2023
49aa961
fix: clippy - box MultiLocation
mrshiposha Oct 24, 2023
25bd186
fix: clippy - box Multilocation in benchmarks
mrshiposha Oct 24, 2023
28f2c75
fix: cargo fmt
mrshiposha Oct 24, 2023
4ccd45a
fix: CurrencyIdConvert
mrshiposha Oct 24, 2023
f92a07b
fix: moonbeam/moonriver XCM tests
mrshiposha Oct 24, 2023
30ec3c7
fix: rename create_raw to avoid misunderstanding
mrshiposha Oct 25, 2023
3356493
fix: combine init_collection fns
mrshiposha Oct 25, 2023
9cc291b
fix: unit test
mrshiposha Oct 25, 2023
0e38a03
fix: dispatch docs
mrshiposha Oct 25, 2023
68c3995
fix: check token children in XCM extensions
mrshiposha Oct 25, 2023
0fae602
fix: foreign-assets related docs
mrshiposha Oct 25, 2023
4eaa889
test: xcm nft with karura
mrshiposha Oct 27, 2023
63d711f
fix hash
PraetorP Oct 27, 2023
2c3d5fc
fix: native_asset_location_to_collection
mrshiposha Oct 30, 2023
a768a41
fix: asset_to_collection
mrshiposha Oct 31, 2023
0fb6e3f
fix: use the term local instead of native in local_asset_location_to_…
mrshiposha Oct 31, 2023
2840b3d
feat: tokenId -> reserve asset instance mapping
mrshiposha Nov 1, 2023
b708529
refactor: use collection-locality
mrshiposha Nov 1, 2023
0880691
fix: remove orml tokens dep
mrshiposha Nov 7, 2023
332bbaa
fix: use AssetId in the mapping
mrshiposha Nov 7, 2023
ccee89d
chore: remove XCM NFT basic test
mrshiposha Nov 10, 2023
799f8bc
chore: add xnft workflow
mrshiposha Nov 10, 2023
3bbc02d
fix: cargo fmt
mrshiposha Nov 10, 2023
cbe9757
chore: update Cargo.lock after removing orml-tokens
mrshiposha Nov 10, 2023
3fb701d
fix: xnft workflow - bdk start
mrshiposha Nov 10, 2023
ada7374
fix: use rococo in xnft tests
mrshiposha Nov 10, 2023
465abfc
fix: xnft tests report
mrshiposha Nov 10, 2023
4cc2248
fix: add xnft to master CI
mrshiposha Nov 13, 2023
b9bb94b
fix: use all-quartz test in xnft workflow
mrshiposha Nov 13, 2023
046e9b6
fix: xnft rewrites
mrshiposha Nov 13, 2023
05c886f
fix: take parents:0 multilocations into account
mrshiposha Nov 16, 2023
b76251d
refactor: local_asset_id_to_collection
mrshiposha Nov 16, 2023
c16a17a
chore: rebase develop
mrshiposha Nov 22, 2023
74b1ef4
fix: xcm tests
mrshiposha Nov 23, 2023
b4d745d
fix: blake2 for asset-instance
mrshiposha Nov 24, 2023
9d0fd83
fix: use CollectionIssuer enum for collection creation
mrshiposha Nov 24, 2023
644dfbe
fix: correct xcm executor errors, remove use of props
mrshiposha Nov 24, 2023
b0dfc97
doc: why transactional is needed in XCM extensions
mrshiposha Nov 24, 2023
c01d30b
fix: use versioned asset ID in force_register_foreign_asset
mrshiposha Nov 27, 2023
0f77c10
fix: benchmarks
mrshiposha Nov 27, 2023
871c90f
chore: add note about non-existing NFT in XCM asset-instance convert
mrshiposha Nov 28, 2023
cf0465d
fix: point KARURA_BUILD_BRANCH to xnft-poc
mrshiposha Nov 28, 2023
d561386
doc: more info about asset-instance to token id conv
mrshiposha Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ POLKADEX_BUILD_BRANCH=v1.1.0

KUSAMA_MAINNET_BRANCH=release-v1.0.0
STATEMINE_BUILD_BRANCH=release-parachains-v9430
KARURA_BUILD_BRANCH=release-karura-2.21.0
KARURA_BUILD_BRANCH=xnft-poc
MOONRIVER_BUILD_BRANCH=runtime-2500
SHIDEN_BUILD_BRANCH=v5.18.0
QUARTZ_MAINNET_BRANCH=release-v10010063
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-xcm')
uses: ./.github/workflows/xcm.yml
secrets: inherit

xnft:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-xnft')
uses: ./.github/workflows/xnft.yml
secrets: inherit

collator-selection:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-collator-selection')
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
xcm:
uses: ./.github/workflows/xcm.yml
secrets: inherit # pass all secrets from initial workflow to nested

xnft:
uses: ./.github/workflows/xnft.yml
secrets: inherit # pass all secrets from initial workflow to nested

collator-selection:
uses: ./.github/workflows/collator-selection.yml
Expand Down
215 changes: 215 additions & 0 deletions .github/workflows/xnft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
name: xnft-testnet

# Controls when the action will run.
on:
workflow_call:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

#Define Workflow variables
env:
REPO_URL: ${{ github.server_url }}/${{ github.repository }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
prepare-execution-marix:
name: Prepare execution matrix

runs-on: [self-hosted-ci]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}

steps:
- name: Clean Workspace
uses: AutoModality/[email protected]

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }} #Checking out head commit

- name: Read .env file
uses: xom9ikk/dotenv@v2

- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, runtest {all-quartz}, runtime_features {quartz-runtime}
xnft:
needs: prepare-execution-marix
# The type of runner that the job will run on
runs-on: [XL]

timeout-minutes: 600

name: ${{ matrix.network }}

continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.

strategy:
matrix:
include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}

steps:
- name: Skip if pull request is in Draft
if: github.event.pull_request.draft == true
run: exit 1

- name: Clean Workspace
uses: AutoModality/[email protected]

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }} #Checking out head commit

# Prepare SHA
- name: Prepare SHA
uses: ./.github/actions/prepare

- name: Read .env file
uses: xom9ikk/dotenv@v2

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}

# Check POLKADOT version and build it if it doesn't exist in repository
- name: Generate ENV related extend Dockerfile file for POLKADOT
uses: cuchi/[email protected]
with:
template: .docker/Dockerfile-polkadot.j2
output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
variables: |
RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
- name: Check if the dockerhub repository contains the needed version POLKADOT
run: |
# aquire token
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
export TOKEN=$TOKEN
# Get TAGS from DOCKERHUB POLKADOT repository
POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
# Show TAGS
echo "POLKADOT TAGS:"
echo $POLKADOT_TAGS
# Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.relay_branch }}"($|[[:space:]]) ]]; then
echo "Repository has needed POLKADOT version";
docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
else
echo "Repository has not needed POLKADOT version, so build it";
cd .docker/ && docker build --file ./Dockerfile-polkadot.${{ matrix.relay_branch }}.yml --tag uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} .
echo "Push needed POLKADOT version to the repository";
docker push uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
fi
shell: bash

# Check ACALA version and build it if it doesn't exist in repository
- name: Generate ENV related extend Dockerfile file for ACALA
uses: cuchi/[email protected]
with:
template: .docker/Dockerfile-acala.j2
output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
variables: |
RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
- name: Check if the dockerhub repository contains the needed ACALA version
run: |
# aquire token
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
export TOKEN=$TOKEN
# Get TAGS from DOCKERHUB repository
ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
# Show TAGS
echo "ACALA TAGS:"
echo $ACALA_TAGS
# Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
echo "Repository has needed ACALA version";
docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
else
echo "Repository has not needed ACALA version, so build it";
cd .docker/ && docker build --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
echo "Push needed ACALA version to the repository";
docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
fi
shell: bash

- name: Build unique-chain
run: |
docker build --file .docker/Dockerfile-unique \
--build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \
--build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \
--tag uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \
.
- name: Push docker image version
run: docker push uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}

- uses: actions/[email protected]
with:
node-version: 18

- name: Clone xnft-tests
run: git clone https://github.com/UniqueNetwork/xnft-tests.git

- name: Install baedeker
uses: UniqueNetwork/baedeker-action/setup@built

- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library

- name: Start network
uses: UniqueNetwork/baedeker-action@built
id: bdk
with:
jpath: |
.baedeker/vendor
tla-str: |
relay_spec=rococo-local
inputs: |
xnft-tests/.baedeker/testnets.jsonnet
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}})
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/quartz':{dockerImage:'uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}})
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/karura':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}})
- name: Yarn install
working-directory: xnft-tests
run: |
yarn install
yarn add mochawesome
- name: Run XNFT Tests
working-directory: xnft-tests
run: |
NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
- name: XNFT Tests Report
uses: phoenix-actions/test-reporting@v10
id: test-report
if: success() || failure()
with:
name: XNFT Tests ${{ matrix.network }}
path: xnft-tests/mochawesome-report/test-*.json
reporter: mochawesome-json
fail-on-error: 'false'

- name: Clean Workspace
if: always()
uses: AutoModality/[email protected]

- name: Remove builder cache
if: always()
run: |
docker system prune -a -f
Loading
Loading