difftreelog
Merge branch 'develop' into tests/generalization
in: master
107 files changed
.docker/Dockerfile-collatorsdiffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-collators
@@ -0,0 +1,74 @@
+ARG POLKADOT_BUILD_BRANCH
+FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot
+
+# ===== Rust builder =====
+FROM uniquenetwork/services:latest as rust-builder
+ARG RUST_TOOLCHAIN=
+
+ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install $RUST_TOOLCHAIN && \
+ rustup default $RUST_TOOLCHAIN && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD ======
+FROM rust-builder as builder-unique
+
+ARG PROFILE=release
+ARG NETWORK
+ARG POLKADOT_LAUNCH_BRANCH
+ARG BRANCH
+
+ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH
+
+WORKDIR /unique_parachain
+
+RUN git clone -b $BRANCH https://github.com/UniqueNetwork/unique-chain.git && \
+ cd unique-chain && \
+ cargo build --features=$NETWORK-runtime --$PROFILE
+
+# ===== RUN ======
+
+FROM ubuntu:20.04
+
+RUN apt-get -y update && \
+ apt-get -y install curl git && \
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
+ export NVM_DIR="$HOME/.nvm" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ nvm install v16.16.0 && \
+ nvm use v16.16.0
+
+RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH}
+
+RUN export NVM_DIR="$HOME/.nvm" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ cd /polkadot-launch && \
+ npm install --global yarn && \
+ yarn install
+
+COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.json /polkadot-launch/launch-config.json
+COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/
+
+COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
+
+EXPOSE 9844
+EXPOSE 9944
+EXPOSE 9933
+EXPOSE 9833
+EXPOSE 40333
+EXPOSE 30333
+
+CMD export NVM_DIR="$HOME/.nvm" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ cd /polkadot-launch && \
+ yarn start launch-config.json
.docker/Dockerfile-parachaindiffbeforeafterboth--- a/.docker/Dockerfile-parachain
+++ b/.docker/Dockerfile-parachain
@@ -32,7 +32,7 @@
WORKDIR /unique_parachain
-RUN git clone $REPO_URL -b $BRANCH . && \
+RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b $BRANCH . && \
cargo build --features=${NETWORK}-runtime --$PROFILE
# ===== RUN ======
.docker/docker-compose.tmp-collators.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/docker-compose.tmp-collators.j2
@@ -0,0 +1,25 @@
+version: "3.5"
+
+services:
+ parachain-collators:
+ build:
+ args:
+ - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"
+ - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}"
+ - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}"
+ - "NETWORK={{ NETWORK }}"
+ - "BRANCH={{ BRANCH }}"
+ context: ../
+ dockerfile: .docker/Dockerfile-parachain
+ image: parachain-collators
+ container_name: parachain-collators
+ expose:
+ - 9944
+ - 9933
+ ports:
+ - 127.0.0.1:9944:9944
+ - 127.0.0.1:9933:9933
+ logging:
+ options:
+ max-size: "1m"
+ max-file: "3"
.docker/testnet-config/launch-config.jsondiffbeforeafterboth--- a/.docker/testnet-config/launch-config.json
+++ b/.docker/testnet-config/launch-config.json
@@ -111,6 +111,42 @@
"--unsafe-ws-external",
"-lxcm=trace"
]
+ },
+ {
+ "port": 31202,
+ "wsPort": 9946,
+ "rpcPort": 9935,
+ "name": "charlie",
+ "flags": [
+ "--rpc-cors=all",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lxcm=trace"
+ ]
+ },
+ {
+ "port": 31203,
+ "wsPort": 9947,
+ "rpcPort": 9936,
+ "name": "dave",
+ "flags": [
+ "--rpc-cors=all",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lxcm=trace"
+ ]
+ },
+ {
+ "port": 31204,
+ "wsPort": 9948,
+ "rpcPort": 9937,
+ "name": "eve",
+ "flags": [
+ "--rpc-cors=all",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lxcm=trace"
+ ]
}
]
}
.github/workflows/ci-develop.ymldiffbeforeafterboth--- a/.github/workflows/ci-develop.yml
+++ b/.github/workflows/ci-develop.yml
@@ -34,6 +34,10 @@
uses: ./.github/workflows/xcm.yml
secrets: inherit # pass all secrets from initial workflow to nested
+ collator-selection:
+ if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-collator-selection')) }} # Conditional check for draft & labels per job.
+ uses: ./.github/workflows/collator-selection.yml
+
forkless:
if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job.
uses: ./.github/workflows/forkless.yml
.github/workflows/ci-master.ymldiffbeforeafterboth--- a/.github/workflows/ci-master.yml
+++ b/.github/workflows/ci-master.yml
@@ -35,6 +35,9 @@
xcm:
uses: ./.github/workflows/xcm.yml
secrets: inherit # pass all secrets from initial workflow to nested
+
+ collator-selection:
+ uses: ./.github/workflows/collator-selection.yml
# testnet:
# uses: ./.github/workflows/testnet-build.yml
.github/workflows/collator-selection.ymldiffbeforeafterboth--- /dev/null
+++ b/.github/workflows/collator-selection.yml
@@ -0,0 +1,165 @@
+name: collator-selection-test-run
+
+# Triger: only call from main workflow(re-usable workflows)
+on:
+ workflow_call:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ execution-marix:
+ name: Prepare execution matrix
+
+ runs-on: self-hosted-ci
+ outputs:
+ matrix: ${{ steps.create_matrix.outputs.matrix }}
+
+ steps:
+
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ 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@v3
+ id: create_matrix
+ with:
+ matrix: |
+ network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
+ network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
+ network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}
+
+ collator-selection:
+ needs: execution-marix
+ # The type of runner that the job will run on
+ runs-on: [self-hosted-ci,large]
+ timeout-minutes: 1380
+
+ name: ${{ matrix.network }}
+ strategy:
+ matrix:
+ include: ${{fromJson(needs.execution-marix.outputs.matrix)}}
+
+ 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.
+
+ steps:
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.head_ref }} #Checking out head commit
+
+ - name: Read .env file
+ uses: xom9ikk/dotenv@v2
+
+ - name: Generate ENV related extend file for docker-compose
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/docker-compose.tmp-collators.j2
+ output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+ POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
+ NETWORK=${{ matrix.network }}
+ BRANCH=${{ github.head_ref }}
+
+ - name: Show build configuration
+ run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml
+
+ - name: Show launch-config configuration
+ run: cat launch-config.json
+
+ - name: Build the stack
+ run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
+
+ # 🚀 POLKADOT LAUNCH COMPLETE 🚀
+ - name: Check if docker logs consist messages related to testing of collator tests
+ if: success()
+ run: |
+ counter=160
+ function check_container_status {
+ docker inspect -f {{.State.Running}} parachain-collators
+ }
+ function do_docker_logs {
+ docker logs --details parachain-collators 2>&1
+ }
+ function is_started {
+ if [ "$(check_container_status)" == "true" ]; then
+ echo "Container: collator-${{ matrix.network }}-testnet-local RUNNING";
+ echo "Check Docker logs"
+ DOCKER_LOGS=$(do_docker_logs)
+ if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
+ echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
+ return 0
+ else
+ echo "Message not found in logs output, repeating..."
+ return 1
+ fi
+ else
+ echo "Container collator-${{ matrix.network }}-testnet-local NOT RUNNING"
+ echo "Halting all future checks"
+ exit 1
+ fi
+ echo "something goes wrong"
+ exit 1
+ }
+ while ! is_started; do
+ echo "Waiting for special message in log files "
+ sleep 30s
+ counter=$(( $counter - 1 ))
+ echo "Counter: $counter"
+ if [ "$counter" -gt "0" ]; then
+ continue
+ else
+ break
+ fi
+ done
+ echo "Halting script"
+ exit 0
+ shell: bash
+
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Run Collator tests
+ working-directory: tests
+ if: success() || failure()
+ run: |
+ yarn install
+ yarn add mochawesome
+ node scripts/readyness.js
+ echo "Ready to start tests"
+ yarn polkadot-types
+ NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}
+ env:
+ RPC_URL: http://127.0.0.1:9933/
+
+ - name: Test Report Collator
+ uses: phoenix-actions/test-reporting@v8
+ id: test-report-collator
+ if: success() || failure() # run this step even if previous step failed
+ with:
+ name: Report Collator tests results - ${{ matrix.network }} # Name of the check run which will be created
+ path: tests/mochawesome-report/test-collators-*.json # Path to test results
+ reporter: mochawesome-json
+ fail-on-error: 'false'
+
+ - name: Stop running containers
+ if: always() # run this step always
+ run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" down
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker builder prune -f -a
+ docker system prune -f
.rustfmt.tomldiffbeforeafterboth--- a/.rustfmt.toml
+++ b/.rustfmt.toml
@@ -1,2 +1,2 @@
hard_tabs = true
-reorder_imports = false
\ No newline at end of file
+reorder_imports = false
.taplo.tomldiffbeforeafterboth--- /dev/null
+++ b/.taplo.toml
@@ -0,0 +1,9 @@
+[formatting]
+array_auto_collapse = true
+array_auto_expand = true
+array_trailing_comma = true
+column_width = 120
+indent_string = "\t"
+reorder_arrays = true
+reorder_keys = true
+trailing_newline = true
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -125,14 +125,11 @@
name = "app-promotion-rpc"
version = "0.1.0"
dependencies = [
- "pallet-common",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
- "sp-core",
"sp-runtime",
"sp-std",
- "up-data-structs",
]
[[package]]
@@ -319,9 +316,9 @@
[[package]]
name = "async-trait"
-version = "0.1.60"
+version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"
+checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282"
dependencies = [
"proc-macro2",
"quote",
@@ -343,9 +340,9 @@
[[package]]
name = "atomic-waker"
-version = "1.0.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
+checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599"
[[package]]
name = "atty"
@@ -360,9 +357,9 @@
[[package]]
name = "auto_impl"
-version = "0.5.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4"
+checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33"
dependencies = [
"proc-macro-error",
"proc-macro2",
@@ -387,7 +384,7 @@
"cfg-if",
"libc",
"miniz_oxide",
- "object 0.30.0",
+ "object 0.30.2",
"rustc-demangle",
]
@@ -416,6 +413,12 @@
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
+name = "base64"
+version = "0.21.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
+
+[[package]]
name = "base64ct"
version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -438,10 +441,10 @@
"array-bytes 4.2.0",
"async-trait",
"fnv",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-chain-spec",
"sc-client-api",
@@ -473,10 +476,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"beefy-gadget",
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-rpc",
"sc-utils",
@@ -533,26 +536,14 @@
[[package]]
name = "bitvec"
-version = "0.20.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848"
-dependencies = [
- "funty 1.1.0",
- "radium 0.6.2",
- "tap",
- "wyz 0.2.0",
-]
-
-[[package]]
-name = "bitvec"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
dependencies = [
- "funty 2.0.0",
- "radium 0.7.0",
+ "funty",
+ "radium",
"tap",
- "wyz 0.5.1",
+ "wyz",
]
[[package]]
@@ -700,6 +691,16 @@
]
[[package]]
+name = "bstr"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b"
+dependencies = [
+ "memchr",
+ "serde",
+]
+
+[[package]]
name = "build-helper"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -710,9 +711,9 @@
[[package]]
name = "bumpalo"
-version = "3.11.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
+checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
[[package]]
name = "byte-slice-cast"
@@ -751,9 +752,9 @@
[[package]]
name = "camino"
-version = "1.1.1"
+version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e"
+checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055"
dependencies = [
"serde",
]
@@ -903,9 +904,9 @@
[[package]]
name = "clap"
-version = "4.0.32"
+version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39"
+checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"
dependencies = [
"bitflags",
"clap_derive",
@@ -918,9 +919,9 @@
[[package]]
name = "clap_derive"
-version = "4.0.21"
+version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
+checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"
dependencies = [
"heck",
"proc-macro-error",
@@ -931,9 +932,9 @@
[[package]]
name = "clap_lex"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
+checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade"
dependencies = [
"os_str_bytes",
]
@@ -962,9 +963,9 @@
[[package]]
name = "comfy-table"
-version = "6.1.3"
+version = "6.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e621e7e86c46fd8a14c32c6ae3cb95656621b4743a27d0cffedb831d46e7ad21"
+checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d"
dependencies = [
"strum",
"strum_macros",
@@ -973,24 +974,23 @@
[[package]]
name = "concurrent-queue"
-version = "2.0.0"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b"
+checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "console"
-version = "0.15.2"
+version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c"
+checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60"
dependencies = [
"encode_unicode",
"lazy_static",
"libc",
- "terminal_size",
- "winapi",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1303,7 +1303,7 @@
source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#afe528af891f464b318293f183f6d3eefbc979b0"
dependencies = [
"clap",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-chain-spec",
"sc-cli",
"sc-service",
@@ -1320,8 +1320,8 @@
"cumulus-client-consensus-common",
"cumulus-client-network",
"cumulus-primitives-core",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -1343,8 +1343,8 @@
"async-trait",
"cumulus-client-consensus-common",
"cumulus-primitives-core",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"sc-client-api",
"sc-consensus",
"sc-consensus-aura",
@@ -1374,9 +1374,9 @@
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
"dyn-clone",
- "futures 0.3.25",
+ "futures",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"sc-client-api",
"sc-consensus",
@@ -1394,9 +1394,9 @@
dependencies = [
"async-trait",
"cumulus-relay-chain-interface",
- "futures 0.3.25",
+ "futures",
"futures-timer",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"polkadot-node-primitives",
"polkadot-parachain",
@@ -1417,9 +1417,9 @@
dependencies = [
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
- "futures 0.3.25",
+ "futures",
"futures-timer",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-overseer",
@@ -1446,7 +1446,7 @@
"cumulus-relay-chain-inprocess-interface",
"cumulus-relay-chain-interface",
"cumulus-relay-chain-minimal-node",
- "futures 0.3.25",
+ "futures",
"parking_lot 0.12.1",
"polkadot-primitives",
"sc-client-api",
@@ -1469,7 +1469,7 @@
"frame-support",
"frame-system",
"pallet-aura",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-consensus-aura",
@@ -1486,7 +1486,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -1508,7 +1508,7 @@
"frame-system",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"scale-info",
"sp-core",
@@ -1541,7 +1541,7 @@
"cumulus-primitives-core",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -1558,7 +1558,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand_chacha 0.3.1",
"scale-info",
"sp-runtime",
@@ -1572,7 +1572,7 @@
version = "0.1.0"
source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#afe528af891f464b318293f183f6d3eefbc979b0"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain",
"polkadot-primitives",
@@ -1591,7 +1591,7 @@
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
"cumulus-test-relay-sproof-builder",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"scale-info",
"sp-api",
@@ -1611,8 +1611,8 @@
source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#afe528af891f464b318293f183f6d3eefbc979b0"
dependencies = [
"cumulus-primitives-core",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"sp-inherents",
"sp-std",
"sp-timestamp",
@@ -1626,7 +1626,7 @@
"cumulus-primitives-core",
"frame-support",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-runtime",
"sp-std",
"xcm",
@@ -1642,7 +1642,7 @@
"async-trait",
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"polkadot-cli",
"polkadot-client",
@@ -1666,9 +1666,9 @@
dependencies = [
"async-trait",
"cumulus-primitives-core",
- "futures 0.3.25",
+ "futures",
"jsonrpsee-core",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-overseer",
"polkadot-service",
"sc-client-api",
@@ -1689,7 +1689,7 @@
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
"cumulus-relay-chain-rpc-interface",
- "futures 0.3.25",
+ "futures",
"lru",
"polkadot-core-primitives",
"polkadot-network-bridge",
@@ -1727,11 +1727,11 @@
"async-trait",
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"jsonrpsee",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-service",
"sc-client-api",
"sc-rpc-api",
@@ -1754,7 +1754,7 @@
source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#afe528af891f464b318293f183f6d3eefbc979b0"
dependencies = [
"cumulus-primitives-core",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"sp-runtime",
"sp-state-machine",
@@ -1803,9 +1803,9 @@
[[package]]
name = "cxx"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd"
+checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579"
dependencies = [
"cc",
"cxxbridge-flags",
@@ -1815,9 +1815,9 @@
[[package]]
name = "cxx-build"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0"
+checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70"
dependencies = [
"cc",
"codespan-reporting",
@@ -1830,15 +1830,15 @@
[[package]]
name = "cxxbridge-flags"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59"
+checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c"
[[package]]
name = "cxxbridge-macro"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6"
+checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5"
dependencies = [
"proc-macro2",
"quote",
@@ -2050,9 +2050,9 @@
[[package]]
name = "ed25519"
-version = "1.5.2"
+version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369"
+checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
dependencies = [
"signature",
]
@@ -2173,6 +2173,19 @@
]
[[package]]
+name = "env_logger"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
+dependencies = [
+ "humantime",
+ "is-terminal",
+ "log",
+ "regex",
+ "termcolor",
+]
+
+[[package]]
name = "environmental"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2254,7 +2267,7 @@
"ethereum-types 0.14.1",
"hash-db",
"hash256-std-hasher",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rlp",
"scale-info",
"serde",
@@ -2301,8 +2314,8 @@
[[package]]
name = "evm"
-version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+version = "0.37.0"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#e543965fa325885fc61ebf6ec47565b8ab686afd"
dependencies = [
"auto_impl",
"environmental",
@@ -2311,7 +2324,7 @@
"evm-gasometer",
"evm-runtime",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"primitive-types 0.12.1",
"rlp",
"scale-info",
@@ -2333,7 +2346,6 @@
"primitive-types 0.12.1",
"sha3-const",
"similar-asserts",
- "sp-std",
"trybuild",
]
@@ -2351,10 +2363,10 @@
[[package]]
name = "evm-core"
-version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+version = "0.37.0"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#e543965fa325885fc61ebf6ec47565b8ab686afd"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"primitive-types 0.12.1",
"scale-info",
"serde",
@@ -2362,8 +2374,8 @@
[[package]]
name = "evm-gasometer"
-version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+version = "0.37.0"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#e543965fa325885fc61ebf6ec47565b8ab686afd"
dependencies = [
"environmental",
"evm-core",
@@ -2373,8 +2385,8 @@
[[package]]
name = "evm-runtime"
-version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+version = "0.37.0"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#e543965fa325885fc61ebf6ec47565b8ab686afd"
dependencies = [
"auto_impl",
"environmental",
@@ -2389,7 +2401,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5"
dependencies = [
- "futures 0.3.25",
+ "futures",
]
[[package]]
@@ -2491,7 +2503,7 @@
"kvdb-rocksdb",
"log",
"parity-db",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-db",
"smallvec",
@@ -2509,7 +2521,7 @@
"fc-db",
"fp-consensus",
"fp-rpc",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
"sc-client-api",
@@ -2532,13 +2544,13 @@
"fp-evm",
"fp-rpc",
"fp-storage",
- "futures 0.3.25",
+ "futures",
"hex",
"jsonrpsee",
"libsecp256k1",
"log",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"prometheus",
"rand 0.8.5",
"rlp",
@@ -2602,11 +2614,11 @@
[[package]]
name = "file-per-thread-logger"
-version = "0.1.5"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f"
+checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866"
dependencies = [
- "env_logger",
+ "env_logger 0.10.0",
"log",
]
@@ -2624,16 +2636,16 @@
[[package]]
name = "finality-grandpa"
-version = "0.16.0"
+version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5"
+checksum = "e24e6c429951433ccb7c87fd528c60084834dcd14763182c1f83291bcde24c34"
dependencies = [
"either",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
"num-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"scale-info",
]
@@ -2679,22 +2691,6 @@
]
[[package]]
-name = "flexi_logger"
-version = "0.24.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ade8e86c48285f138a4d6ca15a2912e39bd6c74d62db42da4f1985f651a0b057"
-dependencies = [
- "atty",
- "chrono",
- "glob",
- "lazy_static",
- "log",
- "nu-ansi-term",
- "regex",
- "thiserror",
-]
-
-[[package]]
name = "float-cmp"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2714,7 +2710,7 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
]
[[package]]
@@ -2732,7 +2728,7 @@
source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#ef8d2809ed05da0664e9b43cb87436451295b634"
dependencies = [
"ethereum 0.14.0",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-core",
"sp-runtime",
"sp-std",
@@ -2748,7 +2744,7 @@
"fp-evm",
"frame-support",
"num_enum",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-core",
"sp-std",
]
@@ -2761,7 +2757,7 @@
"evm",
"frame-support",
"impl-trait-for-tuples",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"serde",
"sp-core",
"sp-std",
@@ -2784,7 +2780,7 @@
"ethereum 0.14.0",
"ethereum-types 0.14.1",
"fp-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-api",
"sp-core",
@@ -2800,7 +2796,7 @@
dependencies = [
"ethereum 0.14.0",
"frame-support",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-runtime",
@@ -2811,7 +2807,7 @@
version = "2.0.0"
source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#ef8d2809ed05da0664e9b43cb87436451295b634"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"serde",
]
@@ -2830,7 +2826,7 @@
"frame-system",
"linregress",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"paste",
"scale-info",
"serde",
@@ -2866,7 +2862,7 @@
"linked-hash-map",
"log",
"memory-db",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand 0.8.5",
"rand_pcg 0.3.1",
"sc-block-builder",
@@ -2915,7 +2911,7 @@
"frame-election-provider-solution-type",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -2932,7 +2928,7 @@
"frame-support",
"frame-system",
"frame-try-runtime",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -2948,7 +2944,7 @@
checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d"
dependencies = [
"cfg-if",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
]
@@ -2958,10 +2954,10 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "env_logger",
- "futures 0.3.25",
+ "env_logger 0.9.3",
+ "futures",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"serde",
"serde_json",
"sp-core",
@@ -2984,7 +2980,7 @@
"k256",
"log",
"once_cell",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"paste",
"scale-info",
"serde",
@@ -3047,7 +3043,7 @@
dependencies = [
"frame-support",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -3066,7 +3062,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
@@ -3078,7 +3074,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
]
@@ -3088,7 +3084,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-runtime",
"sp-std",
@@ -3115,12 +3111,6 @@
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-
-[[package]]
-name = "funty"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
[[package]]
name = "funty"
@@ -3130,12 +3120,6 @@
[[package]]
name = "futures"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678"
-
-[[package]]
-name = "futures"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0"
@@ -3244,7 +3228,6 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6"
dependencies = [
- "futures 0.1.31",
"futures-channel",
"futures-core",
"futures-io",
@@ -3348,18 +3331,18 @@
[[package]]
name = "glob"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "globset"
-version = "0.4.9"
+version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a"
+checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
dependencies = [
"aho-corasick",
- "bstr",
+ "bstr 1.1.0",
"fnv",
"log",
"regex",
@@ -3681,7 +3664,7 @@
"async-io",
"core-foundation",
"fnv",
- "futures 0.3.25",
+ "futures",
"if-addrs",
"ipnet",
"log",
@@ -3696,7 +3679,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
]
[[package]]
@@ -3771,9 +3754,9 @@
[[package]]
name = "io-lifetimes"
-version = "1.0.3"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
+checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e"
dependencies = [
"libc",
"windows-sys 0.42.0",
@@ -3799,9 +3782,9 @@
[[package]]
name = "ipnet"
-version = "2.7.0"
+version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
+checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
[[package]]
name = "is-terminal"
@@ -3810,8 +3793,8 @@
checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
dependencies = [
"hermit-abi 0.2.6",
- "io-lifetimes 1.0.3",
- "rustix 0.36.5",
+ "io-lifetimes 1.0.4",
+ "rustix 0.36.7",
"windows-sys 0.42.0",
]
@@ -3998,7 +3981,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -4056,7 +4039,7 @@
"pallet-whitelist",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"polkadot-runtime-common",
"polkadot-runtime-parachains",
@@ -4193,7 +4176,7 @@
checksum = "ec878fda12ebec479186b3914ebc48ff180fa4c51847e11a1a68bf65249e02c1"
dependencies = [
"bytes",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"getrandom 0.2.8",
"instant",
@@ -4231,7 +4214,7 @@
"ed25519-dalek",
"either",
"fnv",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"instant",
"lazy_static",
@@ -4259,7 +4242,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720"
dependencies = [
- "futures 0.3.25",
+ "futures",
"libp2p-core",
"log",
"parking_lot 0.12.1",
@@ -4274,7 +4257,7 @@
checksum = "dcf9a121f699e8719bda2e6e9e9b6ddafc6cff4602471d6481c1067930ccb29b"
dependencies = [
"asynchronous-codec",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"libp2p-core",
"libp2p-swarm",
@@ -4299,7 +4282,7 @@
"bytes",
"either",
"fnv",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"instant",
"libp2p-core",
@@ -4324,7 +4307,7 @@
dependencies = [
"data-encoding",
"dns-parser",
- "futures 0.3.25",
+ "futures",
"if-watch",
"libp2p-core",
"libp2p-swarm",
@@ -4358,7 +4341,7 @@
dependencies = [
"asynchronous-codec",
"bytes",
- "futures 0.3.25",
+ "futures",
"libp2p-core",
"log",
"nohash-hasher",
@@ -4376,7 +4359,7 @@
dependencies = [
"bytes",
"curve25519-dalek 3.2.0",
- "futures 0.3.25",
+ "futures",
"lazy_static",
"libp2p-core",
"log",
@@ -4396,7 +4379,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7228b9318d34689521349a86eb39a3c3a802c9efc99a0568062ffb80913e3f91"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"instant",
"libp2p-core",
@@ -4414,7 +4397,7 @@
dependencies = [
"async-trait",
"bytes",
- "futures 0.3.25",
+ "futures",
"instant",
"libp2p-core",
"libp2p-swarm",
@@ -4432,7 +4415,7 @@
dependencies = [
"either",
"fnv",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"instant",
"libp2p-core",
@@ -4461,7 +4444,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"if-watch",
"libc",
@@ -4477,7 +4460,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a17b5b8e7a73e379e47b1b77f8a82c4721e97eca01abcd18e9cd91a23ca6ce97"
dependencies = [
- "futures 0.3.25",
+ "futures",
"js-sys",
"libp2p-core",
"parity-send-wrapper",
@@ -4492,7 +4475,7 @@
checksum = "3758ae6f89b2531a24b6d9f5776bda6a626b60a57600d7185d43dfa75ca5ecc4"
dependencies = [
"either",
- "futures 0.3.25",
+ "futures",
"futures-rustls",
"libp2p-core",
"log",
@@ -4510,7 +4493,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d6874d66543c4f7e26e3b8ca9a6bead351563a13ab4fafd43c7927f7c0d6c12"
dependencies = [
- "futures 0.3.25",
+ "futures",
"libp2p-core",
"log",
"parking_lot 0.12.1",
@@ -4540,7 +4523,7 @@
checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1"
dependencies = [
"arrayref",
- "base64",
+ "base64 0.13.1",
"digest 0.9.0",
"hmac-drbg",
"libsecp256k1-core",
@@ -4757,7 +4740,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb"
dependencies = [
- "rustix 0.36.5",
+ "rustix 0.36.7",
]
[[package]]
@@ -4821,7 +4804,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532"
dependencies = [
- "futures 0.3.25",
+ "futures",
"rand 0.8.5",
"thrift",
]
@@ -4858,9 +4841,9 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-offchain",
"sp-api",
@@ -4880,7 +4863,7 @@
dependencies = [
"anyhow",
"jsonrpsee",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"serde",
"sp-api",
"sp-blockchain",
@@ -4989,7 +4972,7 @@
checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a"
dependencies = [
"bytes",
- "futures 0.3.25",
+ "futures",
"log",
"pin-project",
"smallvec",
@@ -5085,7 +5068,7 @@
checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6"
dependencies = [
"bytes",
- "futures 0.3.25",
+ "futures",
"log",
"netlink-packet-core",
"netlink-sys",
@@ -5101,7 +5084,7 @@
dependencies = [
"async-io",
"bytes",
- "futures 0.3.25",
+ "futures",
"libc",
"log",
]
@@ -5125,9 +5108,9 @@
[[package]]
name = "nom"
-version = "7.1.1"
+version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
@@ -5138,16 +5121,6 @@
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
-
-[[package]]
-name = "nu-ansi-term"
-version = "0.46.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
-dependencies = [
- "overload",
- "winapi",
-]
[[package]]
name = "num-bigint"
@@ -5256,18 +5229,18 @@
[[package]]
name = "object"
-version = "0.30.0"
+version = "0.30.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb"
+checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83"
dependencies = [
"memchr",
]
[[package]]
name = "once_cell"
-version = "1.16.0"
+version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
+checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
[[package]]
name = "opal-runtime"
@@ -5342,7 +5315,7 @@
"pallet-unique-scheduler-v2",
"pallet-xcm",
"parachain-info",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"precompile-utils-macro",
"rmrk-rpc",
@@ -5399,7 +5372,7 @@
dependencies = [
"async-trait",
"dyn-clonable",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"orchestra-proc-macro",
"pin-project",
@@ -5440,7 +5413,7 @@
"frame-support",
"frame-system",
"orml-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-runtime",
@@ -5456,7 +5429,7 @@
"impl-trait-for-tuples",
"num-traits",
"orml-utilities",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-io",
@@ -5471,7 +5444,7 @@
source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-io",
@@ -5486,7 +5459,7 @@
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-io",
@@ -5501,7 +5474,7 @@
dependencies = [
"frame-support",
"orml-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-runtime",
"sp-std",
"xcm",
@@ -5519,7 +5492,7 @@
"orml-traits",
"orml-xcm-support",
"pallet-xcm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-io",
@@ -5536,12 +5509,6 @@
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
[[package]]
-name = "overload"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
-
-[[package]]
name = "packed_simd_2"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5564,14 +5531,10 @@
"pallet-evm",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
- "pallet-randomness-collective-flip",
- "pallet-timestamp",
"pallet-unique",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
- "serde",
"sp-core",
- "sp-io",
"sp-runtime",
"sp-std",
"up-data-structs",
@@ -5585,7 +5548,7 @@
"frame-support",
"frame-system",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-consensus-aura",
@@ -5601,7 +5564,7 @@
"frame-support",
"frame-system",
"pallet-session",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-authority-discovery",
@@ -5617,7 +5580,7 @@
"frame-support",
"frame-system",
"impl-trait-for-tuples",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-authorship",
"sp-runtime",
@@ -5636,7 +5599,7 @@
"pallet-authorship",
"pallet-session",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-consensus-babe",
@@ -5659,7 +5622,7 @@
"frame-system",
"log",
"pallet-balances",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -5677,7 +5640,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
@@ -5691,7 +5654,7 @@
"fp-evm",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -5706,7 +5669,7 @@
"frame-support",
"frame-system",
"pallet-session",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-beefy",
@@ -5727,7 +5690,7 @@
"pallet-beefy",
"pallet-mmr",
"pallet-session",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-beefy",
@@ -5747,7 +5710,7 @@
"frame-system",
"log",
"pallet-treasury",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -5766,7 +5729,7 @@
"log",
"pallet-bounties",
"pallet-treasury",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -5788,7 +5751,7 @@
"pallet-configuration",
"pallet-session",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand 0.8.5",
"scale-info",
"serde",
@@ -5810,7 +5773,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -5824,15 +5787,13 @@
dependencies = [
"ethereum 0.14.0",
"evm-coder",
- "fp-evm-mapping",
"frame-benchmarking",
"frame-support",
"frame-system",
"pallet-evm",
"pallet-evm-coder-substrate",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
- "serde",
"sp-core",
"sp-runtime",
"sp-std",
@@ -5848,12 +5809,11 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"smallvec",
"sp-arithmetic",
"sp-core",
- "sp-runtime",
"sp-std",
"xcm",
]
@@ -5867,7 +5827,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-io",
@@ -5884,7 +5844,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -5904,7 +5864,7 @@
"frame-system",
"log",
"pallet-election-provider-support-benchmarking",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand 0.7.3",
"scale-info",
"sp-arithmetic",
@@ -5925,7 +5885,7 @@
"frame-benchmarking",
"frame-election-provider-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-npos-elections",
"sp-runtime",
]
@@ -5939,7 +5899,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -5967,7 +5927,7 @@
"frame-system",
"pallet-evm",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rlp",
"scale-info",
"serde",
@@ -5992,7 +5952,7 @@
"impl-trait-for-tuples",
"log",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"primitive-types 0.12.1",
"rlp",
"scale-info",
@@ -6007,14 +5967,12 @@
name = "pallet-evm-coder-substrate"
version = "0.1.3"
dependencies = [
- "ethereum 0.14.0",
"evm-coder",
"frame-benchmarking",
"frame-support",
"frame-system",
- "pallet-ethereum",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-std",
@@ -6025,20 +5983,16 @@
name = "pallet-evm-contract-helpers"
version = "0.3.0"
dependencies = [
- "ethereum 0.14.0",
"evm-coder",
- "fp-evm-mapping",
"frame-support",
"frame-system",
- "log",
"pallet-common",
"pallet-evm",
"pallet-evm-coder-substrate",
"pallet-evm-transaction-payment",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
- "sp-runtime",
"sp-std",
"up-data-structs",
"up-sponsorship",
@@ -6049,16 +6003,13 @@
version = "0.1.1"
dependencies = [
"ethereum 0.14.0",
- "fp-evm",
"frame-benchmarking",
"frame-support",
"frame-system",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
- "sp-io",
- "sp-runtime",
"sp-std",
]
@@ -6077,15 +6028,12 @@
version = "0.1.1"
dependencies = [
"fp-evm",
- "fp-evm-mapping",
"frame-support",
"frame-system",
- "pallet-ethereum",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
- "sp-io",
"sp-runtime",
"sp-std",
"up-sponsorship",
@@ -6101,7 +6049,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6123,7 +6071,7 @@
"pallet-common",
"pallet-fungible",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"serde_json",
@@ -6133,7 +6081,6 @@
"sp-std",
"up-data-structs",
"xcm",
- "xcm-builder",
"xcm-executor",
]
@@ -6141,7 +6088,6 @@
name = "pallet-fungible"
version = "0.1.9"
dependencies = [
- "ethereum 0.14.0",
"evm-coder",
"frame-benchmarking",
"frame-support",
@@ -6150,7 +6096,7 @@
"pallet-evm",
"pallet-evm-coder-substrate",
"pallet-structure",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
@@ -6169,7 +6115,7 @@
"log",
"pallet-authorship",
"pallet-session",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-core",
@@ -6190,7 +6136,7 @@
"frame-support",
"frame-system",
"pallet-balances",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6207,7 +6153,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6224,7 +6170,7 @@
"frame-system",
"log",
"pallet-authorship",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-core",
@@ -6242,7 +6188,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6259,11 +6205,8 @@
"frame-support",
"frame-system",
"pallet-balances",
- "pallet-randomness-collective-flip",
- "pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
- "serde",
"sp-core",
"sp-io",
"sp-runtime",
@@ -6277,7 +6220,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-std",
]
@@ -6291,7 +6234,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6307,7 +6250,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6325,7 +6268,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6340,7 +6283,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -6356,7 +6299,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6377,7 +6320,7 @@
"pallet-bags-list",
"pallet-nomination-pools",
"pallet-staking",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-runtime-interface",
@@ -6390,7 +6333,7 @@
version = "1.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-std",
]
@@ -6399,7 +6342,6 @@
name = "pallet-nonfungible"
version = "0.1.12"
dependencies = [
- "ethereum 0.14.0",
"evm-coder",
"frame-benchmarking",
"frame-support",
@@ -6408,7 +6350,7 @@
"pallet-evm",
"pallet-evm-coder-substrate",
"pallet-structure",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
@@ -6426,7 +6368,7 @@
"frame-system",
"log",
"pallet-balances",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-runtime",
@@ -6450,7 +6392,7 @@
"pallet-offences",
"pallet-session",
"pallet-staking",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-staking",
@@ -6466,7 +6408,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6482,7 +6424,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6496,7 +6438,7 @@
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"safe-mix",
"scale-info",
"sp-runtime",
@@ -6512,7 +6454,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -6529,7 +6471,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6546,7 +6488,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-arithmetic",
@@ -6559,8 +6501,6 @@
name = "pallet-refungible"
version = "0.2.11"
dependencies = [
- "derivative",
- "ethereum 0.14.0",
"evm-coder",
"frame-benchmarking",
"frame-support",
@@ -6569,12 +6509,11 @@
"pallet-evm",
"pallet-evm-coder-substrate",
"pallet-structure",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
"sp-std",
- "struct-versioning",
"up-data-structs",
]
@@ -6582,7 +6521,6 @@
name = "pallet-rmrk-core"
version = "0.1.2"
dependencies = [
- "derivative",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -6590,10 +6528,9 @@
"pallet-evm",
"pallet-nonfungible",
"pallet-structure",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rmrk-traits",
"scale-info",
- "sp-core",
"sp-runtime",
"sp-std",
"up-data-structs",
@@ -6610,10 +6547,8 @@
"pallet-evm",
"pallet-nonfungible",
"pallet-rmrk-core",
- "parity-scale-codec 3.2.1",
- "rmrk-traits",
+ "parity-scale-codec",
"scale-info",
- "sp-core",
"sp-runtime",
"sp-std",
"up-data-structs",
@@ -6628,7 +6563,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6646,7 +6581,7 @@
"impl-trait-for-tuples",
"log",
"pallet-timestamp",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6680,7 +6615,7 @@
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand_chacha 0.2.2",
"scale-info",
"sp-runtime",
@@ -6699,7 +6634,7 @@
"log",
"pallet-authorship",
"pallet-session",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand_chacha 0.2.2",
"scale-info",
"serde",
@@ -6739,7 +6674,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6757,7 +6692,7 @@
"log",
"pallet-common",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-std",
"up-data-structs",
@@ -6770,7 +6705,7 @@
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
@@ -6787,7 +6722,7 @@
"frame-system",
"pallet-balances",
"pallet-transaction-payment",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -6804,7 +6739,7 @@
"frame-support",
"frame-system",
"pallet-unique-scheduler-v2",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-std",
]
@@ -6818,7 +6753,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-inherents",
"sp-io",
@@ -6837,7 +6772,7 @@
"frame-system",
"log",
"pallet-treasury",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -6853,7 +6788,7 @@
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -6869,7 +6804,7 @@
dependencies = [
"jsonrpsee",
"pallet-transaction-payment-rpc-runtime-api",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-blockchain",
"sp-core",
@@ -6884,7 +6819,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"pallet-transaction-payment",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-runtime",
"sp-weights",
@@ -6900,7 +6835,7 @@
"frame-system",
"impl-trait-for-tuples",
"pallet-balances",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-runtime",
@@ -6921,7 +6856,7 @@
"pallet-evm-coder-substrate",
"pallet-nonfungible",
"pallet-refungible",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -6940,7 +6875,7 @@
"frame-system",
"log",
"pallet-preimage",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6957,7 +6892,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -6974,7 +6909,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
@@ -6988,7 +6923,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-api",
"sp-runtime",
@@ -7003,7 +6938,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -7022,7 +6957,7 @@
"frame-support",
"frame-system",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
@@ -7038,7 +6973,7 @@
"cumulus-primitives-core",
"frame-support",
"frame-system",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
]
@@ -7063,50 +6998,24 @@
[[package]]
name = "parity-scale-codec"
-version = "2.3.1"
+version = "3.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909"
+checksum = "e7ab01d0f889e957861bc65888d5ccbe82c158d0270136ba46820d43837cdf72"
dependencies = [
"arrayvec 0.7.2",
- "bitvec 0.20.4",
- "byte-slice-cast",
- "impl-trait-for-tuples",
- "parity-scale-codec-derive 2.3.1",
- "serde",
-]
-
-[[package]]
-name = "parity-scale-codec"
-version = "3.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a"
-dependencies = [
- "arrayvec 0.7.2",
- "bitvec 1.0.1",
+ "bitvec",
"byte-slice-cast",
"bytes",
"impl-trait-for-tuples",
- "parity-scale-codec-derive 3.1.3",
+ "parity-scale-codec-derive",
"serde",
]
[[package]]
name = "parity-scale-codec-derive"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "parity-scale-codec-derive"
-version = "3.1.3"
+version = "3.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd"
+checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -7150,7 +7059,7 @@
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
- "parking_lot_core 0.9.5",
+ "parking_lot_core 0.9.6",
]
[[package]]
@@ -7169,9 +7078,9 @@
[[package]]
name = "parking_lot_core"
-version = "0.9.5"
+version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
+checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf"
dependencies = [
"cfg-if",
"libc",
@@ -7218,9 +7127,9 @@
[[package]]
name = "pest"
-version = "2.5.1"
+version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0"
+checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a"
dependencies = [
"thiserror",
"ucd-trie",
@@ -7228,9 +7137,9 @@
[[package]]
name = "pest_derive"
-version = "2.5.1"
+version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344"
+checksum = "241cda393b0cdd65e62e07e12454f1f25d57017dcc514b1514cd3c4645e3a0a6"
dependencies = [
"pest",
"pest_generator",
@@ -7238,9 +7147,9 @@
[[package]]
name = "pest_generator"
-version = "2.5.1"
+version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c"
+checksum = "46b53634d8c8196302953c74d5352f33d0c512a9499bd2ce468fc9f4128fa27c"
dependencies = [
"pest",
"pest_meta",
@@ -7251,13 +7160,13 @@
[[package]]
name = "pest_meta"
-version = "2.5.1"
+version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20"
+checksum = "0ef4f1332a8d4678b41966bb4cc1d0676880e84183a1ecc3f4b69f03e99c7a51"
dependencies = [
"once_cell",
"pest",
- "sha1",
+ "sha2 0.10.6",
]
[[package]]
@@ -7341,7 +7250,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7356,7 +7265,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"polkadot-node-network-protocol",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
@@ -7372,9 +7281,9 @@
dependencies = [
"derive_more",
"fatality",
- "futures 0.3.25",
+ "futures",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -7394,9 +7303,9 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"fatality",
- "futures 0.3.25",
+ "futures",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -7416,7 +7325,7 @@
dependencies = [
"clap",
"frame-benchmarking-cli",
- "futures 0.3.25",
+ "futures",
"log",
"polkadot-client",
"polkadot-node-core-pvf",
@@ -7446,7 +7355,7 @@
"frame-benchmarking-cli",
"frame-system",
"frame-system-rpc-runtime-api",
- "futures 0.3.25",
+ "futures",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"polkadot-core-primitives",
@@ -7484,9 +7393,9 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"always-assert",
- "bitvec 1.0.1",
+ "bitvec",
"fatality",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -7505,7 +7414,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
@@ -7519,11 +7428,11 @@
dependencies = [
"derive_more",
"fatality",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"indexmap",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -7542,7 +7451,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-primitives",
"polkadot-primitives",
"reed-solomon-novelpoly",
@@ -7556,7 +7465,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"polkadot-node-network-protocol",
"polkadot-node-subsystem",
@@ -7580,8 +7489,8 @@
"async-trait",
"bytes",
"fatality",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"polkadot-node-network-protocol",
"polkadot-node-subsystem",
@@ -7600,8 +7509,8 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7618,14 +7527,14 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"derive_more",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"kvdb",
"lru",
"merlin",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-jaeger",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7647,11 +7556,11 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
- "futures 0.3.25",
+ "bitvec",
+ "futures",
"futures-timer",
"kvdb",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7667,9 +7576,9 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"fatality",
- "futures 0.3.25",
+ "futures",
"polkadot-erasure-coding",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7686,7 +7595,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
"polkadot-primitives",
@@ -7702,9 +7611,9 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-core-pvf",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7720,7 +7629,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
"polkadot-primitives",
@@ -7735,10 +7644,10 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"kvdb",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
@@ -7753,10 +7662,10 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"fatality",
- "futures 0.3.25",
+ "futures",
"kvdb",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
@@ -7772,7 +7681,7 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"polkadot-node-subsystem",
"polkadot-overseer",
@@ -7789,9 +7698,9 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"fatality",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -7812,9 +7721,9 @@
"async-process",
"async-std",
"cpu-time",
- "futures 0.3.25",
+ "futures",
"futures-timer",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"pin-project",
"polkadot-core-primitives",
"polkadot-node-metrics",
@@ -7840,7 +7749,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
@@ -7856,7 +7765,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "futures 0.3.25",
+ "futures",
"lru",
"polkadot-node-subsystem",
"polkadot-node-subsystem-types",
@@ -7874,7 +7783,7 @@
"lazy_static",
"log",
"mick-jaeger",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"polkadot-node-primitives",
"polkadot-primitives",
@@ -7890,10 +7799,10 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bs58",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"prioritized-metered-channel",
"sc-cli",
@@ -7911,9 +7820,9 @@
"async-trait",
"derive_more",
"fatality",
- "futures 0.3.25",
+ "futures",
"hex",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-jaeger",
"polkadot-node-primitives",
"polkadot-primitives",
@@ -7932,8 +7841,8 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bounded-vec",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
+ "futures",
+ "parity-scale-codec",
"polkadot-parachain",
"polkadot-primitives",
"schnorrkel",
@@ -7965,7 +7874,7 @@
dependencies = [
"async-trait",
"derive_more",
- "futures 0.3.25",
+ "futures",
"orchestra",
"polkadot-node-jaeger",
"polkadot-node-network-protocol",
@@ -7989,12 +7898,12 @@
"async-trait",
"derive_more",
"fatality",
- "futures 0.3.25",
+ "futures",
"itertools",
"kvdb",
"lru",
"parity-db",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.11.2",
"pin-project",
"polkadot-node-jaeger",
@@ -8019,7 +7928,7 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"lru",
"orchestra",
@@ -8043,7 +7952,7 @@
dependencies = [
"derive_more",
"frame-support",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-core-primitives",
"scale-info",
"serde",
@@ -8057,7 +7966,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "env_logger",
+ "env_logger 0.9.3",
"kusama-runtime",
"log",
"polkadot-erasure-coding",
@@ -8072,9 +7981,9 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"hex-literal",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain",
"scale-info",
@@ -8130,7 +8039,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -8180,7 +8089,7 @@
"pallet-utility",
"pallet-vesting",
"pallet-xcm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"polkadot-runtime-common",
"polkadot-runtime-constants",
@@ -8219,7 +8128,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"frame-benchmarking",
"frame-election-provider-support",
"frame-support",
@@ -8240,7 +8149,7 @@
"pallet-transaction-payment",
"pallet-treasury",
"pallet-vesting",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"polkadot-runtime-parachains",
"rustc-hex",
@@ -8282,7 +8191,7 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bs58",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"sp-std",
"sp-tracing",
@@ -8294,7 +8203,7 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitflags",
- "bitvec 1.0.1",
+ "bitvec",
"derive_more",
"frame-benchmarking",
"frame-support",
@@ -8308,7 +8217,7 @@
"pallet-staking",
"pallet-timestamp",
"pallet-vesting",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-primitives",
"polkadot-runtime-metrics",
"rand 0.8.5",
@@ -8340,7 +8249,7 @@
"beefy-gadget",
"frame-support",
"frame-system-rpc-runtime-api",
- "futures 0.3.25",
+ "futures",
"hex-literal",
"kusama-runtime",
"kvdb",
@@ -8444,9 +8353,9 @@
dependencies = [
"arrayvec 0.5.2",
"fatality",
- "futures 0.3.25",
+ "futures",
"indexmap",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -8463,127 +8372,12 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "parity-scale-codec 3.2.1",
- "polkadot-primitives",
- "sp-core",
-]
-
-[[package]]
-name = "polkadot-test-runtime"
-version = "0.9.36"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
-dependencies = [
- "bitvec 1.0.1",
- "frame-election-provider-support",
- "frame-executive",
- "frame-support",
- "frame-system",
- "frame-system-rpc-runtime-api",
- "log",
- "pallet-authority-discovery",
- "pallet-authorship",
- "pallet-babe",
- "pallet-balances",
- "pallet-grandpa",
- "pallet-indices",
- "pallet-offences",
- "pallet-session",
- "pallet-staking",
- "pallet-staking-reward-curve",
- "pallet-sudo",
- "pallet-timestamp",
- "pallet-transaction-payment",
- "pallet-transaction-payment-rpc-runtime-api",
- "pallet-vesting",
- "pallet-xcm",
- "parity-scale-codec 3.2.1",
- "polkadot-parachain",
+ "parity-scale-codec",
"polkadot-primitives",
- "polkadot-runtime-common",
- "polkadot-runtime-parachains",
- "rustc-hex",
- "scale-info",
- "serde",
- "serde_derive",
- "smallvec",
- "sp-api",
- "sp-authority-discovery",
- "sp-beefy",
- "sp-block-builder",
- "sp-consensus-babe",
"sp-core",
- "sp-inherents",
- "sp-io",
- "sp-mmr-primitives",
- "sp-offchain",
- "sp-runtime",
- "sp-session",
- "sp-staking",
- "sp-std",
- "sp-transaction-pool",
- "sp-version",
- "substrate-wasm-builder",
- "test-runtime-constants",
- "xcm",
- "xcm-builder",
- "xcm-executor",
]
[[package]]
-name = "polkadot-test-service"
-version = "0.9.36"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
-dependencies = [
- "frame-benchmarking",
- "frame-system",
- "futures 0.3.25",
- "hex",
- "pallet-balances",
- "pallet-staking",
- "pallet-transaction-payment",
- "polkadot-node-primitives",
- "polkadot-node-subsystem",
- "polkadot-overseer",
- "polkadot-parachain",
- "polkadot-primitives",
- "polkadot-rpc",
- "polkadot-runtime-common",
- "polkadot-runtime-parachains",
- "polkadot-service",
- "polkadot-test-runtime",
- "rand 0.8.5",
- "sc-authority-discovery",
- "sc-chain-spec",
- "sc-cli",
- "sc-client-api",
- "sc-consensus",
- "sc-consensus-babe",
- "sc-executor",
- "sc-finality-grandpa",
- "sc-network",
- "sc-network-common",
- "sc-service",
- "sc-tracing",
- "sc-transaction-pool",
- "sp-arithmetic",
- "sp-authority-discovery",
- "sp-blockchain",
- "sp-consensus",
- "sp-consensus-babe",
- "sp-core",
- "sp-finality-grandpa",
- "sp-inherents",
- "sp-keyring",
- "sp-runtime",
- "sp-state-machine",
- "substrate-test-client",
- "tempfile",
- "test-runtime-constants",
- "tokio",
- "tracing-gum",
-]
-
-[[package]]
name = "polling"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -8639,9 +8433,9 @@
[[package]]
name = "predicates"
-version = "2.1.4"
+version = "2.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f54fc5dc63ed3bbf19494623db4f3af16842c0d975818e469022d09e53f0aa05"
+checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
dependencies = [
"difflib",
"float-cmp",
@@ -8669,9 +8463,9 @@
[[package]]
name = "prettyplease"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c8992a85d8e93a28bdf76137db888d3874e3b230dee5ed8bebac4c9f7617773"
+checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78"
dependencies = [
"proc-macro2",
"syn",
@@ -8713,7 +8507,7 @@
"coarsetime",
"crossbeam-queue",
"derive_more",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"nanorand",
"thiserror",
@@ -8757,9 +8551,9 @@
[[package]]
name = "proc-macro2"
-version = "1.0.49"
+version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
+checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2"
dependencies = [
"unicode-ident",
]
@@ -8803,9 +8597,9 @@
[[package]]
name = "prost"
-version = "0.11.5"
+version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c01db6702aa05baa3f57dec92b8eeeeb4cb19e894e73996b32a4093289e54592"
+checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698"
dependencies = [
"bytes",
"prost-derive",
@@ -8813,9 +8607,9 @@
[[package]]
name = "prost-build"
-version = "0.11.5"
+version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb5320c680de74ba083512704acb90fe00f28f79207286a848e730c45dd73ed6"
+checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e"
dependencies = [
"bytes",
"heck",
@@ -8848,9 +8642,9 @@
[[package]]
name = "prost-derive"
-version = "0.11.5"
+version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8842bad1a5419bca14eac663ba798f6bc19c413c2fdceb5f3ba3b0932d96720"
+checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d"
dependencies = [
"anyhow",
"itertools",
@@ -8861,9 +8655,9 @@
[[package]]
name = "prost-types"
-version = "0.11.5"
+version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "017f79637768cde62820bc2d4fe0e45daaa027755c323ad077767c6c5f173091"
+checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788"
dependencies = [
"bytes",
"prost",
@@ -8950,7 +8744,7 @@
"pallet-unique",
"pallet-xcm",
"parachain-info",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"precompile-utils-macro",
"rmrk-rpc",
@@ -9006,12 +8800,6 @@
dependencies = [
"proc-macro2",
]
-
-[[package]]
-name = "radium"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
[[package]]
name = "radium"
@@ -9214,9 +9002,9 @@
[[package]]
name = "regex"
-version = "1.7.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
+checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
dependencies = [
"aho-corasick",
"memchr",
@@ -9318,11 +9106,10 @@
name = "rmrk-rpc"
version = "0.0.2"
dependencies = [
- "parity-scale-codec 2.3.1",
+ "parity-scale-codec",
"rmrk-traits",
"serde",
"sp-api",
- "sp-core",
"sp-runtime",
"sp-std",
]
@@ -9331,7 +9118,7 @@
name = "rmrk-traits"
version = "0.1.0"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
]
@@ -9398,7 +9185,7 @@
"pallet-vesting",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
@@ -9463,7 +9250,7 @@
checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0"
dependencies = [
"async-global-executor",
- "futures 0.3.25",
+ "futures",
"log",
"netlink-packet-route",
"netlink-proto",
@@ -9533,13 +9320,13 @@
[[package]]
name = "rustix"
-version = "0.36.5"
+version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
+checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03"
dependencies = [
"bitflags",
"errno",
- "io-lifetimes 1.0.3",
+ "io-lifetimes 1.0.4",
"libc",
"linux-raw-sys 0.1.4",
"windows-sys 0.42.0",
@@ -9547,9 +9334,9 @@
[[package]]
name = "rustls"
-version = "0.20.7"
+version = "0.20.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c"
+checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
dependencies = [
"log",
"ring",
@@ -9571,11 +9358,11 @@
[[package]]
name = "rustls-pemfile"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
+checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
dependencies = [
- "base64",
+ "base64 0.21.0",
]
[[package]]
@@ -9590,7 +9377,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04"
dependencies = [
- "futures 0.3.25",
+ "futures",
"pin-project",
"static_assertions",
]
@@ -9636,12 +9423,12 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"ip_network",
"libp2p",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"prost",
"prost-build",
"rand 0.7.3",
@@ -9662,10 +9449,10 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-block-builder",
"sc-client-api",
"sc-proposer-metrics",
@@ -9685,7 +9472,7 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sp-api",
"sp-block-builder",
@@ -9703,7 +9490,7 @@
dependencies = [
"impl-trait-for-tuples",
"memmap2",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-chain-spec-derive",
"sc-network-common",
"sc-telemetry",
@@ -9733,11 +9520,11 @@
"chrono",
"clap",
"fdlimit",
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
"names",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rand 0.7.3",
"regex",
"rpassword",
@@ -9770,10 +9557,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"fnv",
- "futures 0.3.25",
+ "futures",
"hash-db",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-executor",
"sc-transaction-pool-api",
@@ -9804,7 +9591,7 @@
"linked-hash-map",
"log",
"parity-db",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
"sc-state-db",
@@ -9823,7 +9610,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"libp2p",
"log",
@@ -9848,9 +9635,9 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-block-builder",
"sc-client-api",
"sc-consensus",
@@ -9878,13 +9665,13 @@
dependencies = [
"async-trait",
"fork-tree",
- "futures 0.3.25",
+ "futures",
"log",
"merlin",
"num-bigint",
"num-rational",
"num-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
"sc-consensus",
@@ -9917,7 +9704,7 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"sc-consensus-babe",
"sc-consensus-epochs",
@@ -9940,7 +9727,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"fork-tree",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-consensus",
"sp-blockchain",
@@ -9954,10 +9741,10 @@
dependencies = [
"assert_matches",
"async-trait",
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-consensus",
"sc-consensus-aura",
@@ -9987,10 +9774,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-consensus",
"sc-telemetry",
@@ -10011,7 +9798,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-executor-common",
"sc-executor-wasmi",
@@ -10083,10 +9870,10 @@
"dyn-clone",
"finality-grandpa",
"fork-tree",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"rand 0.8.5",
"sc-block-builder",
@@ -10119,10 +9906,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"finality-grandpa",
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-finality-grandpa",
"sc-rpc",
@@ -10140,7 +9927,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ansi_term",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
"sc-client-api",
@@ -10179,7 +9966,7 @@
"either",
"fnv",
"fork-tree",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"ip_network",
"libp2p",
@@ -10187,7 +9974,7 @@
"linked_hash_set",
"log",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"pin-project",
"prost",
@@ -10218,7 +10005,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"cid",
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
"prost",
@@ -10240,11 +10027,11 @@
"async-trait",
"bitflags",
"bytes",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"libp2p",
"linked_hash_set",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"prost-build",
"sc-consensus",
"sc-peerset",
@@ -10264,7 +10051,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ahash",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"libp2p",
"log",
@@ -10282,10 +10069,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"array-bytes 4.2.0",
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"prost",
"prost-build",
"sc-client-api",
@@ -10305,12 +10092,12 @@
"array-bytes 4.2.0",
"async-trait",
"fork-tree",
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
"lru",
"mockall",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"prost",
"prost-build",
"sc-client-api",
@@ -10335,11 +10122,11 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"array-bytes 4.2.0",
- "futures 0.3.25",
+ "futures",
"hex",
"libp2p",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"pin-project",
"sc-network-common",
"sc-peerset",
@@ -10356,14 +10143,14 @@
"array-bytes 4.2.0",
"bytes",
"fnv",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"hyper",
"hyper-rustls",
"libp2p",
"num_cpus",
"once_cell",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"rand 0.7.3",
"sc-client-api",
@@ -10383,7 +10170,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
"sc-utils",
@@ -10405,11 +10192,11 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"hash-db",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-block-builder",
"sc-chain-spec",
@@ -10435,10 +10222,10 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-chain-spec",
"sc-transaction-pool-api",
@@ -10458,7 +10245,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"http",
"jsonrpsee",
"log",
@@ -10474,10 +10261,10 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"hex",
"jsonrpsee",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-chain-spec",
"sc-transaction-pool-api",
"serde",
@@ -10496,12 +10283,12 @@
"async-trait",
"directories",
"exit-future",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"hash-db",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"pin-project",
"rand 0.7.3",
@@ -10564,7 +10351,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
"sp-core",
@@ -10576,7 +10363,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"jsonrpsee",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-chain-spec",
"sc-client-api",
"sc-consensus-babe",
@@ -10594,7 +10381,7 @@
version = "6.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"libc",
"log",
"rand 0.7.3",
@@ -10614,7 +10401,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"chrono",
- "futures 0.3.25",
+ "futures",
"libp2p",
"log",
"parking_lot 0.12.1",
@@ -10674,11 +10461,11 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"linked-hash-map",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
"sc-transaction-pool-api",
@@ -10700,7 +10487,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"log",
"serde",
"sp-blockchain",
@@ -10713,7 +10500,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"futures-timer",
"lazy_static",
"log",
@@ -10727,10 +10514,10 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"cfg-if",
"derive_more",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info-derive",
"serde",
]
@@ -10749,12 +10536,11 @@
[[package]]
name = "schannel"
-version = "0.1.20"
+version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
+checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
- "lazy_static",
- "windows-sys 0.36.1",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -10813,9 +10599,9 @@
[[package]]
name = "secp256k1"
-version = "0.24.2"
+version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9512ffd81e3a3503ed401f79c33168b9148c75038956039166cd750eaa037c3"
+checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62"
dependencies = [
"secp256k1-sys",
]
@@ -10840,9 +10626,9 @@
[[package]]
name = "security-framework"
-version = "2.7.0"
+version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
+checksum = "645926f31b250a2dca3c232496c2d898d91036e45ca0e97e0e2390c54e11be36"
dependencies = [
"bitflags",
"core-foundation",
@@ -10853,9 +10639,9 @@
[[package]]
name = "security-framework-sys"
-version = "2.6.1"
+version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
+checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
dependencies = [
"core-foundation-sys",
"libc",
@@ -10896,18 +10682,18 @@
[[package]]
name = "serde"
-version = "1.0.151"
+version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0"
+checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.151"
+version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8"
+checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
dependencies = [
"proc-macro2",
"quote",
@@ -10948,17 +10734,6 @@
]
[[package]]
-name = "sha1"
-version = "0.10.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest 0.10.6",
-]
-
-[[package]]
name = "sha2"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -11085,7 +10860,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf"
dependencies = [
- "bstr",
+ "bstr 0.2.17",
"unicode-segmentation",
]
@@ -11120,7 +10895,7 @@
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"enumn",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"paste",
"sp-runtime",
"sp-std",
@@ -11180,10 +10955,10 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2"
dependencies = [
- "base64",
+ "base64 0.13.1",
"bytes",
"flate2",
- "futures 0.3.25",
+ "futures",
"http",
"httparse",
"log",
@@ -11198,7 +10973,7 @@
dependencies = [
"hash-db",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api-proc-macro",
"sp-core",
"sp-runtime",
@@ -11226,7 +11001,7 @@
version = "7.0.0"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-core",
@@ -11241,7 +11016,7 @@
dependencies = [
"integer-sqrt",
"num-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-debug-derive",
@@ -11254,7 +11029,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-api",
"sp-application-crypto",
@@ -11268,7 +11043,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-inherents",
"sp-runtime",
"sp-std",
@@ -11279,7 +11054,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-api",
@@ -11296,7 +11071,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-inherents",
"sp-runtime",
@@ -11308,10 +11083,10 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"log",
"lru",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"sp-api",
"sp-consensus",
@@ -11327,10 +11102,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-core",
"sp-inherents",
"sp-runtime",
@@ -11346,7 +11121,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-api",
"sp-application-crypto",
@@ -11365,7 +11140,7 @@
dependencies = [
"async-trait",
"merlin",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-api",
@@ -11386,7 +11161,7 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-arithmetic",
@@ -11400,7 +11175,7 @@
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"schnorrkel",
"sp-core",
@@ -11420,7 +11195,7 @@
"byteorder",
"dyn-clonable",
"ed25519-zebra",
- "futures 0.3.25",
+ "futures",
"hash-db",
"hash256-std-hasher",
"impl-serde",
@@ -11429,7 +11204,7 @@
"log",
"merlin",
"num-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"primitive-types 0.12.1",
"rand 0.7.3",
@@ -11503,7 +11278,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"environmental",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-std",
"sp-storage",
]
@@ -11515,7 +11290,7 @@
dependencies = [
"finality-grandpa",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-api",
@@ -11533,7 +11308,7 @@
dependencies = [
"async-trait",
"impl-trait-for-tuples",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-core",
"sp-runtime",
"sp-std",
@@ -11547,11 +11322,11 @@
dependencies = [
"bytes",
"ed25519-dalek",
- "futures 0.3.25",
+ "futures",
"hash-db",
"libsecp256k1",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"secp256k1",
"sp-core",
@@ -11584,9 +11359,9 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
- "futures 0.3.25",
+ "futures",
"merlin",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"schnorrkel",
"serde",
@@ -11611,7 +11386,7 @@
dependencies = [
"ckb-merkle-mountain-range",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-api",
@@ -11627,7 +11402,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-arithmetic",
@@ -11675,7 +11450,7 @@
"hash256-std-hasher",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"paste",
"rand 0.7.3",
"scale-info",
@@ -11695,7 +11470,7 @@
dependencies = [
"bytes",
"impl-trait-for-tuples",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"primitive-types 0.12.1",
"sp-externalities",
"sp-runtime-interface-proc-macro",
@@ -11723,7 +11498,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-api",
"sp-core",
@@ -11737,7 +11512,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-runtime",
@@ -11752,7 +11527,7 @@
"hash-db",
"log",
"num-traits",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"rand 0.7.3",
"smallvec",
@@ -11777,7 +11552,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-serde",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"ref-cast",
"serde",
"sp-debug-derive",
@@ -11792,7 +11567,7 @@
"async-trait",
"futures-timer",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-inherents",
"sp-runtime",
@@ -11805,7 +11580,7 @@
version = "6.0.0"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-std",
"tracing",
"tracing-core",
@@ -11828,7 +11603,7 @@
dependencies = [
"async-trait",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-inherents",
@@ -11849,7 +11624,7 @@
"lru",
"memory-db",
"nohash-hasher",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parking_lot 0.12.1",
"scale-info",
"sp-core",
@@ -11866,7 +11641,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-serde",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"parity-wasm",
"scale-info",
"serde",
@@ -11882,7 +11657,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"proc-macro2",
"quote",
"syn",
@@ -11895,7 +11670,7 @@
dependencies = [
"impl-trait-for-tuples",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-std",
"wasmi",
"wasmtime",
@@ -11907,7 +11682,7 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-trait-for-tuples",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"smallvec",
@@ -11935,9 +11710,9 @@
[[package]]
name = "ss58-registry"
-version = "1.36.0"
+version = "1.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23d92659e7d18d82b803824a9ba5a6022cff101c3491d027c1c1d8d30e749284"
+checksum = "d44528162f980c0e03c71e005d334332c8da0aec9f2b0b4bdc557ed4a9f24776"
dependencies = [
"Inflector",
"num-format",
@@ -12089,10 +11864,10 @@
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-system-rpc-runtime-api",
- "futures 0.3.25",
+ "futures",
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-rpc-api",
"sc-transaction-pool-api",
@@ -12137,7 +11912,7 @@
dependencies = [
"jsonrpsee",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-client-api",
"sc-rpc-api",
"scale-info",
@@ -12149,32 +11924,6 @@
"sp-std",
"sp-trie",
"trie-db",
-]
-
-[[package]]
-name = "substrate-test-client"
-version = "2.0.1"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
-dependencies = [
- "array-bytes 4.2.0",
- "async-trait",
- "futures 0.3.25",
- "parity-scale-codec 3.2.1",
- "sc-client-api",
- "sc-client-db",
- "sc-consensus",
- "sc-executor",
- "sc-offchain",
- "sc-service",
- "serde",
- "serde_json",
- "sp-blockchain",
- "sp-consensus",
- "sp-core",
- "sp-keyring",
- "sp-keystore",
- "sp-runtime",
- "sp-state-machine",
]
[[package]]
@@ -12182,7 +11931,7 @@
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "futures 0.3.25",
+ "futures",
"substrate-test-utils-derive",
"tokio",
]
@@ -12293,21 +12042,11 @@
[[package]]
name = "termcolor"
-version = "1.1.3"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
]
[[package]]
@@ -12317,20 +12056,6 @@
checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8"
[[package]]
-name = "test-runtime-constants"
-version = "0.9.36"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
-dependencies = [
- "frame-support",
- "polkadot-primitives",
- "polkadot-runtime-common",
- "smallvec",
- "sp-core",
- "sp-runtime",
- "sp-weights",
-]
-
-[[package]]
name = "tests"
version = "0.1.1"
dependencies = [
@@ -12350,7 +12075,7 @@
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-unique",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
@@ -12495,9 +12220,9 @@
[[package]]
name = "tokio"
-version = "1.23.0"
+version = "1.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46"
+checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb"
dependencies = [
"autocfg",
"bytes",
@@ -12801,9 +12526,9 @@
[[package]]
name = "try-lock"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
+checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "try-runtime-cli"
@@ -12815,7 +12540,7 @@
"frame-try-runtime",
"hex",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sc-chain-spec",
"sc-cli",
"sc-executor",
@@ -12838,9 +12563,9 @@
[[package]]
name = "trybuild"
-version = "1.0.73"
+version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed01de3de062db82c0920b5cabe804f88d599a3f217932292597c678c903754d"
+checksum = "6ed2c57956f91546d4d33614265a85d55c8e1ab91484853a10335894786d7db6"
dependencies = [
"glob",
"once_cell",
@@ -12884,9 +12609,8 @@
"frame-benchmarking",
"jsonrpsee",
"opal-runtime",
- "pallet-common",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"quartz-runtime",
"rmrk-rpc",
"sc-client-api",
@@ -12898,7 +12622,6 @@
"sp-core",
"sp-externalities",
"sp-keystore",
- "sp-rpc",
"sp-runtime",
"sp-state-machine",
"sp-trie",
@@ -12931,9 +12654,9 @@
[[package]]
name = "unicode-bidi"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
+checksum = "0046be40136ef78dc325e0edefccf84ccddacd0afcc1ca54103fa3c61bbdab1d"
[[package]]
name = "unicode-ident"
@@ -12975,7 +12698,6 @@
"app-promotion-rpc",
"clap",
"cumulus-client-cli",
- "cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-network",
@@ -12990,24 +12712,17 @@
"fc-mapping-sync",
"fc-rpc",
"fc-rpc-core",
- "flexi_logger",
"fp-rpc",
"frame-benchmarking",
"frame-benchmarking-cli",
- "futures 0.3.25",
- "jsonrpsee",
+ "futures",
"log",
"opal-runtime",
- "pallet-ethereum",
- "pallet-transaction-payment-rpc",
"pallet-transaction-payment-rpc-runtime-api",
- "parity-scale-codec 3.2.1",
- "parking_lot 0.12.1",
+ "parity-scale-codec",
"polkadot-cli",
- "polkadot-parachain",
"polkadot-primitives",
"polkadot-service",
- "polkadot-test-service",
"quartz-runtime",
"rmrk-rpc",
"sc-basic-authorship",
@@ -13015,14 +12730,9 @@
"sc-cli",
"sc-client-api",
"sc-consensus",
- "sc-consensus-aura",
"sc-consensus-manual-seal",
"sc-executor",
- "sc-finality-grandpa",
- "sc-keystore",
"sc-network",
- "sc-rpc",
- "sc-rpc-api",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
@@ -13033,11 +12743,8 @@
"sp-api",
"sp-block-builder",
"sp-blockchain",
- "sp-consensus",
"sp-consensus-aura",
"sp-core",
- "sp-finality-grandpa",
- "sp-inherents",
"sp-io",
"sp-keystore",
"sp-offchain",
@@ -13045,7 +12752,6 @@
"sp-session",
"sp-timestamp",
"sp-transaction-pool",
- "sp-trie",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
@@ -13066,25 +12772,15 @@
dependencies = [
"app-promotion-rpc",
"fc-db",
- "fc-mapping-sync",
"fc-rpc",
"fc-rpc-core",
"fp-rpc",
"fp-storage",
- "futures 0.3.25",
"jsonrpsee",
- "pallet-common",
- "pallet-ethereum",
"pallet-transaction-payment-rpc",
- "pallet-transaction-payment-rpc-runtime-api",
- "pallet-unique",
"rmrk-rpc",
"sc-client-api",
- "sc-consensus-aura",
- "sc-consensus-epochs",
"sc-finality-grandpa",
- "sc-finality-grandpa-rpc",
- "sc-keystore",
"sc-network",
"sc-rpc",
"sc-rpc-api",
@@ -13094,16 +12790,8 @@
"sp-api",
"sp-block-builder",
"sp-blockchain",
- "sp-consensus",
- "sp-consensus-aura",
- "sp-core",
- "sp-offchain",
"sp-runtime",
- "sp-session",
- "sp-storage",
- "sp-transaction-pool",
"substrate-frame-rpc-system",
- "tokio",
"uc-rpc",
"up-common",
"up-data-structs",
@@ -13183,12 +12871,11 @@
"pallet-unique",
"pallet-xcm",
"parachain-info",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"precompile-utils-macro",
"rmrk-rpc",
"scale-info",
- "serde",
"smallvec",
"sp-api",
"sp-arithmetic",
@@ -13263,9 +12950,8 @@
"bondrewd",
"derivative",
"frame-support",
- "frame-system",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"rmrk-traits",
"scale-info",
"serde",
@@ -13279,7 +12965,7 @@
name = "up-pov-estimate-rpc"
version = "0.1.0"
dependencies = [
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"serde",
"sp-api",
@@ -13294,7 +12980,7 @@
dependencies = [
"pallet-common",
"pallet-evm",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-api",
"sp-core",
"sp-runtime",
@@ -13522,7 +13208,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
dependencies = [
- "futures 0.3.25",
+ "futures",
"js-sys",
"parking_lot 0.11.2",
"pin-utils",
@@ -13617,7 +13303,7 @@
checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882"
dependencies = [
"anyhow",
- "base64",
+ "base64 0.13.1",
"bincode",
"directories-next",
"file-per-thread-logger",
@@ -13786,7 +13472,7 @@
version = "0.9.36"
source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "bitvec 1.0.1",
+ "bitvec",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -13837,7 +13523,7 @@
"pallet-vesting",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
@@ -13966,19 +13652,19 @@
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm",
- "windows_aarch64_msvc 0.42.0",
- "windows_i686_gnu 0.42.0",
- "windows_i686_msvc 0.42.0",
- "windows_x86_64_gnu 0.42.0",
+ "windows_aarch64_msvc 0.42.1",
+ "windows_i686_gnu 0.42.1",
+ "windows_i686_msvc 0.42.1",
+ "windows_x86_64_gnu 0.42.1",
"windows_x86_64_gnullvm",
- "windows_x86_64_msvc 0.42.0",
+ "windows_x86_64_msvc 0.42.1",
]
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
+checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
[[package]]
name = "windows_aarch64_msvc"
@@ -13994,9 +13680,9 @@
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
+checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
[[package]]
name = "windows_i686_gnu"
@@ -14012,9 +13698,9 @@
[[package]]
name = "windows_i686_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
+checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
[[package]]
name = "windows_i686_msvc"
@@ -14030,9 +13716,9 @@
[[package]]
name = "windows_i686_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
+checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
[[package]]
name = "windows_x86_64_gnu"
@@ -14048,15 +13734,15 @@
[[package]]
name = "windows_x86_64_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
+checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
+checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
[[package]]
name = "windows_x86_64_msvc"
@@ -14072,9 +13758,9 @@
[[package]]
name = "windows_x86_64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
+checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
[[package]]
name = "winreg"
@@ -14087,12 +13773,6 @@
[[package]]
name = "wyz"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
-
-[[package]]
-name = "wyz"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
@@ -14119,7 +13799,7 @@
"derivative",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"scale-info",
"sp-runtime",
"xcm-procedural",
@@ -14134,7 +13814,7 @@
"frame-system",
"log",
"pallet-transaction-payment",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"polkadot-parachain",
"scale-info",
"sp-arithmetic",
@@ -14154,7 +13834,7 @@
"frame-support",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec 3.2.1",
+ "parity-scale-codec",
"sp-arithmetic",
"sp-core",
"sp-io",
@@ -14180,7 +13860,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5"
dependencies = [
- "futures 0.3.25",
+ "futures",
"log",
"nohash-hasher",
"parking_lot 0.12.1",
@@ -14230,10 +13910,11 @@
[[package]]
name = "zstd-sys"
-version = "2.0.4+zstd.1.5.2"
+version = "2.0.5+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0"
+checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596"
dependencies = [
"cc",
"libc",
+ "pkg-config",
]
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,38 +1,24 @@
[workspace]
-resolver = "2"
+default-members = ['client/*', 'node/*', 'runtime/opal']
members = [
- 'node/*',
- 'pallets/*',
- 'client/*',
- 'primitives/*',
- 'crates/*',
- 'runtime/opal',
- 'runtime/quartz',
- 'runtime/unique',
- 'runtime/tests',
+ 'client/*',
+ 'crates/*',
+ 'node/*',
+ 'pallets/*',
+ 'primitives/*',
+ 'runtime/opal',
+ 'runtime/quartz',
+ 'runtime/tests',
+ 'runtime/unique',
]
-default-members = ['node/*', 'client/*', 'runtime/opal']
package.version = "0.9.36"
+resolver = "2"
[profile.release]
panic = 'unwind'
-[workspace.dependencies.orml-vesting]
-git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "feature/polkadot-v0.9.36"
-default-features = false
-
-[workspace.dependencies.orml-xtokens]
-git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "feature/polkadot-v0.9.36"
-default-features = false
-
-[workspace.dependencies.orml-tokens]
-git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "feature/polkadot-v0.9.36"
-default-features = false
-
-[workspace.dependencies.orml-traits]
-git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "feature/polkadot-v0.9.36"
-default-features = false
+[workspace.dependencies]
+orml-tokens = { git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "feature/polkadot-v0.9.36", default-features = false }
+orml-traits = { git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "feature/polkadot-v0.9.36", default-features = false }
+orml-vesting = { git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "feature/polkadot-v0.9.36", default-features = false }
+orml-xtokens = { git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "feature/polkadot-v0.9.36", default-features = false }
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -144,7 +144,15 @@
.PHONY: bench-app-promotion
bench-app-promotion:
make _bench PALLET=app-promotion PALLET_DIR=app-promotion
-
+
.PHONY: bench
-# Disabled: bench-scheduler, bench-collator-selection, bench-rmrk-core, bench-rmrk-equip
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-identity
+# Disabled: bench-scheduler, bench-collator-selection, bench-identity, bench-rmrk-core, bench-rmrk-equip
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets
+
+.PHONY: check
+check:
+ SKIP_WASM_BUILD=1 cargo check --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests
+
+.PHONY: clippy
+clippy:
+ SKIP_WASM_BUILD=1 cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests
client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -1,49 +1,47 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "uc-rpc"
version = "0.1.4"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-pallet-common = { default-features = false, path = '../../pallets/common' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-up-common = { default-features = false, path = '../../primitives/common' }
-up-rpc = { path = "../../primitives/rpc" }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc" }
-rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
+anyhow = "1.0.57"
+app-promotion-rpc.path = "../../primitives/app_promotion_rpc"
+codec = { package = "parity-scale-codec", version = "3.1.2" }
+jsonrpsee = { version = "0.16.2", features = ["macros", "server"] }
+rmrk-rpc.path = "../../primitives/rmrk-rpc"
+trie-db = { version = "0.24.0", default-features = false }
+up-common = { default-features = false, path = "../../primitives/common" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", optional = true }
-codec = { package = "parity-scale-codec", version = "3.1.2" }
-jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
-anyhow = "1.0.57"
+up-rpc.path = "../../primitives/rpc"
zstd = { version = "0.11.2", default-features = false }
-trie-db = { version = "0.24.0", default-features = false }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-rpc-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-keystore = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-unique-runtime = { path = '../../runtime/unique', optional = true }
-quartz-runtime = { path = '../../runtime/quartz', optional = true }
-opal-runtime = { path = '../../runtime/opal' }
+opal-runtime.path = "../../runtime/opal"
+quartz-runtime = { path = "../../runtime/quartz", optional = true }
+unique-runtime = { path = "../../runtime/unique", optional = true }
[features]
pov-estimate = [
- 'up-pov-estimate-rpc',
- 'unique-runtime?/pov-estimate',
- 'quartz-runtime?/pov-estimate',
- 'opal-runtime/pov-estimate',
+ 'opal-runtime/pov-estimate',
+ 'quartz-runtime?/pov-estimate',
+ 'unique-runtime?/pov-estimate',
+ 'up-pov-estimate-rpc',
]
crates/evm-coder/Cargo.tomldiffbeforeafterboth--- a/crates/evm-coder/Cargo.toml
+++ b/crates/evm-coder/Cargo.toml
@@ -1,18 +1,17 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "evm-coder"
version = "0.1.6"
-license = "GPLv3"
-edition = "2021"
[dependencies]
sha3-const = { version = "0.1.1", default-features = false }
# evm-coder reexports those proc-macro
-evm-coder-procedural = { path = "./procedural" }
+evm-coder-procedural.path = "./procedural"
# Evm uses primitive-types for H160, H256 and others
primitive-types = { version = "0.12.1", default-features = false }
# Evm doesn't have reexports for log and others
ethereum = { version = "0.14.0", default-features = false }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
# Error types for execution
evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.36" }
@@ -28,11 +27,6 @@
[features]
default = ["std"]
-std = [
- "ethereum/std",
- "primitive-types/std",
- "evm-core/std",
- "frame-support/std",
-]
+std = ["ethereum/std", "evm-core/std", "frame-support/std", "primitive-types/std"]
# Stub/interface generation
stubgen = []
crates/evm-coder/procedural/Cargo.tomldiffbeforeafterboth--- a/crates/evm-coder/procedural/Cargo.toml
+++ b/crates/evm-coder/procedural/Cargo.toml
@@ -1,8 +1,8 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "evm-coder-procedural"
version = "0.2.3"
-license = "GPLv3"
-edition = "2021"
[lib]
proc-macro = true
@@ -11,9 +11,9 @@
# Ethereum uses keccak (=sha3) for selectors
sha3 = "0.10.1"
# Value formatting
+Inflector = "0.11.4"
hex = "0.4.3"
-Inflector = "0.11.4"
# General proc-macro utilities
+proc-macro2 = "1.0"
quote = "1.0"
-proc-macro2 = "1.0"
syn = { version = "1.0", features = ["full"] }
crates/evm-coder/procedural/src/to_log.rsdiffbeforeafterboth--- a/crates/evm-coder/procedural/src/to_log.rs
+++ b/crates/evm-coder/procedural/src/to_log.rs
@@ -231,7 +231,7 @@
#[automatically_derived]
impl ::evm_coder::events::ToLog for #name {
- fn to_log(&self, contract: Address) -> ::ethereum::Log {
+ fn to_log(&self, contract: Address) -> ::evm_coder::ethereum::Log {
use ::evm_coder::events::ToTopic;
use ::evm_coder::abi::AbiWrite;
let mut writer = ::evm_coder::abi::AbiWriter::new();
@@ -241,7 +241,7 @@
#serializers,
)*
}
- ::ethereum::Log {
+ ::evm_coder::ethereum::Log {
address: contract,
topics,
data: writer.finish(),
crates/evm-coder/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -96,6 +96,9 @@
pub use evm_coder_procedural::AbiCoder;
pub use sha3_const;
+/// macro reexports
+pub use ethereum;
+
/// Derives [`ToLog`] for enum
///
/// Selectors will be derived from variant names, there is currently no way to have custom naming
@@ -198,7 +201,7 @@
/// Should be same between evm-coder and substrate to avoid confusion
///
/// Isn't same thing as gas, some mapping is required between those types
-pub type Weight = frame_support::weights::Weight;
+pub type Weight = frame_support::pallet_prelude::Weight;
/// In substrate, we have benchmarking, which allows
/// us to not rely on gas metering, but instead predict amount of gas to execute call
crates/struct-versioning/Cargo.tomldiffbeforeafterboth--- a/crates/struct-versioning/Cargo.toml
+++ b/crates/struct-versioning/Cargo.toml
@@ -1,11 +1,11 @@
[package]
+edition = "2021"
name = "struct-versioning"
version = "0.1.0"
-edition = "2021"
[dependencies]
+quote = "1.0.15"
syn = { version = "1.0", features = ["full"] }
-quote = "1.0.15"
[lib]
proc-macro = true
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -1,286 +1,7 @@
-################################################################################
-# Build Dependencies
-
-[build-dependencies.substrate-build-script-utils]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-################################################################################
-# Substrate Dependecies
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-benchmarking-cli]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.try-runtime-cli]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment-rpc]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.substrate-prometheus-endpoint]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-basic-authorship]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-chain-spec]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-cli]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-client-api]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-consensus]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-consensus-aura]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-executor]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-finality-grandpa]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-keystore]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-rpc]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-rpc-api]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-service]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-telemetry]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-transaction-pool]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-tracing]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-sysinfo]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-block-builder]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-api]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-blockchain]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus-aura]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-finality-grandpa]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-inherents]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-keystore]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-offchain]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-session]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-timestamp]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-transaction-pool]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-trie]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.substrate-frame-rpc-system]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sc-network]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.serde]
-features = ['derive']
-version = '1.0.130'
-
-[dependencies.serde_json]
-version = '1.0.68'
-
-[dependencies.sc-consensus-manual-seal]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-################################################################################
-# Cumulus dependencies
-
-[dependencies.cumulus-client-consensus-aura]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-client-consensus-common]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-client-collator]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-client-cli]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-client-network]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-primitives-core]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-primitives-parachain-inherent]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-client-service]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-relay-chain-interface]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-relay-chain-inprocess-interface]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-relay-chain-minimal-node]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-################################################################################
-# Polkadot dependencies
-[dependencies.polkadot-primitives]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-
-[dependencies.polkadot-service]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-
-[dependencies.polkadot-cli]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
+[build-dependencies]
+substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-[dependencies.polkadot-test-service]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-
-[dependencies.polkadot-parachain]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-
-
################################################################################
-# Local dependencies
-
-[dependencies.up-common]
-path = "../../primitives/common"
-
-[dependencies.unique-runtime]
-path = '../../runtime/unique'
-optional = true
-
-[dependencies.quartz-runtime]
-path = '../../runtime/quartz'
-optional = true
-
-[dependencies.opal-runtime]
-path = '../../runtime/opal'
-optional = true
-
-[dependencies.up-data-structs]
-path = "../../primitives/data-structs"
-default-features = false
-
-[dependencies.up-rpc]
-path = "../../primitives/rpc"
-
-[dependencies.pallet-transaction-payment-rpc-runtime-api]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-################################################################################
# Package
[package]
@@ -302,49 +23,98 @@
targets = ['x86_64-unknown-linux-gnu']
[dependencies]
+clap = "4.1"
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.2" }
+cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
futures = '0.3.17'
-log = '0.4.16'
-flexi_logger = "0.24.2"
-parking_lot = '0.12.1'
-clap = "4.0.9"
-jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
-tokio = { version = "1.19.2", features = ["time"] }
+log = '0.4.17'
+opal-runtime = { path = "../../runtime/opal", optional = true }
+pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
+polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
+polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
+quartz-runtime = { path = "../../runtime/quartz", optional = true }
+sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+serde = { features = ['derive'], version = "1.0" }
+serde_json = "1.0"
+sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+tokio = { version = "1.24", features = ["time"] }
+try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+unique-runtime = { path = "../../runtime/unique", optional = true }
+up-common.path = "../../primitives/common"
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
+up-rpc.path = "../../primitives/rpc"
-fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
+rmrk-rpc.path = "../../primitives/rmrk-rpc"
+uc-rpc = { default-features = false, path = "../../client/rpc" }
unique-rpc = { default-features = false, path = "../rpc" }
-uc-rpc = { default-features = false, path = "../../client/rpc" }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
-rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
[features]
default = ["opal-runtime"]
-runtime-benchmarks = [
- 'unique-runtime?/runtime-benchmarks',
- 'quartz-runtime?/runtime-benchmarks',
- 'opal-runtime/runtime-benchmarks',
- 'polkadot-service/runtime-benchmarks',
- 'polkadot-cli/runtime-benchmarks',
- 'sc-service/runtime-benchmarks',
+pov-estimate = [
+ 'opal-runtime/pov-estimate',
+ 'quartz-runtime?/pov-estimate',
+ 'uc-rpc/pov-estimate',
+ 'unique-rpc/pov-estimate',
+ 'unique-runtime?/pov-estimate',
]
-try-runtime = [
- 'unique-runtime?/try-runtime',
- 'quartz-runtime?/try-runtime',
- 'opal-runtime?/try-runtime',
- 'try-runtime-cli/try-runtime',
+runtime-benchmarks = [
+ 'opal-runtime/runtime-benchmarks',
+ 'polkadot-cli/runtime-benchmarks',
+ 'polkadot-service/runtime-benchmarks',
+ 'quartz-runtime?/runtime-benchmarks',
+ 'sc-service/runtime-benchmarks',
+ 'unique-runtime?/runtime-benchmarks',
]
sapphire-runtime = ['quartz-runtime', 'quartz-runtime/become-sapphire']
-pov-estimate = [
- 'unique-runtime?/pov-estimate',
- 'quartz-runtime?/pov-estimate',
- 'opal-runtime/pov-estimate',
- 'uc-rpc/pov-estimate',
- 'unique-rpc/pov-estimate',
+try-runtime = [
+ 'opal-runtime?/try-runtime',
+ 'quartz-runtime?/try-runtime',
+ 'try-runtime-cli/try-runtime',
+ 'unique-runtime?/try-runtime',
]
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -1,69 +1,48 @@
[package]
-name = "unique-rpc"
-version = "0.1.2"
authors = ['Unique Network <support@uniquenetwork.io>']
-license = 'GPLv3'
+description = "Unique chain rpc"
edition = "2021"
-description = "Unique chain rpc"
+license = 'GPLv3'
+name = "unique-rpc"
+version = "0.1.2"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-futures = { version = "0.3.17", features = ["compat"] }
-jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
+jsonrpsee = { version = "0.16.2", features = ["macros", "server"] }
# pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-tokio = { version = "1.19.2", features = ["macros", "sync"] }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = "../../pallets/common" }
-up-common = { path = "../../primitives/common" }
-pallet-unique = { path = "../../pallets/unique" }
-uc-rpc = { path = "../../client/rpc" }
-up-rpc = { path = "../../primitives/rpc" }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc" }
-rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
-up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc" }
+app-promotion-rpc.path = "../../primitives/app_promotion_rpc"
+rmrk-rpc.path = "../../primitives/rmrk-rpc"
+serde = { features = ['derive'], version = "1.0.130" }
+uc-rpc.path = "../../client/rpc"
+up-common.path = "../../primitives/common"
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
-
-[dependencies.serde]
-features = ['derive']
-version = '1.0.130'
+up-pov-estimate-rpc.path = "../../primitives/pov-estimate-rpc"
+up-rpc.path = "../../primitives/rpc"
[features]
default = []
+pov-estimate = ['uc-rpc/pov-estimate']
std = []
unique-runtime = []
-pov-estimate = ['uc-rpc/pov-estimate']
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -15,63 +15,52 @@
targets = ['x86_64-unknown-linux-gnu']
[features]
-default = ['std',]
+default = ['std']
runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
- # 'pallet-unique/runtime-benchmarks',
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system/runtime-benchmarks',
+ # 'pallet-unique/runtime-benchmarks',
]
std = [
- 'codec/std',
- 'frame-benchmarking/std',
- 'frame-support/std',
- 'frame-system/std',
- 'pallet-balances/std',
- 'pallet-timestamp/std',
- 'pallet-randomness-collective-flip/std',
- 'pallet-evm/std',
- 'sp-io/std',
- 'sp-std/std',
- 'sp-runtime/std',
- 'sp-core/std',
- 'serde/std',
+ 'codec/std',
+ 'frame-benchmarking/std',
+ 'frame-support/std',
+ 'frame-system/std',
+ 'pallet-balances/std',
+ 'pallet-evm/std',
+ 'sp-core/std',
+ 'sp-runtime/std',
+ 'sp-std/std',
]
try-runtime = ["frame-support/try-runtime"]
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
################################################################################
# Substrate Dependencies
-codec = { default-features = false, features = [
- 'derive',
-], package = 'parity-scale-codec', version = '3.1.2' }
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-serde = { default-features = false, features = ['derive'], version = '1.0.130' }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
################################################################################
# local dependencies
-up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
pallet-common = { default-features = false, path = "../common" }
pallet-configuration = { default-features = false, path = "../configuration" }
-pallet-unique = { default-features = false, path = "../unique" }
pallet-evm-contract-helpers = { default-features = false, path = "../evm-contract-helpers" }
pallet-evm-migration = { default-features = false, path = "../evm-migration" }
+pallet-unique = { default-features = false, path = "../unique" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
# [dev-dependencies]
pallets/collator-selection/Cargo.tomldiffbeforeafterboth--- a/pallets/collator-selection/Cargo.toml
+++ b/pallets/collator-selection/Cargo.toml
@@ -1,43 +1,43 @@
[package]
-name = "pallet-collator-selection"
-version = "4.0.0"
+authors = ["Parity Technologies <admin@parity.io>", "Unique Network <support@uniquenetwork.io>"]
description = "Simple staking pallet with a fixed stake."
-authors = ["Parity Technologies <admin@parity.io>", "Unique Network <support@uniquenetwork.io>"]
edition = "2021"
homepage = "https://unique.network"
-repository = "https://github.com/UniqueNetwork/unique-chain"
license = "GPLv3"
+name = "pallet-collator-selection"
+repository = "https://github.com/UniqueNetwork/unique-chain"
+version = "4.0.0"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-log = { version = "0.4.17", default-features = false }
codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.0.0" }
+log = { version = "0.4.17", default-features = false }
rand = { version = "0.8.5", features = ["std_rng"], default-features = false }
scale-info = { version = "2.2.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.145", default-features = false }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-configuration = { default-features = false, path = "../configuration" }
pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-configuration = { default-features = false, path = "../configuration" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[dev-dependencies]
+pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
@@ -48,17 +48,17 @@
]
std = [
"codec/std",
+ "frame-benchmarking/std",
+ "frame-support/std",
+ "frame-system/std",
"log/std",
- "scale-info/std",
+ "pallet-authorship/std",
+ "pallet-session/std",
"rand/std",
+ "scale-info/std",
"sp-runtime/std",
"sp-staking/std",
"sp-std/std",
- "frame-support/std",
- "frame-system/std",
- "frame-benchmarking/std",
- "pallet-authorship/std",
- "pallet-session/std",
]
-try-runtime = [ "frame-support/try-runtime" ]
+try-runtime = ["frame-support/try-runtime"]
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -1,50 +1,37 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-common"
version = "0.1.12"
-license = "GPLv3"
-edition = "2021"
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
+[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
-[dependencies]
+ethereum = { version = "0.14.0", default-features = false }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-ethereum = { version = "0.14.0", default-features = false }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
up-pov-estimate-rpc = { default-features = false, path = "../../primitives/pov-estimate-rpc" }
-serde = { version = "1.0.130", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-
[features]
default = ["std"]
+runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "up-data-structs/runtime-benchmarks"]
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "fp-evm-mapping/std",
- "up-data-structs/std",
- "pallet-evm/std",
- "up-pov-estimate-rpc/std",
-]
-runtime-benchmarks = [
- "frame-benchmarking/runtime-benchmarks",
- "up-data-structs/runtime-benchmarks",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-evm/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ "up-pov-estimate-rpc/std",
]
-try-runtime = ["frame-support/try-runtime"]
stubgen = ["evm-coder/stubgen"]
+try-runtime = ["frame-support/try-runtime"]
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -28,8 +28,8 @@
use sp_std::{vec, vec::Vec};
use sp_core::U256;
use up_data_structs::{
- AccessMode, CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property,
- SponsoringRateLimit, SponsorshipState,
+ CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property, SponsoringRateLimit,
+ SponsorshipState,
};
use crate::{
pallets/common/src/eth.rsdiffbeforeafterboth--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -80,10 +80,7 @@
if cross_account_id.is_canonical_substrate() {
Self::from_sub::<T>(cross_account_id.as_sub())
} else {
- Self {
- eth: *cross_account_id.as_eth(),
- sub: Default::default(),
- }
+ Self::from_eth(*cross_account_id.as_eth())
}
}
/// Creates [`CrossAddress`] from Substrate account.
@@ -97,6 +94,13 @@
sub: U256::from_big_endian(account_id.as_ref()),
}
}
+ /// Creates [`CrossAddress`] from Ethereum account.
+ pub fn from_eth(address: Address) -> Self {
+ Self {
+ eth: address,
+ sub: Default::default(),
+ }
+ }
/// Converts [`CrossAddress`] to `CrossAccountId`.
pub fn into_sub_cross_account<T>(&self) -> evm_coder::execution::Result<T::CrossAccountId>
where
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -100,6 +100,7 @@
PropertyValue,
PropertyPermission,
PropertiesError,
+ TokenOwnerError,
PropertyKeyPermission,
TokenData,
TrySetProperty,
@@ -2134,7 +2135,7 @@
/// Get the owner of the token.
///
/// * `token` - The token for which you need to find out the owner.
- fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;
+ fn token_owner(&self, token: TokenId) -> Result<T::CrossAccountId, TokenOwnerError>;
/// Returns 10 tokens owners in no particular order.
///
pallets/configuration/Cargo.tomldiffbeforeafterboth--- a/pallets/configuration/Cargo.toml
+++ b/pallets/configuration/Cargo.toml
@@ -1,38 +1,32 @@
[package]
+edition = "2021"
name = "pallet-configuration"
version = "0.1.3"
-edition = "2021"
[dependencies]
-parity-scale-codec = { version = "3.1.5", features = [
- "derive",
-], default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+parity-scale-codec = { version = "3.2.2", features = ["derive"], default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+smallvec = "1.6.1"
+sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-smallvec = "1.6.1"
xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
[features]
default = ["std"]
runtime-benchmarks = ["frame-benchmarking"]
std = [
- "parity-scale-codec/std",
+ "fp-evm/std",
+ "frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
- "frame-benchmarking/std",
- "sp-runtime/std",
+ "parity-scale-codec/std",
+ "sp-arithmetic/std",
+ "sp-core/std",
"sp-std/std",
- "sp-core/std",
- "sp-arithmetic/std",
- "fp-evm/std",
]
try-runtime = ["frame-support/try-runtime"]
pallets/configuration/src/weights.rsdiffbeforeafterboth--- a/pallets/configuration/src/weights.rs
+++ b/pallets/configuration/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_configuration
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-28, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -48,37 +48,37 @@
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Configuration WeightToFeeCoefficientOverride (r:0 w:1)
fn set_weight_to_fee_coefficient_override() -> Weight {
- Weight::from_ref_time(5_691_000 as u64)
+ Weight::from_ref_time(4_756_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration MinGasPriceOverride (r:0 w:1)
fn set_min_gas_price_override() -> Weight {
- Weight::from_ref_time(5_521_000 as u64)
+ Weight::from_ref_time(4_754_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration XcmAllowedLocationsOverride (r:0 w:1)
fn set_xcm_allowed_locations() -> Weight {
- Weight::from_ref_time(6_091_000 as u64)
+ Weight::from_ref_time(4_875_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration AppPromomotionConfigurationOverride (r:0 w:1)
fn set_app_promotion_configuration_override() -> Weight {
- Weight::from_ref_time(6_241_000 as u64)
+ Weight::from_ref_time(4_832_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:0 w:1)
fn set_collator_selection_desired_collators() -> Weight {
- Weight::from_ref_time(25_298_000 as u64)
+ Weight::from_ref_time(18_337_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionLicenseBondOverride (r:0 w:1)
fn set_collator_selection_license_bond() -> Weight {
- Weight::from_ref_time(18_675_000 as u64)
+ Weight::from_ref_time(14_806_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionKickThresholdOverride (r:0 w:1)
fn set_collator_selection_kick_threshold() -> Weight {
- Weight::from_ref_time(18_044_000 as u64)
+ Weight::from_ref_time(14_524_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
@@ -87,37 +87,37 @@
impl WeightInfo for () {
// Storage: Configuration WeightToFeeCoefficientOverride (r:0 w:1)
fn set_weight_to_fee_coefficient_override() -> Weight {
- Weight::from_ref_time(5_691_000 as u64)
+ Weight::from_ref_time(4_756_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration MinGasPriceOverride (r:0 w:1)
fn set_min_gas_price_override() -> Weight {
- Weight::from_ref_time(5_521_000 as u64)
+ Weight::from_ref_time(4_754_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration XcmAllowedLocationsOverride (r:0 w:1)
fn set_xcm_allowed_locations() -> Weight {
- Weight::from_ref_time(6_091_000 as u64)
+ Weight::from_ref_time(4_875_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration AppPromomotionConfigurationOverride (r:0 w:1)
fn set_app_promotion_configuration_override() -> Weight {
- Weight::from_ref_time(6_241_000 as u64)
+ Weight::from_ref_time(4_832_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:0 w:1)
fn set_collator_selection_desired_collators() -> Weight {
- Weight::from_ref_time(25_298_000 as u64)
+ Weight::from_ref_time(18_337_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionLicenseBondOverride (r:0 w:1)
fn set_collator_selection_license_bond() -> Weight {
- Weight::from_ref_time(18_675_000 as u64)
+ Weight::from_ref_time(14_806_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Configuration CollatorSelectionKickThresholdOverride (r:0 w:1)
fn set_collator_selection_kick_threshold() -> Weight {
- Weight::from_ref_time(18_044_000 as u64)
+ Weight::from_ref_time(14_524_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
}
pallets/evm-coder-substrate/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-coder-substrate/Cargo.toml
+++ b/pallets/evm-coder-substrate/Cargo.toml
@@ -1,42 +1,32 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-evm-coder-substrate"
version = "0.1.3"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-ethereum = { version = "0.14.0", default-features = false }
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.2.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
evm-coder = { default-features = false, path = "../../crates/evm-coder" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
[features]
default = ["std"]
+runtime-benchmarks = ['frame-benchmarking']
std = [
- "sp-std/std",
- "sp-core/std",
- "ethereum/std",
- "evm-coder/std",
- "pallet-ethereum/std",
- "pallet-evm/std",
- "frame-support/std",
- "frame-system/std",
- 'frame-benchmarking/std',
+ "evm-coder/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-evm/std",
+ "sp-core/std",
+ "sp-std/std",
+ 'frame-benchmarking/std',
]
-runtime-benchmarks = ['frame-benchmarking']
try-runtime = ["frame-support/try-runtime"]
pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -1,56 +1,42 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-evm-contract-helpers"
version = "0.3.0"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-log = { default-features = false, version = "0.4.14" }
-ethereum = { version = "0.14.0", default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
# Substrate
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
# Unique
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
# Locals
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-common = { default-features = false, path = '../../pallets/common' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
-pallet-evm-transaction-payment = { default-features = false, path = '../../pallets/evm-transaction-payment' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = [
- 'serde1',
-] }
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+pallet-common = { default-features = false, path = "../../pallets/common" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+pallet-evm-transaction-payment = { default-features = false, path = "../../pallets/evm-transaction-payment" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs", features = ['serde1'] }
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
[features]
default = ["std"]
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "sp-core/std",
- "evm-coder/std",
- "pallet-evm-coder-substrate/std",
- "pallet-evm/std",
- "up-sponsorship/std",
- "pallet-common/std",
+ "evm-coder/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm-coder-substrate/std",
+ "pallet-evm/std",
+ "sp-core/std",
+ "sp-std/std",
+ "up-sponsorship/std",
]
-try-runtime = ["frame-support/try-runtime"]
stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
+try-runtime = ["frame-support/try-runtime"]
pallets/evm-migration/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-migration/Cargo.toml
+++ b/pallets/evm-migration/Cargo.toml
@@ -1,42 +1,22 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-evm-migration"
version = "0.1.1"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
ethereum = { version = "0.14.0", default-features = false }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
-default = ["std", "runtime-benchmarks"]
-std = [
- "frame-support/std",
- "frame-system/std",
- "frame-benchmarking/std",
- "sp-runtime/std",
- "sp-std/std",
- "sp-io/std",
- "sp-core/std",
- "pallet-evm/std",
- "fp-evm/std",
-]
+default = ["runtime-benchmarks", "std"]
runtime-benchmarks = ["frame-benchmarking"]
+std = ["frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "sp-core/std", "sp-std/std"]
try-runtime = ["frame-support/try-runtime"]
pallets/evm-migration/src/weights.rsdiffbeforeafterboth--- a/pallets/evm-migration/src/weights.rs
+++ b/pallets/evm-migration/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_evm_migration
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -48,37 +48,35 @@
// Storage: System Account (r:1 w:0)
// Storage: EVM AccountCodes (r:1 w:0)
fn begin() -> Weight {
- Weight::from_ref_time(15_073_000 as u64)
+ Weight::from_ref_time(15_553_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: EvmMigration MigrationPending (r:1 w:0)
// Storage: EVM AccountStorages (r:0 w:1)
fn set_data(b: u32, ) -> Weight {
- Weight::from_ref_time(7_943_438 as u64)
- // Standard Error: 1_792
- .saturating_add(Weight::from_ref_time(960_230 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(8_826_376 as u64)
+ // Standard Error: 1_575
+ .saturating_add(Weight::from_ref_time(953_367 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64)))
}
// Storage: EvmMigration MigrationPending (r:1 w:1)
// Storage: EVM AccountCodes (r:0 w:1)
- fn finish(b: u32, ) -> Weight {
- Weight::from_ref_time(9_316_585 as u64)
- // Standard Error: 595
- .saturating_add(Weight::from_ref_time(2_082 as u64).saturating_mul(b as u64))
+ fn finish(_b: u32, ) -> Weight {
+ Weight::from_ref_time(9_382_842 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
fn insert_eth_logs(b: u32, ) -> Weight {
- Weight::from_ref_time(6_570_767 as u64)
- // Standard Error: 2_292
- .saturating_add(Weight::from_ref_time(722_345 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(8_647_347 as u64)
+ // Standard Error: 1_360
+ .saturating_add(Weight::from_ref_time(736_935 as u64).saturating_mul(b as u64))
}
fn insert_events(b: u32, ) -> Weight {
- Weight::from_ref_time(10_936_376 as u64)
- // Standard Error: 1_227
- .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(12_275_370 as u64)
+ // Standard Error: 1_243
+ .saturating_add(Weight::from_ref_time(1_269_025 as u64).saturating_mul(b as u64))
}
}
@@ -88,36 +86,34 @@
// Storage: System Account (r:1 w:0)
// Storage: EVM AccountCodes (r:1 w:0)
fn begin() -> Weight {
- Weight::from_ref_time(15_073_000 as u64)
+ Weight::from_ref_time(15_553_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: EvmMigration MigrationPending (r:1 w:0)
// Storage: EVM AccountStorages (r:0 w:1)
fn set_data(b: u32, ) -> Weight {
- Weight::from_ref_time(7_943_438 as u64)
- // Standard Error: 1_792
- .saturating_add(Weight::from_ref_time(960_230 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(8_826_376 as u64)
+ // Standard Error: 1_575
+ .saturating_add(Weight::from_ref_time(953_367 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(b as u64)))
}
// Storage: EvmMigration MigrationPending (r:1 w:1)
// Storage: EVM AccountCodes (r:0 w:1)
- fn finish(b: u32, ) -> Weight {
- Weight::from_ref_time(9_316_585 as u64)
- // Standard Error: 595
- .saturating_add(Weight::from_ref_time(2_082 as u64).saturating_mul(b as u64))
+ fn finish(_b: u32, ) -> Weight {
+ Weight::from_ref_time(9_382_842 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
fn insert_eth_logs(b: u32, ) -> Weight {
- Weight::from_ref_time(6_570_767 as u64)
- // Standard Error: 2_292
- .saturating_add(Weight::from_ref_time(722_345 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(8_647_347 as u64)
+ // Standard Error: 1_360
+ .saturating_add(Weight::from_ref_time(736_935 as u64).saturating_mul(b as u64))
}
fn insert_events(b: u32, ) -> Weight {
- Weight::from_ref_time(10_936_376 as u64)
- // Standard Error: 1_227
- .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(12_275_370 as u64)
+ // Standard Error: 1_243
+ .saturating_add(Weight::from_ref_time(1_269_025 as u64).saturating_mul(b as u64))
}
}
pallets/evm-transaction-payment/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-transaction-payment/Cargo.toml
+++ b/pallets/evm-transaction-payment/Cargo.toml
@@ -1,44 +1,32 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-evm-transaction-payment"
version = "0.1.1"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
[features]
default = ["std"]
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "sp-io/std",
- "sp-core/std",
- "pallet-evm/std",
- "pallet-ethereum/std",
- "fp-evm/std",
- "up-sponsorship/std",
- "fp-evm-mapping/std",
+ "fp-evm/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-evm/std",
+ "sp-core/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-sponsorship/std",
]
try-runtime = ["frame-support/try-runtime"]
pallets/foreign-assets/Cargo.tomldiffbeforeafterboth--- a/pallets/foreign-assets/Cargo.toml
+++ b/pallets/foreign-assets/Cargo.toml
@@ -1,54 +1,53 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-foreign-assets"
version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
[dependencies]
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
log = { version = "0.4.16", default-features = false }
+orml-tokens.workspace = true
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
+pallet-common = { default-features = false, path = "../common" }
+pallet-fungible = { default-features = false, path = "../fungible" }
serde = { version = "1.0.136", optional = true }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
-frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
-frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
-pallet-common = { default-features = false, path = '../common' }
-pallet-fungible = { default-features = false, path = '../fungible' }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
-xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
-orml-tokens.workspace = true
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[dev-dependencies]
+hex = "0.4"
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
serde_json = "1.0.68"
-hex = { version = "0.4" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
+runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
std = [
- "serde",
- "log/std",
"codec/std",
- "scale-info/std",
- "sp-runtime/std",
- "sp-std/std",
"frame-support/std",
"frame-system/std",
- "up-data-structs/std",
- "pallet-common/std",
+ "log/std",
+ "orml-tokens/std",
"pallet-balances/std",
+ "pallet-common/std",
"pallet-fungible/std",
- "orml-tokens/std",
+ "scale-info/std",
+ "serde",
+ "sp-io/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
]
try-runtime = ["frame-support/try-runtime"]
-runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
pallets/foreign-assets/src/weights.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/weights.rs
+++ b/pallets/foreign-assets/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_foreign_assets
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -53,14 +53,14 @@
// Storage: Common CollectionProperties (r:0 w:1)
// Storage: Common CollectionById (r:0 w:1)
fn register_foreign_asset() -> Weight {
- Weight::from_ref_time(54_196_000 as u64)
+ Weight::from_ref_time(53_122_000 as u64)
.saturating_add(T::DbWeight::get().reads(9 as u64))
.saturating_add(T::DbWeight::get().writes(11 as u64))
}
// Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
// Storage: ForeignAssets AssetMetadatas (r:1 w:1)
fn update_foreign_asset() -> Weight {
- Weight::from_ref_time(23_719_000 as u64)
+ Weight::from_ref_time(23_796_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
@@ -80,14 +80,14 @@
// Storage: Common CollectionProperties (r:0 w:1)
// Storage: Common CollectionById (r:0 w:1)
fn register_foreign_asset() -> Weight {
- Weight::from_ref_time(54_196_000 as u64)
+ Weight::from_ref_time(53_122_000 as u64)
.saturating_add(RocksDbWeight::get().reads(9 as u64))
.saturating_add(RocksDbWeight::get().writes(11 as u64))
}
// Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
// Storage: ForeignAssets AssetMetadatas (r:1 w:1)
fn update_foreign_asset() -> Weight {
- Weight::from_ref_time(23_719_000 as u64)
+ Weight::from_ref_time(23_796_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
pallets/fungible/Cargo.tomldiffbeforeafterboth--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -1,49 +1,41 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-fungible"
version = "0.1.9"
-license = "GPLv3"
-edition = "2021"
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-common = { default-features = false, path = "../common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../evm-coder-substrate" }
+pallet-structure = { default-features = false, path = "../structure" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = '../common' }
-pallet-structure = { default-features = false, path = '../structure' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
-ethereum = { version = "0.14.0", default-features = false }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[features]
default = ["std"]
+runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
- "pallet-common/std",
- "pallet-structure/std",
- "evm-coder/std",
- "ethereum/std",
- "pallet-evm-coder-substrate/std",
- 'frame-benchmarking/std',
- "pallet-evm/std",
+ "evm-coder/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm-coder-substrate/std",
+ "pallet-evm/std",
+ "pallet-structure/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ 'frame-benchmarking/std',
]
-runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
-try-runtime = ["frame-support/try-runtime"]
stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
+try-runtime = ["frame-support/try-runtime"]
pallets/fungible/src/common.rsdiffbeforeafterboth--- a/pallets/fungible/src/common.rs
+++ b/pallets/fungible/src/common.rs
@@ -17,7 +17,9 @@
use core::marker::PhantomData;
use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight, traits::Get};
-use up_data_structs::{TokenId, CollectionId, CreateItemExData, budget::Budget, CreateItemData};
+use up_data_structs::{
+ TokenId, CollectionId, CreateItemExData, budget::Budget, CreateItemData, TokenOwnerError,
+};
use pallet_common::{
CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight,
weights::WeightInfo as _,
@@ -404,8 +406,8 @@
TokenId::default()
}
- fn token_owner(&self, _token: TokenId) -> Option<T::CrossAccountId> {
- None
+ fn token_owner(&self, _token: TokenId) -> Result<T::CrossAccountId, TokenOwnerError> {
+ Err(TokenOwnerError::MultipleOwners)
}
/// Returns 10 tokens owners in no particular order.
pallets/fungible/src/weights.rsdiffbeforeafterboth--- a/pallets/fungible/src/weights.rs
+++ b/pallets/fungible/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_fungible
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -50,16 +50,16 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(19_626_000 as u64)
+ Weight::from_ref_time(20_203_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:4 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- Weight::from_ref_time(22_364_107 as u64)
- // Standard Error: 6_123
- .saturating_add(Weight::from_ref_time(3_608_476 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(19_426_730 as u64)
+ // Standard Error: 5_132
+ .saturating_add(Weight::from_ref_time(3_579_196 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(1 as u64))
@@ -68,34 +68,34 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn burn_item() -> Weight {
- Weight::from_ref_time(21_886_000 as u64)
+ Weight::from_ref_time(21_871_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Fungible Balance (r:2 w:2)
fn transfer() -> Weight {
- Weight::from_ref_time(23_827_000 as u64)
+ Weight::from_ref_time(22_677_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Fungible Balance (r:1 w:0)
// Storage: Fungible Allowance (r:0 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(21_626_000 as u64)
+ Weight::from_ref_time(22_109_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Fungible Balance (r:1 w:0)
// Storage: Fungible Allowance (r:0 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(19_817_000 as u64)
+ Weight::from_ref_time(22_434_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Fungible Allowance (r:1 w:1)
// Storage: Fungible Balance (r:2 w:2)
fn transfer_from() -> Weight {
- Weight::from_ref_time(31_398_000 as u64)
+ Weight::from_ref_time(31_777_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
@@ -103,7 +103,7 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(30_499_000 as u64)
+ Weight::from_ref_time(32_101_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
@@ -114,16 +114,16 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(19_626_000 as u64)
+ Weight::from_ref_time(20_203_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:4 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- Weight::from_ref_time(22_364_107 as u64)
- // Standard Error: 6_123
- .saturating_add(Weight::from_ref_time(3_608_476 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(19_426_730 as u64)
+ // Standard Error: 5_132
+ .saturating_add(Weight::from_ref_time(3_579_196 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
@@ -132,34 +132,34 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn burn_item() -> Weight {
- Weight::from_ref_time(21_886_000 as u64)
+ Weight::from_ref_time(21_871_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Fungible Balance (r:2 w:2)
fn transfer() -> Weight {
- Weight::from_ref_time(23_827_000 as u64)
+ Weight::from_ref_time(22_677_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Fungible Balance (r:1 w:0)
// Storage: Fungible Allowance (r:0 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(21_626_000 as u64)
+ Weight::from_ref_time(22_109_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Fungible Balance (r:1 w:0)
// Storage: Fungible Allowance (r:0 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(19_817_000 as u64)
+ Weight::from_ref_time(22_434_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Fungible Allowance (r:1 w:1)
// Storage: Fungible Balance (r:2 w:2)
fn transfer_from() -> Weight {
- Weight::from_ref_time(31_398_000 as u64)
+ Weight::from_ref_time(31_777_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
}
@@ -167,7 +167,7 @@
// Storage: Fungible TotalSupply (r:1 w:1)
// Storage: Fungible Balance (r:1 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(30_499_000 as u64)
+ Weight::from_ref_time(32_101_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
}
pallets/identity/Cargo.tomldiffbeforeafterboth--- a/pallets/identity/Cargo.toml
+++ b/pallets/identity/Cargo.toml
@@ -1,24 +1,27 @@
[package]
-name = "pallet-identity"
-version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>", "Unique Network <support@uniquenetwork.io>"]
+description = "FRAME identity management pallet"
edition = "2021"
+homepage = "https://substrate.io"
license = "Apache-2.0"
-homepage = "https://substrate.io"
-repository = "https://github.com/paritytech/substrate/"
-description = "FRAME identity management pallet"
+name = "pallet-identity"
readme = "README.md"
+repository = "https://github.com/paritytech/substrate/"
+version = "4.0.0-dev"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
-enumflags2 = { version = "0.7.4" }
-scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
+ "derive",
+ "max-encoded-len",
+] }
+enumflags2 = "0.7.4"
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
sp-io = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
@@ -29,6 +32,11 @@
[features]
default = ["std"]
+runtime-benchmarks = [
+ "frame-benchmarking/runtime-benchmarks",
+ "frame-support/runtime-benchmarks",
+ "frame-system/runtime-benchmarks",
+]
std = [
"codec/std",
"frame-benchmarking?/std",
@@ -38,10 +46,5 @@
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
-]
-runtime-benchmarks = [
- "frame-benchmarking/runtime-benchmarks",
- "frame-support/runtime-benchmarks",
- "frame-system/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
pallets/identity/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/identity/src/benchmarking.rs
+++ b/pallets/identity/src/benchmarking.rs
@@ -417,7 +417,7 @@
let n in 0..600;
use frame_benchmarking::account;
let identities = (0..n).map(|i| (
- account("caller", i, 0),
+ account("caller", i, SEED),
Registration::<BalanceOf<T>, T::MaxRegistrars, T::MaxAdditionalFields> {
judgements: Default::default(),
deposit: Default::default(),
@@ -433,7 +433,7 @@
use frame_benchmarking::account;
let origin = T::ForceOrigin::successful_origin();
let identities = (0..n).map(|i| (
- account("caller", i, 0),
+ account("caller", i, SEED),
Registration::<BalanceOf<T>, T::MaxRegistrars, T::MaxAdditionalFields> {
judgements: Default::default(),
deposit: Default::default(),
@@ -446,6 +446,23 @@
let identities = identities.into_iter().map(|(acc, _)| acc).collect::<Vec<_>>();
}: _<T::RuntimeOrigin>(origin, identities)
+ force_set_subs {
+ let s in 0 .. T::MaxSubAccounts::get();
+ let n in 0..600;
+ use frame_benchmarking::account;
+ let identities = (0..n).map(|i| {
+ let caller: T::AccountId = account("caller", i, SEED);
+ (
+ caller.clone(),
+ (
+ BalanceOf::<T>::max_value(),
+ create_sub_accounts::<T>(&caller, s).unwrap().try_into().unwrap(),
+ ),
+ )
+ }).collect::<Vec<_>>();
+ let origin = T::ForceOrigin::successful_origin();
+ }: _<T::RuntimeOrigin>(origin, identities)
+
add_sub {
let s in 0 .. T::MaxSubAccounts::get() - 1;
pallets/identity/src/lib.rsdiffbeforeafterboth--- a/pallets/identity/src/lib.rs
+++ b/pallets/identity/src/lib.rs
@@ -314,6 +314,8 @@
main: T::AccountId,
deposit: BalanceOf<T>,
},
+ /// A number of identities were forcibly updated with new sub-identities.
+ SubIdentitiesInserted { amount: u32 },
}
#[pallet::call]
@@ -1137,13 +1139,64 @@
) -> DispatchResult {
T::ForceOrigin::ensure_origin(origin)?;
for identity in identities.clone() {
- IdentityOf::<T>::set(identity, None);
+ let (_, sub_ids) = <SubsOf<T>>::take(&identity);
+ <IdentityOf<T>>::remove(&identity);
+ for sub in sub_ids.iter() {
+ <SuperOf<T>>::remove(sub);
+ }
}
Self::deposit_event(Event::IdentitiesRemoved {
amount: identities.len() as u32,
});
Ok(())
}
+
+ /// Set sub-identities to be associated with the provided accounts as force origin.
+ ///
+ /// This is not meant to operate in tandem with the identity pallet as is,
+ /// and be instead used to keep identities made and verified externally,
+ /// forbidden from interacting with an ordinary user, since it ignores any safety mechanism.
+ #[pallet::call_index(17)]
+ #[pallet::weight(T::WeightInfo::force_set_subs(
+ T::MaxSubAccounts::get(), // S
+ subs.len() as u32, // N
+ ))]
+ pub fn force_set_subs(
+ origin: OriginFor<T>,
+ subs: Vec<(
+ T::AccountId,
+ (
+ BalanceOf<T>,
+ BoundedVec<(T::AccountId, Data), T::MaxSubAccounts>,
+ ),
+ )>,
+ ) -> DispatchResult {
+ T::ForceOrigin::ensure_origin(origin)?;
+ for identity in subs.clone() {
+ let account = identity.0;
+ let (_, old_subs) = <SubsOf<T>>::get(&account);
+ for old_sub in old_subs {
+ <SuperOf<T>>::remove(old_sub);
+ }
+
+ let mut ids = BoundedVec::<T::AccountId, T::MaxSubAccounts>::default();
+ for (id, name) in identity.1 .1 {
+ <SuperOf<T>>::insert(&id, (account.clone(), name));
+ ids.try_push(id)
+ .expect("subs length is less than T::MaxSubAccounts; qed");
+ }
+
+ if ids.is_empty() {
+ <SubsOf<T>>::remove(&account);
+ } else {
+ <SubsOf<T>>::insert(account, (identity.1 .0, ids));
+ }
+ }
+ Self::deposit_event(Event::SubIdentitiesInserted {
+ amount: subs.len() as u32,
+ });
+ Ok(())
+ }
}
}
pallets/identity/src/weights.rsdiffbeforeafterboth--- a/pallets/identity/src/weights.rs
+++ b/pallets/identity/src/weights.rs
@@ -78,6 +78,7 @@
fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight;
fn force_insert_identities(x: u32, n: u32, ) -> Weight;
fn force_remove_identities(x: u32, n: u32, ) -> Weight;
+ fn force_set_subs(s: u32, n: u32, ) -> Weight;
fn add_sub(s: u32, ) -> Weight;
fn rename_sub(s: u32, ) -> Weight;
fn remove_sub(s: u32, ) -> Weight;
@@ -273,6 +274,20 @@
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64).saturating_mul(n as u64))
}
+ // Storage: Identity IdentityOf (r:1 w:1)
+ // todo:collator
+ /// The range of component `s` is `[0, 100]`.
+ /// The range of component `n` is `[0, 600]`.
+ fn force_set_subs(s: u32, n: u32) -> Weight {
+ // Minimum execution time: 41_872 nanoseconds.
+ Weight::from_ref_time(40_230_216 as u64)
+ // Standard Error: 2_342
+ .saturating_add(Weight::from_ref_time(145_168 as u64))
+ // Standard Error: 457
+ .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(s as u64))
+ .saturating_add(T::DbWeight::get().reads(1 as u64))
+ .saturating_add(T::DbWeight::get().writes(1 as u64).saturating_mul(n as u64))
+ }
// Storage: Identity IdentityOf (r:1 w:0)
// Storage: Identity SuperOf (r:1 w:1)
// Storage: Identity SubsOf (r:1 w:1)
@@ -509,6 +524,20 @@
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64).saturating_mul(n as u64))
}
+ // Storage: Identity IdentityOf (r:1 w:1)
+ // todo:collator
+ /// The range of component `xs is `[0, 100]`.
+ /// The range of component `n` is `[0, 600]`.
+ fn force_set_subs(s: u32, n: u32) -> Weight {
+ // Minimum execution time: 41_872 nanoseconds.
+ Weight::from_ref_time(40_230_216 as u64)
+ // Standard Error: 2_342
+ .saturating_add(Weight::from_ref_time(145_168 as u64))
+ // Standard Error: 457
+ .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(s as u64))
+ .saturating_add(RocksDbWeight::get().reads(1 as u64))
+ .saturating_add(RocksDbWeight::get().writes(1 as u64).saturating_mul(n as u64))
+ }
// Storage: Identity IdentityOf (r:1 w:0)
// Storage: Identity SuperOf (r:1 w:1)
// Storage: Identity SubsOf (r:1 w:1)
pallets/inflation/Cargo.tomldiffbeforeafterboth--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -18,85 +18,25 @@
default = ['std']
runtime-benchmarks = ['frame-benchmarking']
std = [
- 'codec/std',
- 'serde/std',
- 'frame-support/std',
- 'frame-system/std',
- 'pallet-balances/std',
- 'pallet-timestamp/std',
- 'pallet-randomness-collective-flip/std',
- 'sp-std/std',
- 'sp-runtime/std',
- 'frame-benchmarking/std',
+ 'codec/std',
+ 'frame-benchmarking/std',
+ 'frame-support/std',
+ 'frame-system/std',
+ 'pallet-balances/std',
+ 'sp-runtime/std',
+ 'sp-std/std',
]
try-runtime = ["frame-support/try-runtime"]
-################################################################################
-# Substrate Dependencies
+[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-default-features = false
-optional = true
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-balances]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-timestamp]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-randomness-collective-flip]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.serde]
-default-features = false
-features = ['derive']
-version = '1.0.130'
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallets/maintenance/Cargo.tomldiffbeforeafterboth--- a/pallets/maintenance/Cargo.toml
+++ b/pallets/maintenance/Cargo.toml
@@ -1,39 +1,25 @@
[package]
-name = "pallet-maintenance"
-version = "0.1.0"
authors = ["Unique Network <support@uniquenetwork.io>"]
+description = "Unique Maintenance pallet"
edition = "2021"
+homepage = "https://unique.network"
license = "GPLv3"
-homepage = "https://unique.network"
+name = "pallet-maintenance"
+readme = "README.md"
repository = "https://github.com/UniqueNetwork/unique-chain"
-description = "Unique Maintenance pallet"
-readme = "README.md"
+version = "0.1.0"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
- "derive",
-] }
-scale-info = { version = "2.1.1", default-features = false, features = [
- "derive",
-] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
+
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
-std = [
- "codec/std",
- "scale-info/std",
- "frame-support/std",
- "frame-system/std",
- "frame-benchmarking/std",
- "sp-std/std",
-]
-runtime-benchmarks = [
- "frame-benchmarking",
- "frame-support/runtime-benchmarks",
- "frame-system/runtime-benchmarks",
-]
+runtime-benchmarks = ["frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks"]
+std = ["codec/std", "frame-benchmarking/std", "frame-support/std", "frame-system/std", "scale-info/std", "sp-std/std"]
try-runtime = ["frame-support/try-runtime"]
pallets/nonfungible/Cargo.tomldiffbeforeafterboth--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -1,55 +1,46 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-nonfungible"
version = "0.1.12"
-license = "GPLv3"
-edition = "2021"
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-common = { default-features = false, path = "../common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../evm-coder-substrate" }
+pallet-structure = { default-features = false, path = "../structure" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = '../common' }
-pallet-structure = { default-features = false, path = '../structure' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
-ethereum = { version = "0.14.0", default-features = false }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-struct-versioning = { path = "../../crates/struct-versioning" }
+struct-versioning.path = "../../crates/struct-versioning"
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[features]
default = ["std"]
-std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
- "pallet-common/std",
- "pallet-structure/std",
- "evm-coder/std",
- "ethereum/std",
- "pallet-evm-coder-substrate/std",
- 'frame-benchmarking/std',
- "pallet-evm/std",
-]
runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
- 'up-data-structs/runtime-benchmarks',
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system/runtime-benchmarks',
+ 'up-data-structs/runtime-benchmarks',
]
-try-runtime = ["frame-support/try-runtime"]
+std = [
+ "evm-coder/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm-coder-substrate/std",
+ "pallet-evm/std",
+ "pallet-structure/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ 'frame-benchmarking/std',
+]
stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
+try-runtime = ["frame-support/try-runtime"]
pallets/nonfungible/src/common.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -19,7 +19,7 @@
use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight};
use up_data_structs::{
TokenId, CreateItemExData, CollectionId, budget::Budget, Property, PropertyKey,
- PropertyKeyPermission, PropertyValue,
+ PropertyKeyPermission, PropertyValue, TokenOwnerError,
};
use pallet_common::{
CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight,
@@ -460,13 +460,15 @@
TokenId(<TokensMinted<T>>::get(self.id))
}
- fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId> {
- <TokenData<T>>::get((self.id, token)).map(|t| t.owner)
+ fn token_owner(&self, token: TokenId) -> Result<T::CrossAccountId, TokenOwnerError> {
+ <TokenData<T>>::get((self.id, token))
+ .map(|t| t.owner)
+ .ok_or(TokenOwnerError::NotFound)
}
/// Returns token owners.
fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {
- self.token_owner(token).map_or_else(|| vec![], |t| vec![t])
+ self.token_owner(token).map_or_else(|_| vec![], |t| vec![t])
}
fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option<PropertyValue> {
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -728,7 +728,7 @@
fn cross_owner_of(&self, token_id: U256) -> Result<eth::CrossAddress> {
Self::token_owner(&self, token_id.try_into()?)
.map(|o| eth::CrossAddress::from_sub_cross_account::<T>(&o))
- .ok_or(Error::Revert("key too large".into()))
+ .map_err(|_| Error::Revert("token not found".into()))
}
/// Returns the token properties.
pallets/nonfungible/src/weights.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/weights.rs
+++ b/pallets/nonfungible/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_nonfungible
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -59,37 +59,44 @@
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:1)
// Storage: Nonfungible Owned (r:0 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(26_377_000 as u64)
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
+ Weight::from_ref_time(34_815_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(4 as u64))
+ .saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(20_059_186 as u64)
- // Standard Error: 4_735
- .saturating_add(Weight::from_ref_time(4_856_306 as u64).saturating_mul(b as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
+ Weight::from_ref_time(18_772_483 as u64)
+ // Standard Error: 5_664
+ .saturating_add(Weight::from_ref_time(7_602_706 as u64).saturating_mul(b as u64))
+ .saturating_add(T::DbWeight::get().reads(3 as u64))
+ .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(2 as u64))
- .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64)))
+ .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
}
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:4 w:4)
+ // Storage: Nonfungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- Weight::from_ref_time(16_365_581 as u64)
- // Standard Error: 9_711
- .saturating_add(Weight::from_ref_time(6_681_940 as u64).saturating_mul(b as u64))
- .saturating_add(T::DbWeight::get().reads(1 as u64))
- .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
+ Weight::from_ref_time(15_449_226 as u64)
+ // Standard Error: 6_012
+ .saturating_add(Weight::from_ref_time(9_325_591 as u64).saturating_mul(b as u64))
+ .saturating_add(T::DbWeight::get().reads(2 as u64))
+ .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(1 as u64))
- .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
+ .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
}
// Storage: Nonfungible TokenData (r:1 w:1)
// Storage: Nonfungible TokenChildren (r:1 w:0)
@@ -99,7 +106,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_item() -> Weight {
- Weight::from_ref_time(33_502_000 as u64)
+ Weight::from_ref_time(35_221_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
@@ -111,7 +118,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_recursively_self_raw() -> Weight {
- Weight::from_ref_time(43_255_000 as u64)
+ Weight::from_ref_time(45_504_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
@@ -124,9 +131,9 @@
// Storage: Nonfungible TokenProperties (r:0 w:1)
// Storage: Common CollectionById (r:1 w:0)
fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight {
- Weight::from_ref_time(42_992_000 as u64)
- // Standard Error: 1_010_119
- .saturating_add(Weight::from_ref_time(209_972_755 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(45_539_000 as u64)
+ // Standard Error: 1_047_413
+ .saturating_add(Weight::from_ref_time(216_998_419 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().reads((4 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(6 as u64))
@@ -137,21 +144,21 @@
// Storage: Nonfungible Allowance (r:1 w:0)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer() -> Weight {
- Weight::from_ref_time(31_239_000 as u64)
+ Weight::from_ref_time(30_047_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(21_985_000 as u64)
+ Weight::from_ref_time(24_476_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(18_965_000 as u64)
+ Weight::from_ref_time(22_818_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
@@ -160,7 +167,7 @@
// Storage: Nonfungible AccountBalance (r:2 w:2)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer_from() -> Weight {
- Weight::from_ref_time(36_382_000 as u64)
+ Weight::from_ref_time(37_251_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
@@ -172,54 +179,54 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(42_046_000 as u64)
+ Weight::from_ref_time(43_202_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:1)
fn set_token_property_permissions(b: u32, ) -> Weight {
- Weight::from_ref_time(5_543_000 as u64)
- // Standard Error: 40_525
- .saturating_add(Weight::from_ref_time(12_126_787 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(5_282_000 as u64)
+ // Standard Error: 45_166
+ .saturating_add(Weight::from_ref_time(12_937_288 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn set_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(31_850_484 as u64)
- // Standard Error: 9_618
- .saturating_add(Weight::from_ref_time(4_721_947 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(28_171_920 as u64)
+ // Standard Error: 13_715
+ .saturating_add(Weight::from_ref_time(6_217_801 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn delete_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(13_795_000 as u64)
- // Standard Error: 28_239
- .saturating_add(Weight::from_ref_time(12_840_446 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(15_511_000 as u64)
+ // Standard Error: 68_273
+ .saturating_add(Weight::from_ref_time(22_917_441 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
fn token_owner() -> Weight {
- Weight::from_ref_time(6_881_000 as u64)
+ Weight::from_ref_time(7_088_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible CollectionAllowance (r:0 w:1)
fn set_allowance_for_all() -> Weight {
- Weight::from_ref_time(16_223_000 as u64)
+ Weight::from_ref_time(17_607_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible CollectionAllowance (r:1 w:0)
fn allowance_for_all() -> Weight {
- Weight::from_ref_time(5_639_000 as u64)
+ Weight::from_ref_time(5_315_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn repair_item() -> Weight {
- Weight::from_ref_time(6_111_000 as u64)
+ Weight::from_ref_time(7_638_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
@@ -229,37 +236,44 @@
impl WeightInfo for () {
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:1)
// Storage: Nonfungible Owned (r:0 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(26_377_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
+ Weight::from_ref_time(34_815_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(4 as u64))
+ .saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(20_059_186 as u64)
- // Standard Error: 4_735
- .saturating_add(Weight::from_ref_time(4_856_306 as u64).saturating_mul(b as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
+ Weight::from_ref_time(18_772_483 as u64)
+ // Standard Error: 5_664
+ .saturating_add(Weight::from_ref_time(7_602_706 as u64).saturating_mul(b as u64))
+ .saturating_add(RocksDbWeight::get().reads(3 as u64))
+ .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
- .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64)))
+ .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
}
// Storage: Nonfungible TokensMinted (r:1 w:1)
// Storage: Nonfungible AccountBalance (r:4 w:4)
+ // Storage: Nonfungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- Weight::from_ref_time(16_365_581 as u64)
- // Standard Error: 9_711
- .saturating_add(Weight::from_ref_time(6_681_940 as u64).saturating_mul(b as u64))
- .saturating_add(RocksDbWeight::get().reads(1 as u64))
- .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
+ Weight::from_ref_time(15_449_226 as u64)
+ // Standard Error: 6_012
+ .saturating_add(Weight::from_ref_time(9_325_591 as u64).saturating_mul(b as u64))
+ .saturating_add(RocksDbWeight::get().reads(2 as u64))
+ .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
- .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
+ .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
}
// Storage: Nonfungible TokenData (r:1 w:1)
// Storage: Nonfungible TokenChildren (r:1 w:0)
@@ -269,7 +283,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_item() -> Weight {
- Weight::from_ref_time(33_502_000 as u64)
+ Weight::from_ref_time(35_221_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
@@ -281,7 +295,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_recursively_self_raw() -> Weight {
- Weight::from_ref_time(43_255_000 as u64)
+ Weight::from_ref_time(45_504_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
@@ -294,9 +308,9 @@
// Storage: Nonfungible TokenProperties (r:0 w:1)
// Storage: Common CollectionById (r:1 w:0)
fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight {
- Weight::from_ref_time(42_992_000 as u64)
- // Standard Error: 1_010_119
- .saturating_add(Weight::from_ref_time(209_972_755 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(45_539_000 as u64)
+ // Standard Error: 1_047_413
+ .saturating_add(Weight::from_ref_time(216_998_419 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(7 as u64))
.saturating_add(RocksDbWeight::get().reads((4 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
@@ -307,21 +321,21 @@
// Storage: Nonfungible Allowance (r:1 w:0)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer() -> Weight {
- Weight::from_ref_time(31_239_000 as u64)
+ Weight::from_ref_time(30_047_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(21_985_000 as u64)
+ Weight::from_ref_time(24_476_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(18_965_000 as u64)
+ Weight::from_ref_time(22_818_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
@@ -330,7 +344,7 @@
// Storage: Nonfungible AccountBalance (r:2 w:2)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer_from() -> Weight {
- Weight::from_ref_time(36_382_000 as u64)
+ Weight::from_ref_time(37_251_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
@@ -342,54 +356,54 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(42_046_000 as u64)
+ Weight::from_ref_time(43_202_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:1)
fn set_token_property_permissions(b: u32, ) -> Weight {
- Weight::from_ref_time(5_543_000 as u64)
- // Standard Error: 40_525
- .saturating_add(Weight::from_ref_time(12_126_787 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(5_282_000 as u64)
+ // Standard Error: 45_166
+ .saturating_add(Weight::from_ref_time(12_937_288 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn set_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(31_850_484 as u64)
- // Standard Error: 9_618
- .saturating_add(Weight::from_ref_time(4_721_947 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(28_171_920 as u64)
+ // Standard Error: 13_715
+ .saturating_add(Weight::from_ref_time(6_217_801 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn delete_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(13_795_000 as u64)
- // Standard Error: 28_239
- .saturating_add(Weight::from_ref_time(12_840_446 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(15_511_000 as u64)
+ // Standard Error: 68_273
+ .saturating_add(Weight::from_ref_time(22_917_441 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible TokenData (r:1 w:0)
fn token_owner() -> Weight {
- Weight::from_ref_time(6_881_000 as u64)
+ Weight::from_ref_time(7_088_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible CollectionAllowance (r:0 w:1)
fn set_allowance_for_all() -> Weight {
- Weight::from_ref_time(16_223_000 as u64)
+ Weight::from_ref_time(17_607_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible CollectionAllowance (r:1 w:0)
fn allowance_for_all() -> Weight {
- Weight::from_ref_time(5_639_000 as u64)
+ Weight::from_ref_time(5_315_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn repair_item() -> Weight {
- Weight::from_ref_time(6_111_000 as u64)
+ Weight::from_ref_time(7_638_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
pallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-core/Cargo.toml
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -1,51 +1,39 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-rmrk-core"
version = "0.1.2"
-license = "GPLv3"
-edition = "2021"
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = '../common' }
+pallet-common = { default-features = false, path = "../common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-structure = { default-features = false, path = "../../pallets/structure" }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-derivative = { version = "2.2.0", features = ["use_core"] }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[features]
default = ["std"]
+runtime-benchmarks = ['frame-benchmarking', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks']
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
- "rmrk-traits/std",
- "pallet-common/std",
- "pallet-nonfungible/std",
- "pallet-structure/std",
- "pallet-evm/std",
- 'frame-benchmarking/std',
-]
-runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm/std",
+ "pallet-nonfungible/std",
+ "pallet-structure/std",
+ "rmrk-traits/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ 'frame-benchmarking/std',
]
try-runtime = ["frame-support/try-runtime"]
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # RMRK Core Proxy Pallet18//!19//! A pallet used as proxy for RMRK Core (<https://rmrk-team.github.io/rmrk-substrate/#/pallets/rmrk-core>).20//!21//! - [`Config`]22//! - [`Call`]23//! - [`Pallet`]24//!25//! ## Overview26//!27//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core,28//! binding its externalities to Unique's own underlying structure.29//! It is purposed to mimic RMRK Core exactly, allowing seamless integrations30//! of solutions based on RMRK.31//!32//! RMRK Core itself contains essential functionality for RMRK's nested and33//! multi-resourced NFTs.34//!35//! *Note*, that while RMRK itself is subject to active development and restructuring,36//! the proxy may be caught temporarily out of date.37//!38//! ### What is RMRK?39//!40//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives.41//! Putting these legos together allows a user to create NFT systems of arbitrary complexity.42//!43//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy,44//! make use of specific changeable and partially shared metadata in the form of resources,45//! and more.46//!47//! Visit RMRK documentation and repositories to learn more:48//! - Docs: <https://docs.rmrk.app/getting-started/>49//! - FAQ: <https://coda.io/@rmrk/faq>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>52//!53//! ## Terminology54//!55//! For more information on RMRK, see RMRK's own documentation.56//!57//! ### Intro to RMRK58//!59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add60//! a piece of media on top of the root metadata (NFT's own), be it a different wing61//! on the root template bird or something entirely unrelated.62//!63//! - **Base:** A list of possible "components" - Parts, a combination of which can64//! be appended/equipped to/on an NFT.65//!66//! - **Part:** Something that, together with other Parts, can constitute an NFT.67//! Parts are defined in the Base to which they belong. Parts can be either68//! of the `slot` type or `fixed` type. Slots are intended for equippables.69//! Note that "part of something" and "Part of a Base" can be easily confused,70//! and so in this documentation these words are distinguished by the capital letter.71//!72//! - **Theme:** Named objects of variable => value pairs which get interpolated into73//! the Base's `themable` Parts. Themes can hold any value, but are often represented74//! in RMRK's examples as colors applied to visible Parts.75//!76//! ### Peculiarities in Unique77//!78//! - **Scoped properties:** Properties that are normally obscured from users.79//! Their purpose is to contain structured metadata that was not included in the Unique standard80//! for collections and tokens, meant to be operated on by proxies and other outliers.81//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is82//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined83//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with.84//!85//! - **Auxiliary properties:** A slightly different structure of properties,86//! trading universality of use for more convenient storage, writes and access.87//! Meant to be inaccessible to end users.88//!89//! ## Proxy Implementation90//!91//! An external user is supposed to be able to utilize this proxy as they would92//! utilize RMRK, and get exactly the same results. Normally, Unique transactions93//! are off-limits to RMRK collections and tokens, and vice versa. However,94//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs.95//!96//! ### ID Mapping97//!98//! RMRK's collections' IDs are counted independently of Unique's and start at 0.99//! Note that tokens' IDs still start at 1.100//! The collections themselves, as well as tokens, are stored as Unique collections,101//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa).102//!103//! ### External/Internal Collection Insulation104//!105//! A Unique transaction cannot target collections purposed for RMRK,106//! and they are flagged as `external` to specify that. On the other hand,107//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections.108//!109//! ### Native Properties110//!111//! Many of RMRK's native parameters are stored as scoped properties of a collection112//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:`113//! is an unacceptable symbol in user-defined properties, which, along with other safeguards,114//! makes them impossible to tamper with.115//!116//! ### Collection and NFT Types, or Base, Parts and Themes Handling117//!118//! RMRK introduces the concept of a Base, which is a catalogue of Parts,119//! possible components of an NFT. Due to its similarity with the functionality120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes121//! are this collection's NFTs. See [`CollectionType`] and [`NftType`].122//!123//! ## Interface124//!125//! ### Dispatchables126//!127//! - `create_collection` - Create a new collection of NFTs.128//! - `destroy_collection` - Destroy a collection.129//! - `change_collection_issuer` - Change the issuer of a collection.130//! Analogous to Unique's collection's [`owner`](up_data_structs::Collection).131//! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.**132//! - `mint_nft` - Mint an NFT in a specified collection.133//! - `burn_nft` - Burn an NFT, destroying it and its nested tokens.134//! - `send` - Transfer an NFT from an account/NFT A to another account/NFT B.135//! - `accept_nft` - Accept an NFT sent from another account to self or an owned NFT.136//! - `reject_nft` - Reject an NFT sent from another account to self or owned NFT and **burn it**.137//! - `accept_resource` - Accept the addition of a newly created pending resource to an existing NFT.138//! - `accept_resource_removal` - Accept the removal of a removal-pending resource from an NFT.139//! - `set_property` - Add or edit a custom user property of a token or a collection.140//! - `set_priority` - Set a different order of resource priorities for an NFT.141//! - `add_basic_resource` - Create and set/propose a basic resource for an NFT.142//! - `add_composable_resource` - Create and set/propose a composable resource for an NFT.143//! - `add_slot_resource` - Create and set/propose a slot resource for an NFT.144//! - `remove_resource` - Remove and erase a resource from an NFT.145146#![cfg_attr(not(feature = "std"), no_std)]147148use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};149use frame_system::{pallet_prelude::*, ensure_signed};150use sp_runtime::{DispatchError, Permill, traits::StaticLookup};151use sp_std::{152 vec::Vec,153 collections::{btree_set::BTreeSet, btree_map::BTreeMap},154};155use up_data_structs::{*, mapping::TokenAddressMapping};156use pallet_common::{157 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,158};159use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle, TokenData};160use pallet_structure::{Pallet as PalletStructure, Error as StructureError};161use pallet_evm::account::CrossAccountId;162use core::convert::AsRef;163164pub use pallet::*;165166#[cfg(feature = "runtime-benchmarks")]167pub mod benchmarking;168pub mod misc;169pub mod property;170pub mod rpc;171pub mod weights;172173pub type SelfWeightOf<T> = <T as Config>::WeightInfo;174175use weights::WeightInfo;176use misc::*;177pub use property::*;178179use RmrkProperty::*;180181/// A maximum number of levels of depth in the token nesting tree.182pub const NESTING_BUDGET: u32 = 5;183184type PendingTarget = (CollectionId, TokenId);185type PendingChild = (RmrkCollectionId, RmrkNftId);186type PendingChildrenSet = BTreeSet<PendingChild>;187188type BasesMap = BTreeMap<RmrkBaseId, u32>;189190#[frame_support::pallet]191pub mod pallet {192 use super::*;193194 #[pallet::config]195 pub trait Config:196 frame_system::Config197 + pallet_common::Config198 + pallet_nonfungible::Config199 + pallet_evm::Config200 {201 /// Overarching event type.202 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;203204 /// The weight information of this pallet.205 type WeightInfo: WeightInfo;206 }207208 /// Latest yet-unused collection ID.209 #[pallet::storage]210 #[pallet::getter(fn collection_index)]211 pub type CollectionIndex<T: Config> = StorageValue<_, RmrkCollectionId, ValueQuery>;212213 /// Mapping from RMRK collection ID to Unique's.214 #[pallet::storage]215 pub type UniqueCollectionId<T: Config> =216 StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>;217218 #[pallet::pallet]219 #[pallet::generate_store(pub(super) trait Store)]220 pub struct Pallet<T>(_);221222 #[pallet::event]223 #[pallet::generate_deposit(pub(super) fn deposit_event)]224 pub enum Event<T: Config> {225 CollectionCreated {226 issuer: T::AccountId,227 collection_id: RmrkCollectionId,228 },229 CollectionDestroyed {230 issuer: T::AccountId,231 collection_id: RmrkCollectionId,232 },233 IssuerChanged {234 old_issuer: T::AccountId,235 new_issuer: T::AccountId,236 collection_id: RmrkCollectionId,237 },238 CollectionLocked {239 issuer: T::AccountId,240 collection_id: RmrkCollectionId,241 },242 NftMinted {243 owner: T::AccountId,244 collection_id: RmrkCollectionId,245 nft_id: RmrkNftId,246 },247 NFTBurned {248 owner: T::AccountId,249 nft_id: RmrkNftId,250 },251 NFTSent {252 sender: T::AccountId,253 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,254 collection_id: RmrkCollectionId,255 nft_id: RmrkNftId,256 approval_required: bool,257 },258 NFTAccepted {259 sender: T::AccountId,260 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,261 collection_id: RmrkCollectionId,262 nft_id: RmrkNftId,263 },264 NFTRejected {265 sender: T::AccountId,266 collection_id: RmrkCollectionId,267 nft_id: RmrkNftId,268 },269 PropertySet {270 collection_id: RmrkCollectionId,271 maybe_nft_id: Option<RmrkNftId>,272 key: RmrkKeyString,273 value: RmrkValueString,274 },275 ResourceAdded {276 nft_id: RmrkNftId,277 resource_id: RmrkResourceId,278 },279 ResourceRemoval {280 nft_id: RmrkNftId,281 resource_id: RmrkResourceId,282 },283 ResourceAccepted {284 nft_id: RmrkNftId,285 resource_id: RmrkResourceId,286 },287 ResourceRemovalAccepted {288 nft_id: RmrkNftId,289 resource_id: RmrkResourceId,290 },291 PrioritySet {292 collection_id: RmrkCollectionId,293 nft_id: RmrkNftId,294 },295 }296297 #[pallet::error]298 pub enum Error<T> {299 /* Unique proxy-specific events */300 /// Property of the type of RMRK collection could not be read successfully.301 CorruptedCollectionType,302 // NftTypeEncodeError,303 /// Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH).304 RmrkPropertyKeyIsTooLong,305 /// Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH).306 RmrkPropertyValueIsTooLong,307 /// Could not find a property by the supplied key.308 RmrkPropertyIsNotFound,309 /// Something went wrong when decoding encoded data from the storage.310 /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored.311 UnableToDecodeRmrkData,312313 /* RMRK compatible events */314 /// Only destroying collections without tokens is allowed.315 CollectionNotEmpty,316 /// Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow.317 NoAvailableCollectionId,318 /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow.319 NoAvailableNftId,320 /// Collection does not exist, has a wrong type, or does not map to a Unique ID.321 CollectionUnknown,322 /// No permission to perform action.323 NoPermission,324 /// Token is marked as non-transferable, and thus cannot be transferred.325 NonTransferable,326 /// Too many tokens created in the collection, no new ones are allowed.327 CollectionFullOrLocked,328 /// No such resource found.329 ResourceDoesntExist,330 /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros.331 /// Sending to self is redundant.332 CannotSendToDescendentOrSelf,333 /// Not the target owner of the sent NFT.334 CannotAcceptNonOwnedNft,335 /// Not the target owner of the sent NFT.336 CannotRejectNonOwnedNft,337 /// NFT was not sent and is not pending.338 CannotRejectNonPendingNft,339 /// Resource is not pending for the operation.340 ResourceNotPending,341 /// Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow.342 NoAvailableResourceId,343 }344345 #[pallet::call]346 impl<T: Config> Pallet<T> {347 // todo :refactor replace every collection_id with rmrk_collection_id (and nft_id) in arguments for uniformity?348349 /// Create a new collection of NFTs.350 ///351 /// # Permissions:352 /// * Anyone - will be assigned as the issuer of the collection.353 ///354 /// # Arguments:355 /// - `origin`: sender of the transaction356 /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed.357 /// - `max`: Optional maximum number of tokens.358 /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs.359 /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed.360 #[pallet::call_index(0)]361 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]362 pub fn create_collection(363 origin: OriginFor<T>,364 metadata: RmrkString,365 max: Option<u32>,366 symbol: RmrkCollectionSymbol,367 ) -> DispatchResult {368 let sender = ensure_signed(origin)?;369370 let limits = CollectionLimits {371 owner_can_transfer: Some(false),372 token_limit: max,373 ..Default::default()374 };375376 let data = CreateCollectionData {377 limits: Some(limits),378 token_prefix: symbol379 .into_inner()380 .try_into()381 .map_err(|_| <CommonError<T>>::CollectionTokenPrefixLimitExceeded)?,382 permissions: Some(CollectionPermissions {383 nesting: Some(NestingPermissions {384 token_owner: true,385 collection_admin: false,386 restricted: None,387 #[cfg(feature = "runtime-benchmarks")]388 permissive: false,389 }),390 ..Default::default()391 }),392 ..Default::default()393 };394395 let unique_collection_id = Self::init_collection(396 T::CrossAccountId::from_sub(sender.clone()),397 data,398 [399 Self::encode_rmrk_property(Metadata, &metadata)?,400 Self::encode_rmrk_property(CollectionType, &misc::CollectionType::Regular)?,401 ]402 .into_iter(),403 )?;404 let rmrk_collection_id = <CollectionIndex<T>>::get();405406 <UniqueCollectionId<T>>::insert(rmrk_collection_id, unique_collection_id);407408 <PalletCommon<T>>::set_scoped_collection_property(409 unique_collection_id,410 RMRK_SCOPE,411 Self::encode_rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?,412 )?;413414 <CollectionIndex<T>>::mutate(|n| *n += 1);415416 Self::deposit_event(Event::CollectionCreated {417 issuer: sender,418 collection_id: rmrk_collection_id,419 });420421 Ok(())422 }423424 /// Destroy a collection.425 ///426 /// Only empty collections can be destroyed. If it has any tokens, they must be burned first.427 ///428 /// # Permissions:429 /// * Collection issuer430 ///431 /// # Arguments:432 /// - `origin`: sender of the transaction433 /// - `collection_id`: RMRK ID of the collection to destroy.434 #[pallet::call_index(1)]435 #[pallet::weight(<SelfWeightOf<T>>::destroy_collection())]436 pub fn destroy_collection(437 origin: OriginFor<T>,438 collection_id: RmrkCollectionId,439 ) -> DispatchResult {440 let sender = ensure_signed(origin)?;441 let cross_sender = T::CrossAccountId::from_sub(sender.clone());442443 let collection = Self::get_typed_nft_collection(444 Self::unique_collection_id(collection_id)?,445 misc::CollectionType::Regular,446 )?;447 collection.check_is_external()?;448449 <PalletNft<T>>::destroy_collection(collection, &cross_sender)450 .map_err(Self::map_unique_err_to_proxy)?;451452 Self::deposit_event(Event::CollectionDestroyed {453 issuer: sender,454 collection_id,455 });456457 Ok(())458 }459460 /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection).461 ///462 /// # Permissions:463 /// * Collection issuer464 ///465 /// # Arguments:466 /// - `origin`: sender of the transaction467 /// - `collection_id`: RMRK collection ID to change the issuer of.468 /// - `new_issuer`: Collection's new issuer.469 #[pallet::call_index(2)]470 #[pallet::weight(<SelfWeightOf<T>>::change_collection_issuer())]471 pub fn change_collection_issuer(472 origin: OriginFor<T>,473 collection_id: RmrkCollectionId,474 new_issuer: <T::Lookup as StaticLookup>::Source,475 ) -> DispatchResult {476 let sender = ensure_signed(origin)?;477478 let collection = Self::get_nft_collection(Self::unique_collection_id(collection_id)?)?;479 collection.check_is_external()?;480481 let new_issuer = T::Lookup::lookup(new_issuer)?;482483 Self::change_collection_owner(484 Self::unique_collection_id(collection_id)?,485 misc::CollectionType::Regular,486 sender.clone(),487 new_issuer.clone(),488 )?;489490 Self::deposit_event(Event::IssuerChanged {491 old_issuer: sender,492 new_issuer,493 collection_id,494 });495496 Ok(())497 }498499 /// "Lock" the collection and prevent new token creation. Cannot be undone.500 ///501 /// # Permissions:502 /// * Collection issuer503 ///504 /// # Arguments:505 /// - `origin`: sender of the transaction506 /// - `collection_id`: RMRK ID of the collection to lock.507 #[pallet::call_index(3)]508 #[pallet::weight(<SelfWeightOf<T>>::lock_collection())]509 pub fn lock_collection(510 origin: OriginFor<T>,511 collection_id: RmrkCollectionId,512 ) -> DispatchResult {513 let sender = ensure_signed(origin)?;514 let cross_sender = T::CrossAccountId::from_sub(sender.clone());515516 let collection = Self::get_typed_nft_collection(517 Self::unique_collection_id(collection_id)?,518 misc::CollectionType::Regular,519 )?;520 collection.check_is_external()?;521522 Self::check_collection_owner(&collection, &cross_sender)?;523524 let token_count = collection.total_supply();525526 let mut collection = collection.into_inner();527 collection.limits.token_limit = Some(token_count);528 collection.save()?;529530 Self::deposit_event(Event::CollectionLocked {531 issuer: sender,532 collection_id,533 });534535 Ok(())536 }537538 /// Mint an NFT in a specified collection.539 ///540 /// # Permissions:541 /// * Collection issuer542 ///543 /// # Arguments:544 /// - `origin`: sender of the transaction545 /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer).546 /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed.547 /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed.548 /// - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed.549 /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed.550 /// - `transferable`: Can this NFT be transferred? Cannot be changed.551 /// - `resources`: Resource data to be added to the NFT immediately after minting.552 #[pallet::call_index(4)]553 #[pallet::weight(<SelfWeightOf<T>>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))]554 pub fn mint_nft(555 origin: OriginFor<T>,556 owner: Option<T::AccountId>,557 collection_id: RmrkCollectionId,558 recipient: Option<T::AccountId>,559 royalty_amount: Option<Permill>,560 metadata: RmrkString,561 transferable: bool,562 resources: Option<BoundedVec<RmrkResourceTypes, MaxResourcesOnMint>>,563 ) -> DispatchResult {564 let sender = ensure_signed(origin)?;565 let cross_sender = T::CrossAccountId::from_sub(sender.clone());566567 let owner = owner.unwrap_or(sender.clone());568 let cross_owner = T::CrossAccountId::from_sub(owner.clone());569570 let collection = Self::get_typed_nft_collection(571 Self::unique_collection_id(collection_id)?,572 misc::CollectionType::Regular,573 )?;574 collection.check_is_external()?;575576 let royalty_info = royalty_amount.map(|amount| rmrk_traits::RoyaltyInfo {577 recipient: recipient.unwrap_or_else(|| owner.clone()),578 amount,579 });580581 let nft_id = Self::create_nft(582 &cross_sender,583 &cross_owner,584 &collection,585 [586 Self::encode_rmrk_property(TokenType, &NftType::Regular)?,587 Self::encode_rmrk_property(Transferable, &transferable)?,588 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,589 Self::encode_rmrk_property(RoyaltyInfo, &royalty_info)?,590 Self::encode_rmrk_property(Metadata, &metadata)?,591 Self::encode_rmrk_property(Equipped, &false)?,592 Self::encode_rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,593 Self::encode_rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,594 Self::encode_rmrk_property(PendingChildren, &PendingChildrenSet::new())?,595 Self::encode_rmrk_property(AssociatedBases, &BasesMap::new())?,596 ]597 .into_iter(),598 )599 .map_err(|err| match err {600 DispatchError::Arithmetic(_) => <Error<T>>::NoAvailableNftId.into(),601 err => Self::map_unique_err_to_proxy(err),602 })?;603604 if let Some(resources) = resources {605 for resource in resources {606 Self::resource_add(sender.clone(), collection.id, nft_id, resource)?;607 }608 }609610 Self::deposit_event(Event::NftMinted {611 owner,612 collection_id,613 nft_id: nft_id.0,614 });615616 Ok(())617 }618619 /// Burn an NFT, destroying it and its nested tokens up to the specified limit.620 /// If the burning budget is exceeded, the transaction is reverted.621 ///622 /// This is the way to burn a nested token as well.623 ///624 /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively).625 ///626 /// # Permissions:627 /// * Token owner628 ///629 /// # Arguments:630 /// - `origin`: sender of the transaction631 /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to.632 /// - `nft_id`: ID of the NFT to be destroyed.633 /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction634 /// is reverted if there are more tokens to burn in the nesting tree than this number.635 /// This is primarily a mechanism of transaction weight control.636 #[pallet::call_index(5)]637 #[pallet::weight(<SelfWeightOf<T>>::burn_nft(*max_burns))]638 pub fn burn_nft(639 origin: OriginFor<T>,640 collection_id: RmrkCollectionId,641 nft_id: RmrkNftId,642 max_burns: u32,643 ) -> DispatchResult {644 let sender = ensure_signed(origin)?;645 let cross_sender = T::CrossAccountId::from_sub(sender.clone());646647 let collection = Self::get_typed_nft_collection(648 Self::unique_collection_id(collection_id)?,649 misc::CollectionType::Regular,650 )?;651 collection.check_is_external()?;652653 Self::destroy_nft(654 cross_sender,655 Self::unique_collection_id(collection_id)?,656 nft_id.into(),657 max_burns,658 <Error<T>>::NoPermission,659 )660 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;661662 Self::deposit_event(Event::NFTBurned {663 owner: sender,664 nft_id,665 });666667 Ok(())668 }669670 /// Transfer an NFT from an account/NFT A to another account/NFT B.671 /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`].672 ///673 /// If the target owner is an NFT owned by another account, then the NFT will enter674 /// the pending state and will have to be accepted by the other account.675 ///676 /// # Permissions:677 /// - Token owner678 ///679 /// # Arguments:680 /// - `origin`: sender of the transaction681 /// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred.682 /// - `rmrk_nft_id`: ID of the NFT to be transferred.683 /// - `new_owner`: New owner of the nft which can be either an account or a NFT.684 #[pallet::call_index(6)]685 #[pallet::weight(<SelfWeightOf<T>>::send())]686 pub fn send(687 origin: OriginFor<T>,688 rmrk_collection_id: RmrkCollectionId,689 rmrk_nft_id: RmrkNftId,690 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,691 ) -> DispatchResult {692 let sender = ensure_signed(origin.clone())?;693 let cross_sender = T::CrossAccountId::from_sub(sender.clone());694695 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;696 let nft_id = rmrk_nft_id.into();697698 let collection =699 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;700 collection.check_is_external()?;701702 let token_data =703 <TokenData<T>>::get((collection_id, nft_id)).ok_or(<Error<T>>::NoAvailableNftId)?;704705 let from = token_data.owner;706707 ensure!(708 Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)?,709 <Error<T>>::NonTransferable710 );711712 ensure!(713 Self::get_nft_property_decoded::<Option<PendingTarget>>(714 collection_id,715 nft_id,716 RmrkProperty::PendingNftAccept717 )?718 .is_none(),719 <Error<T>>::NoPermission720 );721722 let target_owner;723 let approval_required;724725 match new_owner {726 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {727 target_owner = T::CrossAccountId::from_sub(account_id.clone());728 approval_required = false;729 }730 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(731 target_collection_id,732 target_nft_id,733 ) => {734 let target_collection_id = Self::unique_collection_id(target_collection_id)?;735736 let target_nft_budget = budget::Value::new(NESTING_BUDGET);737738 let target_nft_owner = <PalletStructure<T>>::get_checked_topmost_owner(739 target_collection_id,740 target_nft_id.into(),741 Some((collection_id, nft_id)),742 &target_nft_budget,743 )744 .map_err(Self::map_unique_err_to_proxy)?;745746 approval_required = cross_sender != target_nft_owner;747748 if approval_required {749 target_owner = target_nft_owner;750751 <PalletNft<T>>::set_scoped_token_property(752 collection.id,753 nft_id,754 RMRK_SCOPE,755 Self::encode_rmrk_property::<Option<PendingTarget>>(756 PendingNftAccept,757 &Some((target_collection_id, target_nft_id.into())),758 )?,759 )?;760761 Self::insert_pending_child(762 (target_collection_id, target_nft_id.into()),763 (rmrk_collection_id, rmrk_nft_id),764 )?;765 } else {766 target_owner = T::CrossTokenAddressMapping::token_to_address(767 target_collection_id,768 target_nft_id.into(),769 );770 }771 }772 }773774 let src_nft_budget = budget::Value::new(NESTING_BUDGET);775776 <PalletNft<T>>::transfer_from(777 &collection,778 &cross_sender,779 &from,780 &target_owner,781 nft_id,782 &src_nft_budget,783 )784 .map_err(Self::map_unique_err_to_proxy)?;785786 Self::deposit_event(Event::NFTSent {787 sender,788 recipient: new_owner,789 collection_id: rmrk_collection_id,790 nft_id: rmrk_nft_id,791 approval_required,792 });793794 Ok(())795 }796797 /// Accept an NFT sent from another account to self or an owned NFT.798 ///799 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.800 ///801 /// # Permissions:802 /// - Token-owner-to-be803 ///804 /// # Arguments:805 /// - `origin`: sender of the transaction806 /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted.807 /// - `rmrk_nft_id`: ID of the NFT to be accepted.808 /// - `new_owner`: Either the sender's account ID or a sender-owned NFT,809 /// whichever the accepted NFT was sent to.810 #[pallet::call_index(7)]811 #[pallet::weight(<SelfWeightOf<T>>::accept_nft())]812 pub fn accept_nft(813 origin: OriginFor<T>,814 rmrk_collection_id: RmrkCollectionId,815 rmrk_nft_id: RmrkNftId,816 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,817 ) -> DispatchResult {818 let sender = ensure_signed(origin.clone())?;819 let cross_sender = T::CrossAccountId::from_sub(sender.clone());820821 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;822 let nft_id = rmrk_nft_id.into();823824 let collection =825 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;826 collection.check_is_external()?;827828 let new_cross_owner = match new_owner {829 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {830 T::CrossAccountId::from_sub(account_id.clone())831 }832 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(833 target_collection_id,834 target_nft_id,835 ) => {836 let target_collection_id = Self::unique_collection_id(target_collection_id)?;837838 T::CrossTokenAddressMapping::token_to_address(839 target_collection_id,840 TokenId(target_nft_id),841 )842 }843 };844845 let budget = budget::Value::new(NESTING_BUDGET);846847 <PalletNft<T>>::transfer(848 &collection,849 &cross_sender,850 &new_cross_owner,851 nft_id,852 &budget,853 )854 .map_err(|err| {855 if err == <CommonError<T>>::UserIsNotAllowedToNest.into() {856 <Error<T>>::CannotAcceptNonOwnedNft.into()857 } else {858 Self::map_unique_err_to_proxy(err)859 }860 })?;861862 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(863 collection_id,864 nft_id,865 RmrkProperty::PendingNftAccept,866 )?;867868 if let Some(pending_target) = pending_target {869 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?;870871 <PalletNft<T>>::set_scoped_token_property(872 collection.id,873 nft_id,874 RMRK_SCOPE,875 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,876 )?;877 }878879 Self::deposit_event(Event::NFTAccepted {880 sender,881 recipient: new_owner,882 collection_id: rmrk_collection_id,883 nft_id: rmrk_nft_id,884 });885886 Ok(())887 }888889 /// Reject an NFT sent from another account to self or owned NFT.890 /// The NFT in question will not be sent back and burnt instead.891 ///892 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.893 ///894 /// # Permissions:895 /// - Token-owner-to-be-not896 ///897 /// # Arguments:898 /// - `origin`: sender of the transaction899 /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected.900 /// - `rmrk_nft_id`: ID of the NFT to be rejected.901 #[pallet::call_index(8)]902 #[pallet::weight(<SelfWeightOf<T>>::reject_nft())]903 pub fn reject_nft(904 origin: OriginFor<T>,905 rmrk_collection_id: RmrkCollectionId,906 rmrk_nft_id: RmrkNftId,907 ) -> DispatchResult {908 let sender = ensure_signed(origin)?;909 let cross_sender = T::CrossAccountId::from_sub(sender.clone());910911 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;912 let nft_id = rmrk_nft_id.into();913914 let collection =915 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;916 collection.check_is_external()?;917918 ensure!(919 <TokenData<T>>::get((collection_id, nft_id)).is_some(),920 <Error<T>>::NoAvailableNftId921 );922923 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(924 collection_id,925 nft_id,926 RmrkProperty::PendingNftAccept,927 )?;928929 match pending_target {930 Some(pending_target) => {931 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?932 }933 None => return Err(<Error<T>>::CannotRejectNonPendingNft.into()),934 }935936 Self::destroy_nft(937 cross_sender,938 collection_id,939 nft_id,940 NESTING_BUDGET,941 <Error<T>>::CannotRejectNonOwnedNft,942 )943 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;944945 Self::deposit_event(Event::NFTRejected {946 sender,947 collection_id: rmrk_collection_id,948 nft_id: rmrk_nft_id,949 });950951 Ok(())952 }953954 /// Accept the addition of a newly created pending resource to an existing NFT.955 ///956 /// This transaction is needed when a resource is created and assigned to an NFT957 /// by a non-owner, i.e. the collection issuer, with one of the958 /// [`add_...` transactions](Pallet::add_basic_resource).959 ///960 /// # Permissions:961 /// - Token owner962 ///963 /// # Arguments:964 /// - `origin`: sender of the transaction965 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.966 /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted.967 /// - `resource_id`: ID of the newly created pending resource.968 /// accept the addition of a new resource to an existing NFT969 #[pallet::call_index(9)]970 #[pallet::weight(<SelfWeightOf<T>>::accept_resource())]971 pub fn accept_resource(972 origin: OriginFor<T>,973 rmrk_collection_id: RmrkCollectionId,974 rmrk_nft_id: RmrkNftId,975 resource_id: RmrkResourceId,976 ) -> DispatchResult {977 let sender = ensure_signed(origin)?;978 let cross_sender = T::CrossAccountId::from_sub(sender);979980 let collection_id = Self::unique_collection_id(rmrk_collection_id)981 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;982 let collection =983 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;984 collection.check_is_external()?;985986 let nft_id = rmrk_nft_id.into();987988 let budget = budget::Value::new(NESTING_BUDGET);989990 let nft_owner =991 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)992 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;993994 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {995 ensure!(res.pending, <Error<T>>::ResourceNotPending);996 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);997998 res.pending = false;9991000 Ok(())1001 })?;10021003 Self::deposit_event(Event::<T>::ResourceAccepted {1004 nft_id: rmrk_nft_id,1005 resource_id,1006 });10071008 Ok(())1009 }10101011 /// Accept the removal of a removal-pending resource from an NFT.1012 ///1013 /// This transaction is needed when a non-owner, i.e. the collection issuer,1014 /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT.1015 ///1016 /// # Permissions:1017 /// - Token owner1018 ///1019 /// # Arguments:1020 /// - `origin`: sender of the transaction1021 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1022 /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed.1023 /// - `resource_id`: ID of the removal-pending resource.1024 #[pallet::call_index(10)]1025 #[pallet::weight(<SelfWeightOf<T>>::accept_resource_removal())]1026 pub fn accept_resource_removal(1027 origin: OriginFor<T>,1028 rmrk_collection_id: RmrkCollectionId,1029 rmrk_nft_id: RmrkNftId,1030 resource_id: RmrkResourceId,1031 ) -> DispatchResult {1032 let sender = ensure_signed(origin)?;1033 let cross_sender = T::CrossAccountId::from_sub(sender);10341035 let collection_id = Self::unique_collection_id(rmrk_collection_id)1036 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;1037 let collection =1038 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1039 collection.check_is_external()?;10401041 let nft_id = rmrk_nft_id.into();10421043 let budget = budget::Value::new(NESTING_BUDGET);10441045 let nft_owner =1046 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1047 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;10481049 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);10501051 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;10521053 let resource_info = <PalletNft<T>>::token_aux_property((1054 collection_id,1055 nft_id,1056 RMRK_SCOPE,1057 resource_id_key.clone(),1058 ))1059 .ok_or(<Error<T>>::ResourceDoesntExist)?;10601061 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource_info)?;10621063 ensure!(1064 resource_info.pending_removal,1065 <Error<T>>::ResourceNotPending1066 );10671068 <PalletNft<T>>::remove_token_aux_property(1069 collection_id,1070 nft_id,1071 RMRK_SCOPE,1072 resource_id_key,1073 );10741075 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1076 let base_id = resource.base;10771078 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1079 }10801081 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {1082 nft_id: rmrk_nft_id,1083 resource_id,1084 });10851086 Ok(())1087 }10881089 /// Add or edit a custom user property, a key-value pair, describing the metadata1090 /// of a token or a collection, on either one of these.1091 ///1092 /// Note that in this proxy implementation many details regarding RMRK are stored1093 /// as scoped properties prefixed with "rmrk:", normally inaccessible1094 /// to external transactions and RPCs.1095 ///1096 /// # Permissions:1097 /// - Collection issuer - in case of collection property1098 /// - Token owner - in case of NFT property1099 ///1100 /// # Arguments:1101 /// - `origin`: sender of the transaction1102 /// - `rmrk_collection_id`: RMRK collection ID.1103 /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection.1104 /// - `key`: Key of the custom property to be referenced by.1105 /// - `value`: Value of the custom property to be stored.1106 #[pallet::call_index(11)]1107 #[pallet::weight(<SelfWeightOf<T>>::set_property())]1108 pub fn set_property(1109 origin: OriginFor<T>,1110 #[pallet::compact] rmrk_collection_id: RmrkCollectionId,1111 maybe_nft_id: Option<RmrkNftId>,1112 key: RmrkKeyString,1113 value: RmrkValueString,1114 ) -> DispatchResult {1115 let sender = ensure_signed(origin)?;1116 let sender = T::CrossAccountId::from_sub(sender);11171118 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1119 let collection =1120 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1121 collection.check_is_external()?;11221123 let budget = budget::Value::new(NESTING_BUDGET);11241125 match maybe_nft_id {1126 Some(nft_id) => {1127 let token_id: TokenId = nft_id.into();11281129 Self::ensure_nft_type(collection_id, token_id, NftType::Regular)?;1130 Self::ensure_nft_owner(collection_id, token_id, &sender, &budget)?;11311132 <PalletNft<T>>::set_scoped_token_property(1133 collection_id,1134 token_id,1135 RMRK_SCOPE,1136 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1137 )?;1138 }1139 None => {1140 let collection = Self::get_typed_nft_collection(1141 collection_id,1142 misc::CollectionType::Regular,1143 )?;11441145 Self::check_collection_owner(&collection, &sender)?;11461147 <PalletCommon<T>>::set_scoped_collection_property(1148 collection_id,1149 RMRK_SCOPE,1150 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1151 )?;1152 }1153 }11541155 Self::deposit_event(Event::PropertySet {1156 collection_id: rmrk_collection_id,1157 maybe_nft_id,1158 key,1159 value,1160 });11611162 Ok(())1163 }11641165 /// Set a different order of resource priorities for an NFT. Priorities can be used,1166 /// for example, for order of rendering.1167 ///1168 /// Note that the priorities are not updated automatically, and are an empty vector1169 /// by default. There is no pre-set definition for the order to be particular,1170 /// it can be interpreted arbitrarily use-case by use-case.1171 ///1172 /// # Permissions:1173 /// - Token owner1174 ///1175 /// # Arguments:1176 /// - `origin`: sender of the transaction1177 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1178 /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for.1179 /// - `priorities`: Ordered vector of resource IDs.1180 #[pallet::call_index(12)]1181 #[pallet::weight(<SelfWeightOf<T>>::set_priority())]1182 pub fn set_priority(1183 origin: OriginFor<T>,1184 rmrk_collection_id: RmrkCollectionId,1185 rmrk_nft_id: RmrkNftId,1186 priorities: BoundedVec<RmrkResourceId, RmrkMaxPriorities>,1187 ) -> DispatchResult {1188 let sender = ensure_signed(origin)?;1189 let sender = T::CrossAccountId::from_sub(sender);11901191 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1192 let nft_id = rmrk_nft_id.into();11931194 let collection =1195 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1196 collection.check_is_external()?;11971198 let budget = budget::Value::new(NESTING_BUDGET);11991200 Self::ensure_nft_type(collection_id, nft_id, NftType::Regular)?;1201 Self::ensure_nft_owner(collection_id, nft_id, &sender, &budget)?;12021203 <PalletNft<T>>::set_scoped_token_property(1204 collection_id,1205 nft_id,1206 RMRK_SCOPE,1207 Self::encode_rmrk_property(ResourcePriorities, &priorities.into_inner())?,1208 )?;12091210 Self::deposit_event(Event::<T>::PrioritySet {1211 collection_id: rmrk_collection_id,1212 nft_id: rmrk_nft_id,1213 });12141215 Ok(())1216 }12171218 /// Create and set/propose a basic resource for an NFT.1219 ///1220 /// A basic resource is the simplest, lacking a Base and anything that comes with it.1221 /// See RMRK docs for more information and examples.1222 ///1223 /// # Permissions:1224 /// - Collection issuer - if not the token owner, adding the resource will warrant1225 /// the owner's [acceptance](Pallet::accept_resource).1226 ///1227 /// # Arguments:1228 /// - `origin`: sender of the transaction1229 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1230 /// - `nft_id`: ID of the NFT to assign a resource to.1231 /// - `resource`: Data of the resource to be created.1232 #[pallet::call_index(13)]1233 #[pallet::weight(<SelfWeightOf<T>>::add_basic_resource())]1234 pub fn add_basic_resource(1235 origin: OriginFor<T>,1236 rmrk_collection_id: RmrkCollectionId,1237 nft_id: RmrkNftId,1238 resource: RmrkBasicResource,1239 ) -> DispatchResult {1240 let sender = ensure_signed(origin.clone())?;12411242 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1243 let collection =1244 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1245 collection.check_is_external()?;12461247 let resource_id = Self::resource_add(1248 sender,1249 collection_id,1250 nft_id.into(),1251 RmrkResourceTypes::Basic(resource),1252 )?;12531254 Self::deposit_event(Event::ResourceAdded {1255 nft_id,1256 resource_id,1257 });1258 Ok(())1259 }12601261 /// Create and set/propose a composable resource for an NFT.1262 ///1263 /// A composable resource links to a Base and has a subset of its Parts it is composed of.1264 /// See RMRK docs for more information and examples.1265 ///1266 /// # Permissions:1267 /// - Collection issuer - if not the token owner, adding the resource will warrant1268 /// the owner's [acceptance](Pallet::accept_resource).1269 ///1270 /// # Arguments:1271 /// - `origin`: sender of the transaction1272 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1273 /// - `nft_id`: ID of the NFT to assign a resource to.1274 /// - `resource`: Data of the resource to be created.1275 #[pallet::call_index(14)]1276 #[pallet::weight(<SelfWeightOf<T>>::add_composable_resource())]1277 pub fn add_composable_resource(1278 origin: OriginFor<T>,1279 rmrk_collection_id: RmrkCollectionId,1280 nft_id: RmrkNftId,1281 resource: RmrkComposableResource,1282 ) -> DispatchResult {1283 let sender = ensure_signed(origin.clone())?;12841285 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1286 let collection =1287 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1288 collection.check_is_external()?;12891290 let base_id = resource.base;12911292 let resource_id = Self::resource_add(1293 sender,1294 collection_id,1295 nft_id.into(),1296 RmrkResourceTypes::Composable(resource),1297 )?;12981299 <PalletNft<T>>::try_mutate_token_aux_property(1300 collection_id,1301 nft_id.into(),1302 RMRK_SCOPE,1303 Self::get_scoped_property_key(AssociatedBases)?,1304 |value| -> DispatchResult {1305 let mut bases: BasesMap = match value {1306 Some(value) => Self::decode_property_value(value)?,1307 None => BasesMap::new(),1308 };13091310 *bases.entry(base_id).or_insert(0) += 1;13111312 *value = Some(Self::encode_property_value(&bases)?);1313 Ok(())1314 },1315 )?;13161317 Self::deposit_event(Event::ResourceAdded {1318 nft_id,1319 resource_id,1320 });1321 Ok(())1322 }13231324 /// Create and set/propose a slot resource for an NFT.1325 ///1326 /// A slot resource links to a Base and a slot ID in it which it can fit into.1327 /// See RMRK docs for more information and examples.1328 ///1329 /// # Permissions:1330 /// - Collection issuer - if not the token owner, adding the resource will warrant1331 /// the owner's [acceptance](Pallet::accept_resource).1332 ///1333 /// # Arguments:1334 /// - `origin`: sender of the transaction1335 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1336 /// - `nft_id`: ID of the NFT to assign a resource to.1337 /// - `resource`: Data of the resource to be created.1338 #[pallet::call_index(15)]1339 #[pallet::weight(<SelfWeightOf<T>>::add_slot_resource())]1340 pub fn add_slot_resource(1341 origin: OriginFor<T>,1342 rmrk_collection_id: RmrkCollectionId,1343 nft_id: RmrkNftId,1344 resource: RmrkSlotResource,1345 ) -> DispatchResult {1346 let sender = ensure_signed(origin.clone())?;13471348 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1349 let collection =1350 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1351 collection.check_is_external()?;13521353 let resource_id = Self::resource_add(1354 sender,1355 collection_id,1356 nft_id.into(),1357 RmrkResourceTypes::Slot(resource),1358 )?;13591360 Self::deposit_event(Event::ResourceAdded {1361 nft_id,1362 resource_id,1363 });1364 Ok(())1365 }13661367 /// Remove and erase a resource from an NFT.1368 ///1369 /// If the sender does not own the NFT, then it will be pending confirmation,1370 /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner.1371 ///1372 /// # Permissions1373 /// - Collection issuer1374 ///1375 /// # Arguments1376 /// - `origin`: sender of the transaction1377 /// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.1378 /// - `nft_id`: ID of the NFT with a resource to be removed.1379 /// - `resource_id`: ID of the resource to be removed.1380 #[pallet::call_index(16)]1381 #[pallet::weight(<SelfWeightOf<T>>::remove_resource())]1382 pub fn remove_resource(1383 origin: OriginFor<T>,1384 rmrk_collection_id: RmrkCollectionId,1385 nft_id: RmrkNftId,1386 resource_id: RmrkResourceId,1387 ) -> DispatchResult {1388 let sender = ensure_signed(origin.clone())?;13891390 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1391 let collection =1392 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1393 collection.check_is_external()?;13941395 Self::resource_remove(sender, collection_id, nft_id.into(), resource_id)?;13961397 Self::deposit_event(Event::ResourceRemoval {1398 nft_id,1399 resource_id,1400 });1401 Ok(())1402 }1403 }1404}14051406impl<T: Config> Pallet<T> {1407 /// Transform one of possible RMRK keys into a byte key with a RMRK scope.1408 pub fn get_scoped_property_key(rmrk_key: RmrkProperty) -> Result<PropertyKey, DispatchError> {1409 let key = rmrk_key.to_key::<T>()?;14101411 let scoped_key = RMRK_SCOPE1412 .apply(key)1413 .map_err(|_| <Error<T>>::RmrkPropertyKeyIsTooLong)?;14141415 Ok(scoped_key)1416 }14171418 /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet)1419 /// and encoding the value from an arbitrary type into bytes.1420 pub fn encode_rmrk_property<E: Encode>(1421 rmrk_key: RmrkProperty,1422 value: &E,1423 ) -> Result<Property, DispatchError> {1424 let key = rmrk_key.to_key::<T>()?;14251426 let value = Self::encode_property_value(value)?;14271428 let property = Property { key, value };14291430 Ok(property)1431 }14321433 /// Encode property value from an arbitrary type into bytes for storage.1434 pub fn encode_property_value<E: Encode, S: Get<u32>>(1435 value: &E,1436 ) -> Result<BoundedBytes<S>, DispatchError> {1437 let value = value1438 .encode()1439 .try_into()1440 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong)?;14411442 Ok(value)1443 }14441445 /// Decode property value from bytes into an arbitrary type.1446 pub fn decode_property_value<D: Decode, S: Get<u32>>(1447 vec: &BoundedBytes<S>,1448 ) -> Result<D, DispatchError> {1449 vec.decode()1450 .map_err(|_| <Error<T>>::UnableToDecodeRmrkData.into())1451 }14521453 /// Change the limit of a property value byte vector.1454 pub fn rebind<L, S>(vec: &BoundedVec<u8, L>) -> Result<BoundedVec<u8, S>, DispatchError>1455 where1456 BoundedVec<u8, S>: TryFrom<Vec<u8>>,1457 {1458 vec.rebind()1459 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong.into())1460 }14611462 /// Initialize a new NFT collection with certain RMRK-scoped properties.1463 ///1464 /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details.1465 fn init_collection(1466 sender: T::CrossAccountId,1467 data: CreateCollectionData<T::AccountId>,1468 properties: impl Iterator<Item = Property>,1469 ) -> Result<CollectionId, DispatchError> {1470 let collection_id = <PalletNft<T>>::init_collection(1471 sender.clone(),1472 sender,1473 data,1474 up_data_structs::CollectionFlags {1475 external: true,1476 ..Default::default()1477 },1478 );14791480 if let Err(DispatchError::Arithmetic(_)) = &collection_id {1481 return Err(<Error<T>>::NoAvailableCollectionId.into());1482 }14831484 <PalletCommon<T>>::set_scoped_collection_properties(1485 collection_id?,1486 RMRK_SCOPE,1487 properties,1488 )?;14891490 collection_id1491 }14921493 /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner.1494 ///1495 /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details.1496 pub fn create_nft(1497 sender: &T::CrossAccountId,1498 owner: &T::CrossAccountId,1499 collection: &NonfungibleHandle<T>,1500 properties: impl Iterator<Item = Property>,1501 ) -> Result<TokenId, DispatchError> {1502 let data = CreateNftExData {1503 properties: BoundedVec::default(),1504 owner: owner.clone(),1505 };15061507 let budget = budget::Value::new(NESTING_BUDGET);15081509 <PalletNft<T>>::create_item(collection, sender, data, &budget)?;15101511 let nft_id = <PalletNft<T>>::current_token_id(collection.id);15121513 <PalletNft<T>>::set_scoped_token_properties(collection.id, nft_id, RMRK_SCOPE, properties)?;15141515 Ok(nft_id)1516 }15171518 /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner.1519 ///1520 /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details.1521 fn destroy_nft(1522 sender: T::CrossAccountId,1523 collection_id: CollectionId,1524 token_id: TokenId,1525 max_burns: u32,1526 error_if_not_owned: Error<T>,1527 ) -> DispatchResultWithPostInfo {1528 let collection =1529 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;15301531 let token_data =1532 <TokenData<T>>::get((collection_id, token_id)).ok_or(<Error<T>>::NoAvailableNftId)?;15331534 let from = token_data.owner;15351536 let owner_check_budget = budget::Value::new(NESTING_BUDGET);15371538 ensure!(1539 <PalletStructure<T>>::check_indirectly_owned(1540 sender.clone(),1541 collection_id,1542 token_id,1543 None,1544 &owner_check_budget1545 )?,1546 error_if_not_owned,1547 );15481549 let burns_budget = budget::Value::new(max_burns);1550 let breadth_budget = budget::Value::new(max_burns);15511552 <PalletNft<T>>::burn_recursively(1553 &collection,1554 &from,1555 token_id,1556 &burns_budget,1557 &breadth_budget,1558 )1559 }15601561 /// Add a sent token pending acceptance to the target owning token as a property.1562 fn insert_pending_child(1563 target: (CollectionId, TokenId),1564 child: (RmrkCollectionId, RmrkNftId),1565 ) -> DispatchResult {1566 Self::mutate_pending_children(target, |pending_children| {1567 pending_children.insert(child);1568 })1569 }15701571 /// Remove a sent token pending acceptance from the target token's properties.1572 fn remove_pending_child(1573 target: (CollectionId, TokenId),1574 child: (RmrkCollectionId, RmrkNftId),1575 ) -> DispatchResult {1576 Self::mutate_pending_children(target, |pending_children| {1577 pending_children.remove(&child);1578 })1579 }15801581 /// Apply a mutation to the property of a token containing sent tokens1582 /// that are currently pending acceptance.1583 fn mutate_pending_children(1584 (target_collection_id, target_nft_id): (CollectionId, TokenId),1585 f: impl FnOnce(&mut PendingChildrenSet),1586 ) -> DispatchResult {1587 <PalletNft<T>>::try_mutate_token_aux_property(1588 target_collection_id,1589 target_nft_id,1590 RMRK_SCOPE,1591 Self::get_scoped_property_key(PendingChildren)?,1592 |pending_children| -> DispatchResult {1593 let mut map = match pending_children {1594 Some(map) => Self::decode_property_value(map)?,1595 None => PendingChildrenSet::new(),1596 };15971598 f(&mut map);15991600 *pending_children = Some(Self::encode_property_value(&map)?);16011602 Ok(())1603 },1604 )1605 }16061607 /// Get an iterator from a token's property containing tokens sent to it1608 /// that are currently pending acceptance.1609 fn iterate_pending_children(1610 collection_id: CollectionId,1611 nft_id: TokenId,1612 ) -> Result<impl Iterator<Item = PendingChild>, DispatchError> {1613 let property = <PalletNft<T>>::token_aux_property((1614 collection_id,1615 nft_id,1616 RMRK_SCOPE,1617 Self::get_scoped_property_key(PendingChildren)?,1618 ));16191620 let pending_children = match property {1621 Some(map) => Self::decode_property_value(&map)?,1622 None => PendingChildrenSet::new(),1623 };16241625 Ok(pending_children.into_iter())1626 }16271628 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1629 /// Thus, the returned resource ID should be used.1630 ///1631 /// Resource IDs are unique only across an NFT.1632 fn acquire_next_resource_id(1633 collection_id: CollectionId,1634 nft_id: TokenId,1635 ) -> Result<RmrkResourceId, DispatchError> {1636 let resource_id: RmrkResourceId =1637 Self::get_nft_property_decoded(collection_id, nft_id, NextResourceId)?;16381639 let next_id = resource_id1640 .checked_add(1)1641 .ok_or(<Error<T>>::NoAvailableResourceId)?;16421643 <PalletNft<T>>::set_scoped_token_property(1644 collection_id,1645 nft_id,1646 RMRK_SCOPE,1647 Self::encode_rmrk_property(NextResourceId, &next_id)?,1648 )?;16491650 Ok(resource_id)1651 }16521653 /// Create and add a resource for a regular NFT, mark it as pending if the sender1654 /// is not the token owner. The sender must be the collection owner.1655 fn resource_add(1656 sender: T::AccountId,1657 collection_id: CollectionId,1658 nft_id: TokenId,1659 resource: RmrkResourceTypes,1660 ) -> Result<RmrkResourceId, DispatchError> {1661 let collection =1662 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1663 ensure!(collection.owner == sender, Error::<T>::NoPermission);16641665 let sender = T::CrossAccountId::from_sub(sender);1666 let budget = budget::Value::new(NESTING_BUDGET);16671668 let nft_owner = <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1669 .map_err(Self::map_unique_err_to_proxy)?;16701671 let pending = sender != nft_owner;16721673 let id = Self::acquire_next_resource_id(collection_id, nft_id)?;16741675 let resource_info = RmrkResourceInfo {1676 id,1677 resource,1678 pending,1679 pending_removal: false,1680 };16811682 <PalletNft<T>>::try_mutate_token_aux_property(1683 collection_id,1684 nft_id,1685 RMRK_SCOPE,1686 Self::get_scoped_property_key(ResourceId(id))?,1687 |value| -> DispatchResult {1688 *value = Some(Self::encode_property_value(&resource_info)?);16891690 Ok(())1691 },1692 )?;16931694 Ok(id)1695 }16961697 /// Designate a resource for erasure from an NFT, and remove it if the sender is the token owner.1698 /// The sender must be the collection owner.1699 fn resource_remove(1700 sender: T::AccountId,1701 collection_id: CollectionId,1702 nft_id: TokenId,1703 resource_id: RmrkResourceId,1704 ) -> DispatchResult {1705 let collection =1706 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1707 ensure!(collection.owner == sender, Error::<T>::NoPermission);17081709 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;17101711 let resource = <PalletNft<T>>::token_aux_property((1712 collection_id,1713 nft_id,1714 RMRK_SCOPE,1715 resource_id_key.clone(),1716 ))1717 .ok_or(<Error<T>>::ResourceDoesntExist)?;17181719 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource)?;17201721 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1722 let topmost_owner =1723 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)?;17241725 let sender = T::CrossAccountId::from_sub(sender);1726 if topmost_owner == sender {1727 <PalletNft<T>>::remove_token_aux_property(1728 collection_id,1729 nft_id,1730 RMRK_SCOPE,1731 Self::get_scoped_property_key(ResourceId(resource_id))?,1732 );17331734 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1735 let base_id = resource.base;17361737 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1738 }1739 } else {1740 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1741 res.pending_removal = true;17421743 Ok(())1744 })?;1745 }17461747 Ok(())1748 }17491750 /// Remove a Base ID from an NFT if they are associated.1751 /// The Base itself is deleted if the number of associated NFTs reaches 0.1752 fn remove_associated_base_id(1753 collection_id: CollectionId,1754 nft_id: TokenId,1755 base_id: RmrkBaseId,1756 ) -> DispatchResult {1757 <PalletNft<T>>::try_mutate_token_aux_property(1758 collection_id,1759 nft_id,1760 RMRK_SCOPE,1761 Self::get_scoped_property_key(AssociatedBases)?,1762 |value| -> DispatchResult {1763 let mut bases: BasesMap = match value {1764 Some(value) => Self::decode_property_value(value)?,1765 None => BasesMap::new(),1766 };17671768 let remaining = bases.get(&base_id);17691770 if let Some(remaining) = remaining {1771 if let Some(0) | None = remaining.checked_sub(1) {1772 bases.remove(&base_id);1773 }1774 }17751776 *value = Some(Self::encode_property_value(&bases)?);1777 Ok(())1778 },1779 )1780 }17811782 /// Apply a mutation to a resource stored in the token properties of an NFT.1783 fn try_mutate_resource_info(1784 collection_id: CollectionId,1785 nft_id: TokenId,1786 resource_id: RmrkResourceId,1787 f: impl FnOnce(&mut RmrkResourceInfo) -> DispatchResult,1788 ) -> DispatchResult {1789 <PalletNft<T>>::try_mutate_token_aux_property(1790 collection_id,1791 nft_id,1792 RMRK_SCOPE,1793 Self::get_scoped_property_key(ResourceId(resource_id))?,1794 |value| match value {1795 Some(value) => {1796 let mut resource_info: RmrkResourceInfo = Self::decode_property_value(value)?;17971798 f(&mut resource_info)?;17991800 *value = Self::encode_property_value(&resource_info)?;18011802 Ok(())1803 }1804 None => Err(<Error<T>>::ResourceDoesntExist.into()),1805 },1806 )1807 }18081809 /// Change the owner of an NFT collection, ensuring that the sender is the current owner.1810 fn change_collection_owner(1811 collection_id: CollectionId,1812 collection_type: misc::CollectionType,1813 sender: T::AccountId,1814 new_owner: T::AccountId,1815 ) -> DispatchResult {1816 let collection = Self::get_typed_nft_collection(collection_id, collection_type)?;1817 Self::check_collection_owner(&collection, &T::CrossAccountId::from_sub(sender))?;18181819 let mut collection = collection.into_inner();18201821 collection.owner = new_owner;1822 collection.save()1823 }18241825 /// Ensure that an account is the collection owner/issuer, return an error if not.1826 pub fn check_collection_owner(1827 collection: &NonfungibleHandle<T>,1828 account: &T::CrossAccountId,1829 ) -> DispatchResult {1830 collection1831 .check_is_owner(account)1832 .map_err(Self::map_unique_err_to_proxy)1833 }18341835 /// Get the latest yet-unused RMRK collection index from the storage.1836 pub fn last_collection_idx() -> RmrkCollectionId {1837 <CollectionIndex<T>>::get()1838 }18391840 /// Get a mapping from a RMRK collection ID to its corresponding Unique collection ID.1841 pub fn unique_collection_id(1842 rmrk_collection_id: RmrkCollectionId,1843 ) -> Result<CollectionId, DispatchError> {1844 <UniqueCollectionId<T>>::try_get(rmrk_collection_id)1845 .map_err(|_| <Error<T>>::CollectionUnknown.into())1846 }18471848 /// Get a mapping from a Unique collection ID to its RMRK collection ID counterpart, if it exists.1849 pub fn rmrk_collection_id(1850 unique_collection_id: CollectionId,1851 ) -> Result<RmrkCollectionId, DispatchError> {1852 Self::get_collection_property_decoded(unique_collection_id, RmrkInternalCollectionId)1853 }18541855 /// Fetch a Unique NFT collection.1856 pub fn get_nft_collection(1857 collection_id: CollectionId,1858 ) -> Result<NonfungibleHandle<T>, DispatchError> {1859 let collection = <CollectionHandle<T>>::try_get(collection_id)1860 .map_err(|_| <Error<T>>::CollectionUnknown)?;18611862 match collection.mode {1863 CollectionMode::NFT => Ok(NonfungibleHandle::cast(collection)),1864 _ => Err(<Error<T>>::CollectionUnknown.into()),1865 }1866 }18671868 /// Check if an NFT collection with such an ID exists.1869 pub fn collection_exists(collection_id: CollectionId) -> bool {1870 <CollectionHandle<T>>::try_get(collection_id).is_ok()1871 }18721873 /// Fetch and decode a RMRK-scoped collection property value in bytes.1874 pub fn get_collection_property(1875 collection_id: CollectionId,1876 key: RmrkProperty,1877 ) -> Result<PropertyValue, DispatchError> {1878 let collection_property = <PalletCommon<T>>::collection_properties(collection_id)1879 .get(&Self::get_scoped_property_key(key)?)1880 .ok_or(<Error<T>>::CollectionUnknown)?1881 .clone();18821883 Ok(collection_property)1884 }18851886 /// Fetch a RMRK-scoped collection property and decode it from bytes into an appropriate type.1887 pub fn get_collection_property_decoded<V: Decode>(1888 collection_id: CollectionId,1889 key: RmrkProperty,1890 ) -> Result<V, DispatchError> {1891 Self::decode_property_value(&Self::get_collection_property(collection_id, key)?)1892 }18931894 /// Get the type of a collection stored as a scoped property.1895 ///1896 /// RMRK Core proxy differentiates between regular collections as well as RMRK Bases as collections.1897 pub fn get_collection_type(1898 collection_id: CollectionId,1899 ) -> Result<misc::CollectionType, DispatchError> {1900 Self::get_collection_property_decoded(collection_id, CollectionType).map_err(|err| {1901 if err != <Error<T>>::CollectionUnknown.into() {1902 <Error<T>>::CorruptedCollectionType.into()1903 } else {1904 err1905 }1906 })1907 }19081909 /// Ensure that the type of the collection equals the provided type,1910 /// otherwise return an error.1911 pub fn ensure_collection_type(1912 collection_id: CollectionId,1913 collection_type: misc::CollectionType,1914 ) -> DispatchResult {1915 let actual_type = Self::get_collection_type(collection_id)?;1916 ensure!(1917 actual_type == collection_type,1918 <CommonError<T>>::NoPermission1919 );19201921 Ok(())1922 }19231924 /// Fetch an NFT collection, but make sure it has the appropriate type.1925 pub fn get_typed_nft_collection(1926 collection_id: CollectionId,1927 collection_type: misc::CollectionType,1928 ) -> Result<NonfungibleHandle<T>, DispatchError> {1929 Self::ensure_collection_type(collection_id, collection_type)?;19301931 Self::get_nft_collection(collection_id)1932 }19331934 /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection),1935 /// but also return the Unique collection ID.1936 pub fn get_typed_nft_collection_mapped(1937 rmrk_collection_id: RmrkCollectionId,1938 collection_type: misc::CollectionType,1939 ) -> Result<(NonfungibleHandle<T>, CollectionId), DispatchError> {1940 let unique_collection_id = match collection_type {1941 misc::CollectionType::Regular => Self::unique_collection_id(rmrk_collection_id)?,1942 _ => rmrk_collection_id.into(),1943 };19441945 let collection = Self::get_typed_nft_collection(unique_collection_id, collection_type)?;19461947 Ok((collection, unique_collection_id))1948 }19491950 /// Fetch and decode a RMRK-scoped NFT property value in bytes.1951 pub fn get_nft_property(1952 collection_id: CollectionId,1953 nft_id: TokenId,1954 key: RmrkProperty,1955 ) -> Result<PropertyValue, DispatchError> {1956 let nft_property = <PalletNft<T>>::token_properties((collection_id, nft_id))1957 .get(&Self::get_scoped_property_key(key)?)1958 .ok_or(<Error<T>>::RmrkPropertyIsNotFound)?1959 .clone();19601961 Ok(nft_property)1962 }19631964 /// Fetch a RMRK-scoped NFT property and decode it from bytes into an appropriate type.1965 pub fn get_nft_property_decoded<V: Decode>(1966 collection_id: CollectionId,1967 nft_id: TokenId,1968 key: RmrkProperty,1969 ) -> Result<V, DispatchError> {1970 Self::decode_property_value(&Self::get_nft_property(collection_id, nft_id, key)?)1971 }19721973 /// Check that an NFT exists.1974 pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {1975 <TokenData<T>>::contains_key((collection_id, nft_id))1976 }19771978 /// Get the type of an NFT stored as a scoped property.1979 ///1980 /// RMRK Core proxy differentiates between regular NFTs, and RMRK Parts and Themes.1981 pub fn get_nft_type(1982 collection_id: CollectionId,1983 token_id: TokenId,1984 ) -> Result<NftType, DispatchError> {1985 Self::get_nft_property_decoded(collection_id, token_id, TokenType)1986 .map_err(|_| <Error<T>>::NoAvailableNftId.into())1987 }19881989 /// Ensure that the type of the NFT equals the provided type, otherwise return an error.1990 pub fn ensure_nft_type(1991 collection_id: CollectionId,1992 token_id: TokenId,1993 nft_type: NftType,1994 ) -> DispatchResult {1995 let actual_type = Self::get_nft_type(collection_id, token_id)?;1996 ensure!(actual_type == nft_type, <Error<T>>::NoPermission);19971998 Ok(())1999 }20002001 /// Ensure that an account is the owner of the token, either directly2002 /// or at the top of the nesting hierarchy; return an error if it is not.2003 pub fn ensure_nft_owner(2004 collection_id: CollectionId,2005 token_id: TokenId,2006 possible_owner: &T::CrossAccountId,2007 nesting_budget: &dyn budget::Budget,2008 ) -> DispatchResult {2009 let is_owned = <PalletStructure<T>>::check_indirectly_owned(2010 possible_owner.clone(),2011 collection_id,2012 token_id,2013 None,2014 nesting_budget,2015 )2016 .map_err(Self::map_unique_err_to_proxy)?;20172018 ensure!(is_owned, <Error<T>>::NoPermission);20192020 Ok(())2021 }20222023 /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied,2024 /// or, if None are provided, return all non-scoped properties.2025 pub fn filter_user_properties<Key, Value, R, Mapper>(2026 collection_id: CollectionId,2027 token_id: Option<TokenId>,2028 filter_keys: Option<Vec<RmrkPropertyKey>>,2029 mapper: Mapper,2030 ) -> Result<Vec<R>, DispatchError>2031 where2032 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2033 Value: Decode + Default,2034 Mapper: Fn(Key, Value) -> R,2035 {2036 filter_keys2037 .map(|keys| {2038 let properties = keys2039 .into_iter()2040 .filter_map(|key| {2041 let key: Key = key.try_into().ok()?;20422043 let value = match token_id {2044 Some(token_id) => Self::get_nft_property_decoded(2045 collection_id,2046 token_id,2047 UserProperty(key.as_ref()),2048 ),2049 None => Self::get_collection_property_decoded(2050 collection_id,2051 UserProperty(key.as_ref()),2052 ),2053 }2054 .ok()?;20552056 Some(mapper(key, value))2057 })2058 .collect();20592060 Ok(properties)2061 })2062 .unwrap_or_else(|| {2063 let properties =2064 Self::iterate_user_properties(collection_id, token_id, mapper)?.collect();20652066 Ok(properties)2067 })2068 }20692070 /// Get all non-scoped properties from a collection or a token, and apply some transformation,2071 /// supplied by `mapper`, to each key-value pair.2072 pub fn iterate_user_properties<Key, Value, R, Mapper>(2073 collection_id: CollectionId,2074 token_id: Option<TokenId>,2075 mapper: Mapper,2076 ) -> Result<impl Iterator<Item = R>, DispatchError>2077 where2078 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2079 Value: Decode + Default,2080 Mapper: Fn(Key, Value) -> R,2081 {2082 let properties = match token_id {2083 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),2084 None => <PalletCommon<T>>::collection_properties(collection_id),2085 };20862087 let properties = properties.into_iter().filter_map(move |(key, value)| {2088 let key = strip_key_prefix(&key, USER_PROPERTY_PREFIX)?;20892090 let key: Key = key.to_vec().try_into().ok()?;2091 let value: Value = value.decode().ok()?;20922093 Some(mapper(key, value))2094 });20952096 Ok(properties)2097 }20982099 /// Match Unique errors to RMRK's own and return the RMRK error if a match is successful.2100 fn map_unique_err_to_proxy(err: DispatchError) -> DispatchError {2101 map_unique_err_to_proxy! {2102 match err {2103 CommonError::NoPermission => NoPermission,2104 CommonError::CollectionTokenLimitExceeded => CollectionFullOrLocked,2105 CommonError::PublicMintingNotAllowed => NoPermission,2106 CommonError::TokenNotFound => NoAvailableNftId,2107 CommonError::ApprovedValueTooLow => NoPermission,2108 CommonError::CantDestroyNotEmptyCollection => CollectionNotEmpty,2109 StructureError::TokenNotFound => NoAvailableNftId,2110 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf,2111 }2112 }2113 }2114}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # RMRK Core Proxy Pallet18//!19//! A pallet used as proxy for RMRK Core (<https://rmrk-team.github.io/rmrk-substrate/#/pallets/rmrk-core>).20//!21//! - [`Config`]22//! - [`Call`]23//! - [`Pallet`]24//!25//! ## Overview26//!27//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core,28//! binding its externalities to Unique's own underlying structure.29//! It is purposed to mimic RMRK Core exactly, allowing seamless integrations30//! of solutions based on RMRK.31//!32//! RMRK Core itself contains essential functionality for RMRK's nested and33//! multi-resourced NFTs.34//!35//! *Note*, that while RMRK itself is subject to active development and restructuring,36//! the proxy may be caught temporarily out of date.37//!38//! ### What is RMRK?39//!40//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives.41//! Putting these legos together allows a user to create NFT systems of arbitrary complexity.42//!43//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy,44//! make use of specific changeable and partially shared metadata in the form of resources,45//! and more.46//!47//! Visit RMRK documentation and repositories to learn more:48//! - Docs: <https://docs.rmrk.app/getting-started/>49//! - FAQ: <https://coda.io/@rmrk/faq>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>52//!53//! ## Terminology54//!55//! For more information on RMRK, see RMRK's own documentation.56//!57//! ### Intro to RMRK58//!59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add60//! a piece of media on top of the root metadata (NFT's own), be it a different wing61//! on the root template bird or something entirely unrelated.62//!63//! - **Base:** A list of possible "components" - Parts, a combination of which can64//! be appended/equipped to/on an NFT.65//!66//! - **Part:** Something that, together with other Parts, can constitute an NFT.67//! Parts are defined in the Base to which they belong. Parts can be either68//! of the `slot` type or `fixed` type. Slots are intended for equippables.69//! Note that "part of something" and "Part of a Base" can be easily confused,70//! and so in this documentation these words are distinguished by the capital letter.71//!72//! - **Theme:** Named objects of variable => value pairs which get interpolated into73//! the Base's `themable` Parts. Themes can hold any value, but are often represented74//! in RMRK's examples as colors applied to visible Parts.75//!76//! ### Peculiarities in Unique77//!78//! - **Scoped properties:** Properties that are normally obscured from users.79//! Their purpose is to contain structured metadata that was not included in the Unique standard80//! for collections and tokens, meant to be operated on by proxies and other outliers.81//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is82//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined83//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with.84//!85//! - **Auxiliary properties:** A slightly different structure of properties,86//! trading universality of use for more convenient storage, writes and access.87//! Meant to be inaccessible to end users.88//!89//! ## Proxy Implementation90//!91//! An external user is supposed to be able to utilize this proxy as they would92//! utilize RMRK, and get exactly the same results. Normally, Unique transactions93//! are off-limits to RMRK collections and tokens, and vice versa. However,94//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs.95//!96//! ### ID Mapping97//!98//! RMRK's collections' IDs are counted independently of Unique's and start at 0.99//! Note that tokens' IDs still start at 1.100//! The collections themselves, as well as tokens, are stored as Unique collections,101//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa).102//!103//! ### External/Internal Collection Insulation104//!105//! A Unique transaction cannot target collections purposed for RMRK,106//! and they are flagged as `external` to specify that. On the other hand,107//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections.108//!109//! ### Native Properties110//!111//! Many of RMRK's native parameters are stored as scoped properties of a collection112//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:`113//! is an unacceptable symbol in user-defined properties, which, along with other safeguards,114//! makes them impossible to tamper with.115//!116//! ### Collection and NFT Types, or Base, Parts and Themes Handling117//!118//! RMRK introduces the concept of a Base, which is a catalogue of Parts,119//! possible components of an NFT. Due to its similarity with the functionality120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes121//! are this collection's NFTs. See [`CollectionType`] and [`NftType`].122//!123//! ## Interface124//!125//! ### Dispatchables126//!127//! - `create_collection` - Create a new collection of NFTs.128//! - `destroy_collection` - Destroy a collection.129//! - `change_collection_issuer` - Change the issuer of a collection.130//! Analogous to Unique's collection's [`owner`](up_data_structs::Collection).131//! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.**132//! - `mint_nft` - Mint an NFT in a specified collection.133//! - `burn_nft` - Burn an NFT, destroying it and its nested tokens.134//! - `send` - Transfer an NFT from an account/NFT A to another account/NFT B.135//! - `accept_nft` - Accept an NFT sent from another account to self or an owned NFT.136//! - `reject_nft` - Reject an NFT sent from another account to self or owned NFT and **burn it**.137//! - `accept_resource` - Accept the addition of a newly created pending resource to an existing NFT.138//! - `accept_resource_removal` - Accept the removal of a removal-pending resource from an NFT.139//! - `set_property` - Add or edit a custom user property of a token or a collection.140//! - `set_priority` - Set a different order of resource priorities for an NFT.141//! - `add_basic_resource` - Create and set/propose a basic resource for an NFT.142//! - `add_composable_resource` - Create and set/propose a composable resource for an NFT.143//! - `add_slot_resource` - Create and set/propose a slot resource for an NFT.144//! - `remove_resource` - Remove and erase a resource from an NFT.145146#![cfg_attr(not(feature = "std"), no_std)]147148use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};149use frame_system::{pallet_prelude::*, ensure_signed};150use sp_runtime::{DispatchError, Permill, traits::StaticLookup};151use sp_std::{152 vec::Vec,153 collections::{btree_set::BTreeSet, btree_map::BTreeMap},154};155use up_data_structs::{*, mapping::TokenAddressMapping};156use pallet_common::{157 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,158};159use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle, TokenData};160use pallet_structure::{Pallet as PalletStructure, Error as StructureError};161use pallet_evm::account::CrossAccountId;162use core::convert::AsRef;163164pub use pallet::*;165166#[cfg(feature = "runtime-benchmarks")]167pub mod benchmarking;168pub mod misc;169pub mod property;170pub mod rpc;171pub mod weights;172173pub type SelfWeightOf<T> = <T as Config>::WeightInfo;174175use weights::WeightInfo;176use misc::*;177pub use property::*;178179use RmrkProperty::*;180181/// A maximum number of levels of depth in the token nesting tree.182pub const NESTING_BUDGET: u32 = 5;183184type PendingTarget = (CollectionId, TokenId);185type PendingChild = (RmrkCollectionId, RmrkNftId);186type PendingChildrenSet = BTreeSet<PendingChild>;187188type BasesMap = BTreeMap<RmrkBaseId, u32>;189190#[frame_support::pallet]191pub mod pallet {192 use super::*;193194 #[pallet::config]195 pub trait Config:196 frame_system::Config197 + pallet_common::Config198 + pallet_nonfungible::Config199 + pallet_evm::Config200 {201 /// Overarching event type.202 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;203204 /// The weight information of this pallet.205 type WeightInfo: WeightInfo;206 }207208 /// Latest yet-unused collection ID.209 #[pallet::storage]210 #[pallet::getter(fn collection_index)]211 pub type CollectionIndex<T: Config> = StorageValue<_, RmrkCollectionId, ValueQuery>;212213 /// Mapping from RMRK collection ID to Unique's.214 #[pallet::storage]215 pub type UniqueCollectionId<T: Config> =216 StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>;217218 #[pallet::pallet]219 #[pallet::generate_store(pub(super) trait Store)]220 pub struct Pallet<T>(_);221222 #[pallet::event]223 #[pallet::generate_deposit(pub(super) fn deposit_event)]224 pub enum Event<T: Config> {225 CollectionCreated {226 issuer: T::AccountId,227 collection_id: RmrkCollectionId,228 },229 CollectionDestroyed {230 issuer: T::AccountId,231 collection_id: RmrkCollectionId,232 },233 IssuerChanged {234 old_issuer: T::AccountId,235 new_issuer: T::AccountId,236 collection_id: RmrkCollectionId,237 },238 CollectionLocked {239 issuer: T::AccountId,240 collection_id: RmrkCollectionId,241 },242 NftMinted {243 owner: T::AccountId,244 collection_id: RmrkCollectionId,245 nft_id: RmrkNftId,246 },247 NFTBurned {248 owner: T::AccountId,249 nft_id: RmrkNftId,250 },251 NFTSent {252 sender: T::AccountId,253 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,254 collection_id: RmrkCollectionId,255 nft_id: RmrkNftId,256 approval_required: bool,257 },258 NFTAccepted {259 sender: T::AccountId,260 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,261 collection_id: RmrkCollectionId,262 nft_id: RmrkNftId,263 },264 NFTRejected {265 sender: T::AccountId,266 collection_id: RmrkCollectionId,267 nft_id: RmrkNftId,268 },269 PropertySet {270 collection_id: RmrkCollectionId,271 maybe_nft_id: Option<RmrkNftId>,272 key: RmrkKeyString,273 value: RmrkValueString,274 },275 ResourceAdded {276 nft_id: RmrkNftId,277 resource_id: RmrkResourceId,278 },279 ResourceRemoval {280 nft_id: RmrkNftId,281 resource_id: RmrkResourceId,282 },283 ResourceAccepted {284 nft_id: RmrkNftId,285 resource_id: RmrkResourceId,286 },287 ResourceRemovalAccepted {288 nft_id: RmrkNftId,289 resource_id: RmrkResourceId,290 },291 PrioritySet {292 collection_id: RmrkCollectionId,293 nft_id: RmrkNftId,294 },295 }296297 #[pallet::error]298 pub enum Error<T> {299 /* Unique proxy-specific events */300 /// Property of the type of RMRK collection could not be read successfully.301 CorruptedCollectionType,302 // NftTypeEncodeError,303 /// Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH).304 RmrkPropertyKeyIsTooLong,305 /// Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH).306 RmrkPropertyValueIsTooLong,307 /// Could not find a property by the supplied key.308 RmrkPropertyIsNotFound,309 /// Something went wrong when decoding encoded data from the storage.310 /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored.311 UnableToDecodeRmrkData,312313 /* RMRK compatible events */314 /// Only destroying collections without tokens is allowed.315 CollectionNotEmpty,316 /// Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow.317 NoAvailableCollectionId,318 /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow.319 NoAvailableNftId,320 /// Collection does not exist, has a wrong type, or does not map to a Unique ID.321 CollectionUnknown,322 /// No permission to perform action.323 NoPermission,324 /// Token is marked as non-transferable, and thus cannot be transferred.325 NonTransferable,326 /// Too many tokens created in the collection, no new ones are allowed.327 CollectionFullOrLocked,328 /// No such resource found.329 ResourceDoesntExist,330 /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros.331 /// Sending to self is redundant.332 CannotSendToDescendentOrSelf,333 /// Not the target owner of the sent NFT.334 CannotAcceptNonOwnedNft,335 /// Not the target owner of the sent NFT.336 CannotRejectNonOwnedNft,337 /// NFT was not sent and is not pending.338 CannotRejectNonPendingNft,339 /// Resource is not pending for the operation.340 ResourceNotPending,341 /// Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow.342 NoAvailableResourceId,343 }344345 #[pallet::call]346 impl<T: Config> Pallet<T> {347 // todo :refactor replace every collection_id with rmrk_collection_id (and nft_id) in arguments for uniformity?348349 /// Create a new collection of NFTs.350 ///351 /// # Permissions:352 /// * Anyone - will be assigned as the issuer of the collection.353 ///354 /// # Arguments:355 /// - `origin`: sender of the transaction356 /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed.357 /// - `max`: Optional maximum number of tokens.358 /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs.359 /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed.360 #[pallet::call_index(0)]361 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]362 pub fn create_collection(363 origin: OriginFor<T>,364 metadata: RmrkString,365 max: Option<u32>,366 symbol: RmrkCollectionSymbol,367 ) -> DispatchResult {368 let sender = ensure_signed(origin)?;369370 let limits = CollectionLimits {371 owner_can_transfer: Some(false),372 token_limit: max,373 ..Default::default()374 };375376 let data = CreateCollectionData {377 limits: Some(limits),378 token_prefix: symbol379 .into_inner()380 .try_into()381 .map_err(|_| <CommonError<T>>::CollectionTokenPrefixLimitExceeded)?,382 permissions: Some(CollectionPermissions {383 nesting: Some(NestingPermissions {384 token_owner: true,385 collection_admin: false,386 restricted: None,387 #[cfg(feature = "runtime-benchmarks")]388 permissive: false,389 }),390 ..Default::default()391 }),392 ..Default::default()393 };394395 let unique_collection_id = Self::init_collection(396 T::CrossAccountId::from_sub(sender.clone()),397 data,398 [399 Self::encode_rmrk_property(Metadata, &metadata)?,400 Self::encode_rmrk_property(CollectionType, &misc::CollectionType::Regular)?,401 ]402 .into_iter(),403 )?;404 let rmrk_collection_id = <CollectionIndex<T>>::get();405406 <UniqueCollectionId<T>>::insert(rmrk_collection_id, unique_collection_id);407408 <PalletCommon<T>>::set_scoped_collection_property(409 unique_collection_id,410 RMRK_SCOPE,411 Self::encode_rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?,412 )?;413414 <CollectionIndex<T>>::mutate(|n| *n += 1);415416 Self::deposit_event(Event::CollectionCreated {417 issuer: sender,418 collection_id: rmrk_collection_id,419 });420421 Ok(())422 }423424 /// Destroy a collection.425 ///426 /// Only empty collections can be destroyed. If it has any tokens, they must be burned first.427 ///428 /// # Permissions:429 /// * Collection issuer430 ///431 /// # Arguments:432 /// - `origin`: sender of the transaction433 /// - `collection_id`: RMRK ID of the collection to destroy.434 #[pallet::call_index(1)]435 #[pallet::weight(<SelfWeightOf<T>>::destroy_collection())]436 pub fn destroy_collection(437 origin: OriginFor<T>,438 collection_id: RmrkCollectionId,439 ) -> DispatchResult {440 let sender = ensure_signed(origin)?;441 let cross_sender = T::CrossAccountId::from_sub(sender.clone());442443 let collection = Self::get_typed_nft_collection(444 Self::unique_collection_id(collection_id)?,445 misc::CollectionType::Regular,446 )?;447 collection.check_is_external()?;448449 <PalletNft<T>>::destroy_collection(collection, &cross_sender)450 .map_err(Self::map_unique_err_to_proxy)?;451452 Self::deposit_event(Event::CollectionDestroyed {453 issuer: sender,454 collection_id,455 });456457 Ok(())458 }459460 /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection).461 ///462 /// # Permissions:463 /// * Collection issuer464 ///465 /// # Arguments:466 /// - `origin`: sender of the transaction467 /// - `collection_id`: RMRK collection ID to change the issuer of.468 /// - `new_issuer`: Collection's new issuer.469 #[pallet::call_index(2)]470 #[pallet::weight(<SelfWeightOf<T>>::change_collection_issuer())]471 pub fn change_collection_issuer(472 origin: OriginFor<T>,473 collection_id: RmrkCollectionId,474 new_issuer: <T::Lookup as StaticLookup>::Source,475 ) -> DispatchResult {476 let sender = ensure_signed(origin)?;477478 let collection = Self::get_nft_collection(Self::unique_collection_id(collection_id)?)?;479 collection.check_is_external()?;480481 let new_issuer = T::Lookup::lookup(new_issuer)?;482483 Self::change_collection_owner(484 Self::unique_collection_id(collection_id)?,485 misc::CollectionType::Regular,486 sender.clone(),487 new_issuer.clone(),488 )?;489490 Self::deposit_event(Event::IssuerChanged {491 old_issuer: sender,492 new_issuer,493 collection_id,494 });495496 Ok(())497 }498499 /// "Lock" the collection and prevent new token creation. Cannot be undone.500 ///501 /// # Permissions:502 /// * Collection issuer503 ///504 /// # Arguments:505 /// - `origin`: sender of the transaction506 /// - `collection_id`: RMRK ID of the collection to lock.507 #[pallet::call_index(3)]508 #[pallet::weight(<SelfWeightOf<T>>::lock_collection())]509 pub fn lock_collection(510 origin: OriginFor<T>,511 collection_id: RmrkCollectionId,512 ) -> DispatchResult {513 let sender = ensure_signed(origin)?;514 let cross_sender = T::CrossAccountId::from_sub(sender.clone());515516 let collection = Self::get_typed_nft_collection(517 Self::unique_collection_id(collection_id)?,518 misc::CollectionType::Regular,519 )?;520 collection.check_is_external()?;521522 Self::check_collection_owner(&collection, &cross_sender)?;523524 let token_count = collection.total_supply();525526 let mut collection = collection.into_inner();527 collection.limits.token_limit = Some(token_count);528 collection.save()?;529530 Self::deposit_event(Event::CollectionLocked {531 issuer: sender,532 collection_id,533 });534535 Ok(())536 }537538 /// Mint an NFT in a specified collection.539 ///540 /// # Permissions:541 /// * Collection issuer542 ///543 /// # Arguments:544 /// - `origin`: sender of the transaction545 /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer).546 /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed.547 /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed.548 /// - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed.549 /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed.550 /// - `transferable`: Can this NFT be transferred? Cannot be changed.551 /// - `resources`: Resource data to be added to the NFT immediately after minting.552 #[pallet::call_index(4)]553 #[pallet::weight(<SelfWeightOf<T>>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))]554 pub fn mint_nft(555 origin: OriginFor<T>,556 owner: Option<T::AccountId>,557 collection_id: RmrkCollectionId,558 recipient: Option<T::AccountId>,559 royalty_amount: Option<Permill>,560 metadata: RmrkString,561 transferable: bool,562 resources: Option<BoundedVec<RmrkResourceTypes, MaxResourcesOnMint>>,563 ) -> DispatchResult {564 let sender = ensure_signed(origin)?;565 let cross_sender = T::CrossAccountId::from_sub(sender.clone());566567 let owner = owner.unwrap_or(sender.clone());568 let cross_owner = T::CrossAccountId::from_sub(owner.clone());569570 let collection = Self::get_typed_nft_collection(571 Self::unique_collection_id(collection_id)?,572 misc::CollectionType::Regular,573 )?;574 collection.check_is_external()?;575576 let royalty_info = royalty_amount.map(|amount| rmrk_traits::RoyaltyInfo {577 recipient: recipient.unwrap_or_else(|| owner.clone()),578 amount,579 });580581 let nft_id = Self::create_nft(582 &cross_sender,583 &cross_owner,584 &collection,585 [586 Self::encode_rmrk_property(TokenType, &NftType::Regular)?,587 Self::encode_rmrk_property(Transferable, &transferable)?,588 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,589 Self::encode_rmrk_property(RoyaltyInfo, &royalty_info)?,590 Self::encode_rmrk_property(Metadata, &metadata)?,591 Self::encode_rmrk_property(Equipped, &false)?,592 Self::encode_rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,593 Self::encode_rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,594 Self::encode_rmrk_property(PendingChildren, &PendingChildrenSet::new())?,595 Self::encode_rmrk_property(AssociatedBases, &BasesMap::new())?,596 ]597 .into_iter(),598 )599 .map_err(|err| match err {600 DispatchError::Arithmetic(_) => <Error<T>>::NoAvailableNftId.into(),601 err => Self::map_unique_err_to_proxy(err),602 })?;603604 if let Some(resources) = resources {605 for resource in resources {606 Self::resource_add(sender.clone(), collection.id, nft_id, resource)?;607 }608 }609610 Self::deposit_event(Event::NftMinted {611 owner,612 collection_id,613 nft_id: nft_id.0,614 });615616 Ok(())617 }618619 /// Burn an NFT, destroying it and its nested tokens up to the specified limit.620 /// If the burning budget is exceeded, the transaction is reverted.621 ///622 /// This is the way to burn a nested token as well.623 ///624 /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively).625 ///626 /// # Permissions:627 /// * Token owner628 ///629 /// # Arguments:630 /// - `origin`: sender of the transaction631 /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to.632 /// - `nft_id`: ID of the NFT to be destroyed.633 /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction634 /// is reverted if there are more tokens to burn in the nesting tree than this number.635 /// This is primarily a mechanism of transaction weight control.636 #[pallet::call_index(5)]637 #[pallet::weight(<SelfWeightOf<T>>::burn_nft(*max_burns))]638 pub fn burn_nft(639 origin: OriginFor<T>,640 collection_id: RmrkCollectionId,641 nft_id: RmrkNftId,642 max_burns: u32,643 ) -> DispatchResult {644 let sender = ensure_signed(origin)?;645 let cross_sender = T::CrossAccountId::from_sub(sender.clone());646647 let collection = Self::get_typed_nft_collection(648 Self::unique_collection_id(collection_id)?,649 misc::CollectionType::Regular,650 )?;651 collection.check_is_external()?;652653 Self::destroy_nft(654 cross_sender,655 Self::unique_collection_id(collection_id)?,656 nft_id.into(),657 max_burns,658 <Error<T>>::NoPermission,659 )660 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;661662 Self::deposit_event(Event::NFTBurned {663 owner: sender,664 nft_id,665 });666667 Ok(())668 }669670 /// Transfer an NFT from an account/NFT A to another account/NFT B.671 /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`].672 ///673 /// If the target owner is an NFT owned by another account, then the NFT will enter674 /// the pending state and will have to be accepted by the other account.675 ///676 /// # Permissions:677 /// - Token owner678 ///679 /// # Arguments:680 /// - `origin`: sender of the transaction681 /// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred.682 /// - `rmrk_nft_id`: ID of the NFT to be transferred.683 /// - `new_owner`: New owner of the nft which can be either an account or a NFT.684 #[pallet::call_index(6)]685 #[pallet::weight(<SelfWeightOf<T>>::send())]686 pub fn send(687 origin: OriginFor<T>,688 rmrk_collection_id: RmrkCollectionId,689 rmrk_nft_id: RmrkNftId,690 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,691 ) -> DispatchResult {692 let sender = ensure_signed(origin.clone())?;693 let cross_sender = T::CrossAccountId::from_sub(sender.clone());694695 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;696 let nft_id = rmrk_nft_id.into();697698 let collection =699 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;700 collection.check_is_external()?;701702 let token_data =703 <TokenData<T>>::get((collection_id, nft_id)).ok_or(<Error<T>>::NoAvailableNftId)?;704705 let from = token_data.owner;706707 ensure!(708 Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)?,709 <Error<T>>::NonTransferable710 );711712 ensure!(713 Self::get_nft_property_decoded::<Option<PendingTarget>>(714 collection_id,715 nft_id,716 RmrkProperty::PendingNftAccept717 )?718 .is_none(),719 <Error<T>>::NoPermission720 );721722 let target_owner;723 let approval_required;724725 match new_owner {726 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {727 target_owner = T::CrossAccountId::from_sub(account_id.clone());728 approval_required = false;729 }730 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(731 target_collection_id,732 target_nft_id,733 ) => {734 let target_collection_id = Self::unique_collection_id(target_collection_id)?;735736 let target_nft_budget = budget::Value::new(NESTING_BUDGET);737738 let target_nft_owner = <PalletStructure<T>>::get_checked_topmost_owner(739 target_collection_id,740 target_nft_id.into(),741 Some((collection_id, nft_id)),742 &target_nft_budget,743 )744 .map_err(Self::map_unique_err_to_proxy)?745 .ok_or::<DispatchError>(<Error<T>>::NoPermission.into())?;746747 approval_required = cross_sender != target_nft_owner;748749 if approval_required {750 target_owner = target_nft_owner;751752 <PalletNft<T>>::set_scoped_token_property(753 collection.id,754 nft_id,755 RMRK_SCOPE,756 Self::encode_rmrk_property::<Option<PendingTarget>>(757 PendingNftAccept,758 &Some((target_collection_id, target_nft_id.into())),759 )?,760 )?;761762 Self::insert_pending_child(763 (target_collection_id, target_nft_id.into()),764 (rmrk_collection_id, rmrk_nft_id),765 )?;766 } else {767 target_owner = T::CrossTokenAddressMapping::token_to_address(768 target_collection_id,769 target_nft_id.into(),770 );771 }772 }773 }774775 let src_nft_budget = budget::Value::new(NESTING_BUDGET);776777 <PalletNft<T>>::transfer_from(778 &collection,779 &cross_sender,780 &from,781 &target_owner,782 nft_id,783 &src_nft_budget,784 )785 .map_err(Self::map_unique_err_to_proxy)?;786787 Self::deposit_event(Event::NFTSent {788 sender,789 recipient: new_owner,790 collection_id: rmrk_collection_id,791 nft_id: rmrk_nft_id,792 approval_required,793 });794795 Ok(())796 }797798 /// Accept an NFT sent from another account to self or an owned NFT.799 ///800 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.801 ///802 /// # Permissions:803 /// - Token-owner-to-be804 ///805 /// # Arguments:806 /// - `origin`: sender of the transaction807 /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted.808 /// - `rmrk_nft_id`: ID of the NFT to be accepted.809 /// - `new_owner`: Either the sender's account ID or a sender-owned NFT,810 /// whichever the accepted NFT was sent to.811 #[pallet::call_index(7)]812 #[pallet::weight(<SelfWeightOf<T>>::accept_nft())]813 pub fn accept_nft(814 origin: OriginFor<T>,815 rmrk_collection_id: RmrkCollectionId,816 rmrk_nft_id: RmrkNftId,817 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,818 ) -> DispatchResult {819 let sender = ensure_signed(origin.clone())?;820 let cross_sender = T::CrossAccountId::from_sub(sender.clone());821822 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;823 let nft_id = rmrk_nft_id.into();824825 let collection =826 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;827 collection.check_is_external()?;828829 let new_cross_owner = match new_owner {830 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {831 T::CrossAccountId::from_sub(account_id.clone())832 }833 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(834 target_collection_id,835 target_nft_id,836 ) => {837 let target_collection_id = Self::unique_collection_id(target_collection_id)?;838839 T::CrossTokenAddressMapping::token_to_address(840 target_collection_id,841 TokenId(target_nft_id),842 )843 }844 };845846 let budget = budget::Value::new(NESTING_BUDGET);847848 <PalletNft<T>>::transfer(849 &collection,850 &cross_sender,851 &new_cross_owner,852 nft_id,853 &budget,854 )855 .map_err(|err| {856 if err == <CommonError<T>>::UserIsNotAllowedToNest.into() {857 <Error<T>>::CannotAcceptNonOwnedNft.into()858 } else {859 Self::map_unique_err_to_proxy(err)860 }861 })?;862863 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(864 collection_id,865 nft_id,866 RmrkProperty::PendingNftAccept,867 )?;868869 if let Some(pending_target) = pending_target {870 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?;871872 <PalletNft<T>>::set_scoped_token_property(873 collection.id,874 nft_id,875 RMRK_SCOPE,876 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,877 )?;878 }879880 Self::deposit_event(Event::NFTAccepted {881 sender,882 recipient: new_owner,883 collection_id: rmrk_collection_id,884 nft_id: rmrk_nft_id,885 });886887 Ok(())888 }889890 /// Reject an NFT sent from another account to self or owned NFT.891 /// The NFT in question will not be sent back and burnt instead.892 ///893 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.894 ///895 /// # Permissions:896 /// - Token-owner-to-be-not897 ///898 /// # Arguments:899 /// - `origin`: sender of the transaction900 /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected.901 /// - `rmrk_nft_id`: ID of the NFT to be rejected.902 #[pallet::call_index(8)]903 #[pallet::weight(<SelfWeightOf<T>>::reject_nft())]904 pub fn reject_nft(905 origin: OriginFor<T>,906 rmrk_collection_id: RmrkCollectionId,907 rmrk_nft_id: RmrkNftId,908 ) -> DispatchResult {909 let sender = ensure_signed(origin)?;910 let cross_sender = T::CrossAccountId::from_sub(sender.clone());911912 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;913 let nft_id = rmrk_nft_id.into();914915 let collection =916 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;917 collection.check_is_external()?;918919 ensure!(920 <TokenData<T>>::get((collection_id, nft_id)).is_some(),921 <Error<T>>::NoAvailableNftId922 );923924 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(925 collection_id,926 nft_id,927 RmrkProperty::PendingNftAccept,928 )?;929930 match pending_target {931 Some(pending_target) => {932 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?933 }934 None => return Err(<Error<T>>::CannotRejectNonPendingNft.into()),935 }936937 Self::destroy_nft(938 cross_sender,939 collection_id,940 nft_id,941 NESTING_BUDGET,942 <Error<T>>::CannotRejectNonOwnedNft,943 )944 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;945946 Self::deposit_event(Event::NFTRejected {947 sender,948 collection_id: rmrk_collection_id,949 nft_id: rmrk_nft_id,950 });951952 Ok(())953 }954955 /// Accept the addition of a newly created pending resource to an existing NFT.956 ///957 /// This transaction is needed when a resource is created and assigned to an NFT958 /// by a non-owner, i.e. the collection issuer, with one of the959 /// [`add_...` transactions](Pallet::add_basic_resource).960 ///961 /// # Permissions:962 /// - Token owner963 ///964 /// # Arguments:965 /// - `origin`: sender of the transaction966 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.967 /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted.968 /// - `resource_id`: ID of the newly created pending resource.969 /// accept the addition of a new resource to an existing NFT970 #[pallet::call_index(9)]971 #[pallet::weight(<SelfWeightOf<T>>::accept_resource())]972 pub fn accept_resource(973 origin: OriginFor<T>,974 rmrk_collection_id: RmrkCollectionId,975 rmrk_nft_id: RmrkNftId,976 resource_id: RmrkResourceId,977 ) -> DispatchResult {978 let sender = ensure_signed(origin)?;979 let cross_sender = T::CrossAccountId::from_sub(sender);980981 let collection_id = Self::unique_collection_id(rmrk_collection_id)982 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;983 let collection =984 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;985 collection.check_is_external()?;986987 let nft_id = rmrk_nft_id.into();988989 let budget = budget::Value::new(NESTING_BUDGET);990991 let nft_owner =992 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)993 .map_err(|_| <Error<T>>::ResourceDoesntExist)?994 .ok_or::<DispatchError>(<Error<T>>::NoPermission.into())?;995996 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {997 ensure!(res.pending, <Error<T>>::ResourceNotPending);998 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);9991000 res.pending = false;10011002 Ok(())1003 })?;10041005 Self::deposit_event(Event::<T>::ResourceAccepted {1006 nft_id: rmrk_nft_id,1007 resource_id,1008 });10091010 Ok(())1011 }10121013 /// Accept the removal of a removal-pending resource from an NFT.1014 ///1015 /// This transaction is needed when a non-owner, i.e. the collection issuer,1016 /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT.1017 ///1018 /// # Permissions:1019 /// - Token owner1020 ///1021 /// # Arguments:1022 /// - `origin`: sender of the transaction1023 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1024 /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed.1025 /// - `resource_id`: ID of the removal-pending resource.1026 #[pallet::call_index(10)]1027 #[pallet::weight(<SelfWeightOf<T>>::accept_resource_removal())]1028 pub fn accept_resource_removal(1029 origin: OriginFor<T>,1030 rmrk_collection_id: RmrkCollectionId,1031 rmrk_nft_id: RmrkNftId,1032 resource_id: RmrkResourceId,1033 ) -> DispatchResult {1034 let sender = ensure_signed(origin)?;1035 let cross_sender = T::CrossAccountId::from_sub(sender);10361037 let collection_id = Self::unique_collection_id(rmrk_collection_id)1038 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;1039 let collection =1040 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1041 collection.check_is_external()?;10421043 let nft_id = rmrk_nft_id.into();10441045 let budget = budget::Value::new(NESTING_BUDGET);10461047 let nft_owner =1048 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1049 .map_err(|_| <Error<T>>::ResourceDoesntExist)?1050 .ok_or::<DispatchError>(<Error<T>>::NoPermission.into())?;10511052 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);10531054 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;10551056 let resource_info = <PalletNft<T>>::token_aux_property((1057 collection_id,1058 nft_id,1059 RMRK_SCOPE,1060 resource_id_key.clone(),1061 ))1062 .ok_or(<Error<T>>::ResourceDoesntExist)?;10631064 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource_info)?;10651066 ensure!(1067 resource_info.pending_removal,1068 <Error<T>>::ResourceNotPending1069 );10701071 <PalletNft<T>>::remove_token_aux_property(1072 collection_id,1073 nft_id,1074 RMRK_SCOPE,1075 resource_id_key,1076 );10771078 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1079 let base_id = resource.base;10801081 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1082 }10831084 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {1085 nft_id: rmrk_nft_id,1086 resource_id,1087 });10881089 Ok(())1090 }10911092 /// Add or edit a custom user property, a key-value pair, describing the metadata1093 /// of a token or a collection, on either one of these.1094 ///1095 /// Note that in this proxy implementation many details regarding RMRK are stored1096 /// as scoped properties prefixed with "rmrk:", normally inaccessible1097 /// to external transactions and RPCs.1098 ///1099 /// # Permissions:1100 /// - Collection issuer - in case of collection property1101 /// - Token owner - in case of NFT property1102 ///1103 /// # Arguments:1104 /// - `origin`: sender of the transaction1105 /// - `rmrk_collection_id`: RMRK collection ID.1106 /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection.1107 /// - `key`: Key of the custom property to be referenced by.1108 /// - `value`: Value of the custom property to be stored.1109 #[pallet::call_index(11)]1110 #[pallet::weight(<SelfWeightOf<T>>::set_property())]1111 pub fn set_property(1112 origin: OriginFor<T>,1113 #[pallet::compact] rmrk_collection_id: RmrkCollectionId,1114 maybe_nft_id: Option<RmrkNftId>,1115 key: RmrkKeyString,1116 value: RmrkValueString,1117 ) -> DispatchResult {1118 let sender = ensure_signed(origin)?;1119 let sender = T::CrossAccountId::from_sub(sender);11201121 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1122 let collection =1123 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1124 collection.check_is_external()?;11251126 let budget = budget::Value::new(NESTING_BUDGET);11271128 match maybe_nft_id {1129 Some(nft_id) => {1130 let token_id: TokenId = nft_id.into();11311132 Self::ensure_nft_type(collection_id, token_id, NftType::Regular)?;1133 Self::ensure_nft_owner(collection_id, token_id, &sender, &budget)?;11341135 <PalletNft<T>>::set_scoped_token_property(1136 collection_id,1137 token_id,1138 RMRK_SCOPE,1139 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1140 )?;1141 }1142 None => {1143 let collection = Self::get_typed_nft_collection(1144 collection_id,1145 misc::CollectionType::Regular,1146 )?;11471148 Self::check_collection_owner(&collection, &sender)?;11491150 <PalletCommon<T>>::set_scoped_collection_property(1151 collection_id,1152 RMRK_SCOPE,1153 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1154 )?;1155 }1156 }11571158 Self::deposit_event(Event::PropertySet {1159 collection_id: rmrk_collection_id,1160 maybe_nft_id,1161 key,1162 value,1163 });11641165 Ok(())1166 }11671168 /// Set a different order of resource priorities for an NFT. Priorities can be used,1169 /// for example, for order of rendering.1170 ///1171 /// Note that the priorities are not updated automatically, and are an empty vector1172 /// by default. There is no pre-set definition for the order to be particular,1173 /// it can be interpreted arbitrarily use-case by use-case.1174 ///1175 /// # Permissions:1176 /// - Token owner1177 ///1178 /// # Arguments:1179 /// - `origin`: sender of the transaction1180 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1181 /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for.1182 /// - `priorities`: Ordered vector of resource IDs.1183 #[pallet::call_index(12)]1184 #[pallet::weight(<SelfWeightOf<T>>::set_priority())]1185 pub fn set_priority(1186 origin: OriginFor<T>,1187 rmrk_collection_id: RmrkCollectionId,1188 rmrk_nft_id: RmrkNftId,1189 priorities: BoundedVec<RmrkResourceId, RmrkMaxPriorities>,1190 ) -> DispatchResult {1191 let sender = ensure_signed(origin)?;1192 let sender = T::CrossAccountId::from_sub(sender);11931194 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1195 let nft_id = rmrk_nft_id.into();11961197 let collection =1198 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1199 collection.check_is_external()?;12001201 let budget = budget::Value::new(NESTING_BUDGET);12021203 Self::ensure_nft_type(collection_id, nft_id, NftType::Regular)?;1204 Self::ensure_nft_owner(collection_id, nft_id, &sender, &budget)?;12051206 <PalletNft<T>>::set_scoped_token_property(1207 collection_id,1208 nft_id,1209 RMRK_SCOPE,1210 Self::encode_rmrk_property(ResourcePriorities, &priorities.into_inner())?,1211 )?;12121213 Self::deposit_event(Event::<T>::PrioritySet {1214 collection_id: rmrk_collection_id,1215 nft_id: rmrk_nft_id,1216 });12171218 Ok(())1219 }12201221 /// Create and set/propose a basic resource for an NFT.1222 ///1223 /// A basic resource is the simplest, lacking a Base and anything that comes with it.1224 /// See RMRK docs for more information and examples.1225 ///1226 /// # Permissions:1227 /// - Collection issuer - if not the token owner, adding the resource will warrant1228 /// the owner's [acceptance](Pallet::accept_resource).1229 ///1230 /// # Arguments:1231 /// - `origin`: sender of the transaction1232 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1233 /// - `nft_id`: ID of the NFT to assign a resource to.1234 /// - `resource`: Data of the resource to be created.1235 #[pallet::call_index(13)]1236 #[pallet::weight(<SelfWeightOf<T>>::add_basic_resource())]1237 pub fn add_basic_resource(1238 origin: OriginFor<T>,1239 rmrk_collection_id: RmrkCollectionId,1240 nft_id: RmrkNftId,1241 resource: RmrkBasicResource,1242 ) -> DispatchResult {1243 let sender = ensure_signed(origin.clone())?;12441245 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1246 let collection =1247 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1248 collection.check_is_external()?;12491250 let resource_id = Self::resource_add(1251 sender,1252 collection_id,1253 nft_id.into(),1254 RmrkResourceTypes::Basic(resource),1255 )?;12561257 Self::deposit_event(Event::ResourceAdded {1258 nft_id,1259 resource_id,1260 });1261 Ok(())1262 }12631264 /// Create and set/propose a composable resource for an NFT.1265 ///1266 /// A composable resource links to a Base and has a subset of its Parts it is composed of.1267 /// See RMRK docs for more information and examples.1268 ///1269 /// # Permissions:1270 /// - Collection issuer - if not the token owner, adding the resource will warrant1271 /// the owner's [acceptance](Pallet::accept_resource).1272 ///1273 /// # Arguments:1274 /// - `origin`: sender of the transaction1275 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1276 /// - `nft_id`: ID of the NFT to assign a resource to.1277 /// - `resource`: Data of the resource to be created.1278 #[pallet::call_index(14)]1279 #[pallet::weight(<SelfWeightOf<T>>::add_composable_resource())]1280 pub fn add_composable_resource(1281 origin: OriginFor<T>,1282 rmrk_collection_id: RmrkCollectionId,1283 nft_id: RmrkNftId,1284 resource: RmrkComposableResource,1285 ) -> DispatchResult {1286 let sender = ensure_signed(origin.clone())?;12871288 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1289 let collection =1290 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1291 collection.check_is_external()?;12921293 let base_id = resource.base;12941295 let resource_id = Self::resource_add(1296 sender,1297 collection_id,1298 nft_id.into(),1299 RmrkResourceTypes::Composable(resource),1300 )?;13011302 <PalletNft<T>>::try_mutate_token_aux_property(1303 collection_id,1304 nft_id.into(),1305 RMRK_SCOPE,1306 Self::get_scoped_property_key(AssociatedBases)?,1307 |value| -> DispatchResult {1308 let mut bases: BasesMap = match value {1309 Some(value) => Self::decode_property_value(value)?,1310 None => BasesMap::new(),1311 };13121313 *bases.entry(base_id).or_insert(0) += 1;13141315 *value = Some(Self::encode_property_value(&bases)?);1316 Ok(())1317 },1318 )?;13191320 Self::deposit_event(Event::ResourceAdded {1321 nft_id,1322 resource_id,1323 });1324 Ok(())1325 }13261327 /// Create and set/propose a slot resource for an NFT.1328 ///1329 /// A slot resource links to a Base and a slot ID in it which it can fit into.1330 /// See RMRK docs for more information and examples.1331 ///1332 /// # Permissions:1333 /// - Collection issuer - if not the token owner, adding the resource will warrant1334 /// the owner's [acceptance](Pallet::accept_resource).1335 ///1336 /// # Arguments:1337 /// - `origin`: sender of the transaction1338 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1339 /// - `nft_id`: ID of the NFT to assign a resource to.1340 /// - `resource`: Data of the resource to be created.1341 #[pallet::call_index(15)]1342 #[pallet::weight(<SelfWeightOf<T>>::add_slot_resource())]1343 pub fn add_slot_resource(1344 origin: OriginFor<T>,1345 rmrk_collection_id: RmrkCollectionId,1346 nft_id: RmrkNftId,1347 resource: RmrkSlotResource,1348 ) -> DispatchResult {1349 let sender = ensure_signed(origin.clone())?;13501351 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1352 let collection =1353 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1354 collection.check_is_external()?;13551356 let resource_id = Self::resource_add(1357 sender,1358 collection_id,1359 nft_id.into(),1360 RmrkResourceTypes::Slot(resource),1361 )?;13621363 Self::deposit_event(Event::ResourceAdded {1364 nft_id,1365 resource_id,1366 });1367 Ok(())1368 }13691370 /// Remove and erase a resource from an NFT.1371 ///1372 /// If the sender does not own the NFT, then it will be pending confirmation,1373 /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner.1374 ///1375 /// # Permissions1376 /// - Collection issuer1377 ///1378 /// # Arguments1379 /// - `origin`: sender of the transaction1380 /// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.1381 /// - `nft_id`: ID of the NFT with a resource to be removed.1382 /// - `resource_id`: ID of the resource to be removed.1383 #[pallet::call_index(16)]1384 #[pallet::weight(<SelfWeightOf<T>>::remove_resource())]1385 pub fn remove_resource(1386 origin: OriginFor<T>,1387 rmrk_collection_id: RmrkCollectionId,1388 nft_id: RmrkNftId,1389 resource_id: RmrkResourceId,1390 ) -> DispatchResult {1391 let sender = ensure_signed(origin.clone())?;13921393 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1394 let collection =1395 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1396 collection.check_is_external()?;13971398 Self::resource_remove(sender, collection_id, nft_id.into(), resource_id)?;13991400 Self::deposit_event(Event::ResourceRemoval {1401 nft_id,1402 resource_id,1403 });1404 Ok(())1405 }1406 }1407}14081409impl<T: Config> Pallet<T> {1410 /// Transform one of possible RMRK keys into a byte key with a RMRK scope.1411 pub fn get_scoped_property_key(rmrk_key: RmrkProperty) -> Result<PropertyKey, DispatchError> {1412 let key = rmrk_key.to_key::<T>()?;14131414 let scoped_key = RMRK_SCOPE1415 .apply(key)1416 .map_err(|_| <Error<T>>::RmrkPropertyKeyIsTooLong)?;14171418 Ok(scoped_key)1419 }14201421 /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet)1422 /// and encoding the value from an arbitrary type into bytes.1423 pub fn encode_rmrk_property<E: Encode>(1424 rmrk_key: RmrkProperty,1425 value: &E,1426 ) -> Result<Property, DispatchError> {1427 let key = rmrk_key.to_key::<T>()?;14281429 let value = Self::encode_property_value(value)?;14301431 let property = Property { key, value };14321433 Ok(property)1434 }14351436 /// Encode property value from an arbitrary type into bytes for storage.1437 pub fn encode_property_value<E: Encode, S: Get<u32>>(1438 value: &E,1439 ) -> Result<BoundedBytes<S>, DispatchError> {1440 let value = value1441 .encode()1442 .try_into()1443 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong)?;14441445 Ok(value)1446 }14471448 /// Decode property value from bytes into an arbitrary type.1449 pub fn decode_property_value<D: Decode, S: Get<u32>>(1450 vec: &BoundedBytes<S>,1451 ) -> Result<D, DispatchError> {1452 vec.decode()1453 .map_err(|_| <Error<T>>::UnableToDecodeRmrkData.into())1454 }14551456 /// Change the limit of a property value byte vector.1457 pub fn rebind<L, S>(vec: &BoundedVec<u8, L>) -> Result<BoundedVec<u8, S>, DispatchError>1458 where1459 BoundedVec<u8, S>: TryFrom<Vec<u8>>,1460 {1461 vec.rebind()1462 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong.into())1463 }14641465 /// Initialize a new NFT collection with certain RMRK-scoped properties.1466 ///1467 /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details.1468 fn init_collection(1469 sender: T::CrossAccountId,1470 data: CreateCollectionData<T::AccountId>,1471 properties: impl Iterator<Item = Property>,1472 ) -> Result<CollectionId, DispatchError> {1473 let collection_id = <PalletNft<T>>::init_collection(1474 sender.clone(),1475 sender,1476 data,1477 up_data_structs::CollectionFlags {1478 external: true,1479 ..Default::default()1480 },1481 );14821483 if let Err(DispatchError::Arithmetic(_)) = &collection_id {1484 return Err(<Error<T>>::NoAvailableCollectionId.into());1485 }14861487 <PalletCommon<T>>::set_scoped_collection_properties(1488 collection_id?,1489 RMRK_SCOPE,1490 properties,1491 )?;14921493 collection_id1494 }14951496 /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner.1497 ///1498 /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details.1499 pub fn create_nft(1500 sender: &T::CrossAccountId,1501 owner: &T::CrossAccountId,1502 collection: &NonfungibleHandle<T>,1503 properties: impl Iterator<Item = Property>,1504 ) -> Result<TokenId, DispatchError> {1505 let data = CreateNftExData {1506 properties: BoundedVec::default(),1507 owner: owner.clone(),1508 };15091510 let budget = budget::Value::new(NESTING_BUDGET);15111512 <PalletNft<T>>::create_item(collection, sender, data, &budget)?;15131514 let nft_id = <PalletNft<T>>::current_token_id(collection.id);15151516 <PalletNft<T>>::set_scoped_token_properties(collection.id, nft_id, RMRK_SCOPE, properties)?;15171518 Ok(nft_id)1519 }15201521 /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner.1522 ///1523 /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details.1524 fn destroy_nft(1525 sender: T::CrossAccountId,1526 collection_id: CollectionId,1527 token_id: TokenId,1528 max_burns: u32,1529 error_if_not_owned: Error<T>,1530 ) -> DispatchResultWithPostInfo {1531 let collection =1532 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;15331534 let token_data =1535 <TokenData<T>>::get((collection_id, token_id)).ok_or(<Error<T>>::NoAvailableNftId)?;15361537 let from = token_data.owner;15381539 let owner_check_budget = budget::Value::new(NESTING_BUDGET);15401541 ensure!(1542 <PalletStructure<T>>::check_indirectly_owned(1543 sender.clone(),1544 collection_id,1545 token_id,1546 None,1547 &owner_check_budget1548 )?,1549 error_if_not_owned,1550 );15511552 let burns_budget = budget::Value::new(max_burns);1553 let breadth_budget = budget::Value::new(max_burns);15541555 <PalletNft<T>>::burn_recursively(1556 &collection,1557 &from,1558 token_id,1559 &burns_budget,1560 &breadth_budget,1561 )1562 }15631564 /// Add a sent token pending acceptance to the target owning token as a property.1565 fn insert_pending_child(1566 target: (CollectionId, TokenId),1567 child: (RmrkCollectionId, RmrkNftId),1568 ) -> DispatchResult {1569 Self::mutate_pending_children(target, |pending_children| {1570 pending_children.insert(child);1571 })1572 }15731574 /// Remove a sent token pending acceptance from the target token's properties.1575 fn remove_pending_child(1576 target: (CollectionId, TokenId),1577 child: (RmrkCollectionId, RmrkNftId),1578 ) -> DispatchResult {1579 Self::mutate_pending_children(target, |pending_children| {1580 pending_children.remove(&child);1581 })1582 }15831584 /// Apply a mutation to the property of a token containing sent tokens1585 /// that are currently pending acceptance.1586 fn mutate_pending_children(1587 (target_collection_id, target_nft_id): (CollectionId, TokenId),1588 f: impl FnOnce(&mut PendingChildrenSet),1589 ) -> DispatchResult {1590 <PalletNft<T>>::try_mutate_token_aux_property(1591 target_collection_id,1592 target_nft_id,1593 RMRK_SCOPE,1594 Self::get_scoped_property_key(PendingChildren)?,1595 |pending_children| -> DispatchResult {1596 let mut map = match pending_children {1597 Some(map) => Self::decode_property_value(map)?,1598 None => PendingChildrenSet::new(),1599 };16001601 f(&mut map);16021603 *pending_children = Some(Self::encode_property_value(&map)?);16041605 Ok(())1606 },1607 )1608 }16091610 /// Get an iterator from a token's property containing tokens sent to it1611 /// that are currently pending acceptance.1612 fn iterate_pending_children(1613 collection_id: CollectionId,1614 nft_id: TokenId,1615 ) -> Result<impl Iterator<Item = PendingChild>, DispatchError> {1616 let property = <PalletNft<T>>::token_aux_property((1617 collection_id,1618 nft_id,1619 RMRK_SCOPE,1620 Self::get_scoped_property_key(PendingChildren)?,1621 ));16221623 let pending_children = match property {1624 Some(map) => Self::decode_property_value(&map)?,1625 None => PendingChildrenSet::new(),1626 };16271628 Ok(pending_children.into_iter())1629 }16301631 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1632 /// Thus, the returned resource ID should be used.1633 ///1634 /// Resource IDs are unique only across an NFT.1635 fn acquire_next_resource_id(1636 collection_id: CollectionId,1637 nft_id: TokenId,1638 ) -> Result<RmrkResourceId, DispatchError> {1639 let resource_id: RmrkResourceId =1640 Self::get_nft_property_decoded(collection_id, nft_id, NextResourceId)?;16411642 let next_id = resource_id1643 .checked_add(1)1644 .ok_or(<Error<T>>::NoAvailableResourceId)?;16451646 <PalletNft<T>>::set_scoped_token_property(1647 collection_id,1648 nft_id,1649 RMRK_SCOPE,1650 Self::encode_rmrk_property(NextResourceId, &next_id)?,1651 )?;16521653 Ok(resource_id)1654 }16551656 /// Create and add a resource for a regular NFT, mark it as pending if the sender1657 /// is not the token owner. The sender must be the collection owner.1658 fn resource_add(1659 sender: T::AccountId,1660 collection_id: CollectionId,1661 nft_id: TokenId,1662 resource: RmrkResourceTypes,1663 ) -> Result<RmrkResourceId, DispatchError> {1664 let collection =1665 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1666 ensure!(collection.owner == sender, Error::<T>::NoPermission);16671668 let sender = T::CrossAccountId::from_sub(sender);1669 let budget = budget::Value::new(NESTING_BUDGET);16701671 let nft_owner = <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1672 .map_err(Self::map_unique_err_to_proxy)?1673 .ok_or::<DispatchError>(<Error<T>>::NoPermission.into())?;16741675 let pending = sender != nft_owner;16761677 let id = Self::acquire_next_resource_id(collection_id, nft_id)?;16781679 let resource_info = RmrkResourceInfo {1680 id,1681 resource,1682 pending,1683 pending_removal: false,1684 };16851686 <PalletNft<T>>::try_mutate_token_aux_property(1687 collection_id,1688 nft_id,1689 RMRK_SCOPE,1690 Self::get_scoped_property_key(ResourceId(id))?,1691 |value| -> DispatchResult {1692 *value = Some(Self::encode_property_value(&resource_info)?);16931694 Ok(())1695 },1696 )?;16971698 Ok(id)1699 }17001701 /// Designate a resource for erasure from an NFT, and remove it if the sender is the token owner.1702 /// The sender must be the collection owner.1703 fn resource_remove(1704 sender: T::AccountId,1705 collection_id: CollectionId,1706 nft_id: TokenId,1707 resource_id: RmrkResourceId,1708 ) -> DispatchResult {1709 let collection =1710 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1711 ensure!(collection.owner == sender, Error::<T>::NoPermission);17121713 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;17141715 let resource = <PalletNft<T>>::token_aux_property((1716 collection_id,1717 nft_id,1718 RMRK_SCOPE,1719 resource_id_key.clone(),1720 ))1721 .ok_or(<Error<T>>::ResourceDoesntExist)?;17221723 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource)?;17241725 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1726 let topmost_owner =1727 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)?1728 .ok_or::<DispatchError>(<Error<T>>::NoPermission.into())?;17291730 let sender = T::CrossAccountId::from_sub(sender);1731 if topmost_owner == sender {1732 <PalletNft<T>>::remove_token_aux_property(1733 collection_id,1734 nft_id,1735 RMRK_SCOPE,1736 Self::get_scoped_property_key(ResourceId(resource_id))?,1737 );17381739 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1740 let base_id = resource.base;17411742 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1743 }1744 } else {1745 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1746 res.pending_removal = true;17471748 Ok(())1749 })?;1750 }17511752 Ok(())1753 }17541755 /// Remove a Base ID from an NFT if they are associated.1756 /// The Base itself is deleted if the number of associated NFTs reaches 0.1757 fn remove_associated_base_id(1758 collection_id: CollectionId,1759 nft_id: TokenId,1760 base_id: RmrkBaseId,1761 ) -> DispatchResult {1762 <PalletNft<T>>::try_mutate_token_aux_property(1763 collection_id,1764 nft_id,1765 RMRK_SCOPE,1766 Self::get_scoped_property_key(AssociatedBases)?,1767 |value| -> DispatchResult {1768 let mut bases: BasesMap = match value {1769 Some(value) => Self::decode_property_value(value)?,1770 None => BasesMap::new(),1771 };17721773 let remaining = bases.get(&base_id);17741775 if let Some(remaining) = remaining {1776 if let Some(0) | None = remaining.checked_sub(1) {1777 bases.remove(&base_id);1778 }1779 }17801781 *value = Some(Self::encode_property_value(&bases)?);1782 Ok(())1783 },1784 )1785 }17861787 /// Apply a mutation to a resource stored in the token properties of an NFT.1788 fn try_mutate_resource_info(1789 collection_id: CollectionId,1790 nft_id: TokenId,1791 resource_id: RmrkResourceId,1792 f: impl FnOnce(&mut RmrkResourceInfo) -> DispatchResult,1793 ) -> DispatchResult {1794 <PalletNft<T>>::try_mutate_token_aux_property(1795 collection_id,1796 nft_id,1797 RMRK_SCOPE,1798 Self::get_scoped_property_key(ResourceId(resource_id))?,1799 |value| match value {1800 Some(value) => {1801 let mut resource_info: RmrkResourceInfo = Self::decode_property_value(value)?;18021803 f(&mut resource_info)?;18041805 *value = Self::encode_property_value(&resource_info)?;18061807 Ok(())1808 }1809 None => Err(<Error<T>>::ResourceDoesntExist.into()),1810 },1811 )1812 }18131814 /// Change the owner of an NFT collection, ensuring that the sender is the current owner.1815 fn change_collection_owner(1816 collection_id: CollectionId,1817 collection_type: misc::CollectionType,1818 sender: T::AccountId,1819 new_owner: T::AccountId,1820 ) -> DispatchResult {1821 let collection = Self::get_typed_nft_collection(collection_id, collection_type)?;1822 Self::check_collection_owner(&collection, &T::CrossAccountId::from_sub(sender))?;18231824 let mut collection = collection.into_inner();18251826 collection.owner = new_owner;1827 collection.save()1828 }18291830 /// Ensure that an account is the collection owner/issuer, return an error if not.1831 pub fn check_collection_owner(1832 collection: &NonfungibleHandle<T>,1833 account: &T::CrossAccountId,1834 ) -> DispatchResult {1835 collection1836 .check_is_owner(account)1837 .map_err(Self::map_unique_err_to_proxy)1838 }18391840 /// Get the latest yet-unused RMRK collection index from the storage.1841 pub fn last_collection_idx() -> RmrkCollectionId {1842 <CollectionIndex<T>>::get()1843 }18441845 /// Get a mapping from a RMRK collection ID to its corresponding Unique collection ID.1846 pub fn unique_collection_id(1847 rmrk_collection_id: RmrkCollectionId,1848 ) -> Result<CollectionId, DispatchError> {1849 <UniqueCollectionId<T>>::try_get(rmrk_collection_id)1850 .map_err(|_| <Error<T>>::CollectionUnknown.into())1851 }18521853 /// Get a mapping from a Unique collection ID to its RMRK collection ID counterpart, if it exists.1854 pub fn rmrk_collection_id(1855 unique_collection_id: CollectionId,1856 ) -> Result<RmrkCollectionId, DispatchError> {1857 Self::get_collection_property_decoded(unique_collection_id, RmrkInternalCollectionId)1858 }18591860 /// Fetch a Unique NFT collection.1861 pub fn get_nft_collection(1862 collection_id: CollectionId,1863 ) -> Result<NonfungibleHandle<T>, DispatchError> {1864 let collection = <CollectionHandle<T>>::try_get(collection_id)1865 .map_err(|_| <Error<T>>::CollectionUnknown)?;18661867 match collection.mode {1868 CollectionMode::NFT => Ok(NonfungibleHandle::cast(collection)),1869 _ => Err(<Error<T>>::CollectionUnknown.into()),1870 }1871 }18721873 /// Check if an NFT collection with such an ID exists.1874 pub fn collection_exists(collection_id: CollectionId) -> bool {1875 <CollectionHandle<T>>::try_get(collection_id).is_ok()1876 }18771878 /// Fetch and decode a RMRK-scoped collection property value in bytes.1879 pub fn get_collection_property(1880 collection_id: CollectionId,1881 key: RmrkProperty,1882 ) -> Result<PropertyValue, DispatchError> {1883 let collection_property = <PalletCommon<T>>::collection_properties(collection_id)1884 .get(&Self::get_scoped_property_key(key)?)1885 .ok_or(<Error<T>>::CollectionUnknown)?1886 .clone();18871888 Ok(collection_property)1889 }18901891 /// Fetch a RMRK-scoped collection property and decode it from bytes into an appropriate type.1892 pub fn get_collection_property_decoded<V: Decode>(1893 collection_id: CollectionId,1894 key: RmrkProperty,1895 ) -> Result<V, DispatchError> {1896 Self::decode_property_value(&Self::get_collection_property(collection_id, key)?)1897 }18981899 /// Get the type of a collection stored as a scoped property.1900 ///1901 /// RMRK Core proxy differentiates between regular collections as well as RMRK Bases as collections.1902 pub fn get_collection_type(1903 collection_id: CollectionId,1904 ) -> Result<misc::CollectionType, DispatchError> {1905 Self::get_collection_property_decoded(collection_id, CollectionType).map_err(|err| {1906 if err != <Error<T>>::CollectionUnknown.into() {1907 <Error<T>>::CorruptedCollectionType.into()1908 } else {1909 err1910 }1911 })1912 }19131914 /// Ensure that the type of the collection equals the provided type,1915 /// otherwise return an error.1916 pub fn ensure_collection_type(1917 collection_id: CollectionId,1918 collection_type: misc::CollectionType,1919 ) -> DispatchResult {1920 let actual_type = Self::get_collection_type(collection_id)?;1921 ensure!(1922 actual_type == collection_type,1923 <CommonError<T>>::NoPermission1924 );19251926 Ok(())1927 }19281929 /// Fetch an NFT collection, but make sure it has the appropriate type.1930 pub fn get_typed_nft_collection(1931 collection_id: CollectionId,1932 collection_type: misc::CollectionType,1933 ) -> Result<NonfungibleHandle<T>, DispatchError> {1934 Self::ensure_collection_type(collection_id, collection_type)?;19351936 Self::get_nft_collection(collection_id)1937 }19381939 /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection),1940 /// but also return the Unique collection ID.1941 pub fn get_typed_nft_collection_mapped(1942 rmrk_collection_id: RmrkCollectionId,1943 collection_type: misc::CollectionType,1944 ) -> Result<(NonfungibleHandle<T>, CollectionId), DispatchError> {1945 let unique_collection_id = match collection_type {1946 misc::CollectionType::Regular => Self::unique_collection_id(rmrk_collection_id)?,1947 _ => rmrk_collection_id.into(),1948 };19491950 let collection = Self::get_typed_nft_collection(unique_collection_id, collection_type)?;19511952 Ok((collection, unique_collection_id))1953 }19541955 /// Fetch and decode a RMRK-scoped NFT property value in bytes.1956 pub fn get_nft_property(1957 collection_id: CollectionId,1958 nft_id: TokenId,1959 key: RmrkProperty,1960 ) -> Result<PropertyValue, DispatchError> {1961 let nft_property = <PalletNft<T>>::token_properties((collection_id, nft_id))1962 .get(&Self::get_scoped_property_key(key)?)1963 .ok_or(<Error<T>>::RmrkPropertyIsNotFound)?1964 .clone();19651966 Ok(nft_property)1967 }19681969 /// Fetch a RMRK-scoped NFT property and decode it from bytes into an appropriate type.1970 pub fn get_nft_property_decoded<V: Decode>(1971 collection_id: CollectionId,1972 nft_id: TokenId,1973 key: RmrkProperty,1974 ) -> Result<V, DispatchError> {1975 Self::decode_property_value(&Self::get_nft_property(collection_id, nft_id, key)?)1976 }19771978 /// Check that an NFT exists.1979 pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {1980 <TokenData<T>>::contains_key((collection_id, nft_id))1981 }19821983 /// Get the type of an NFT stored as a scoped property.1984 ///1985 /// RMRK Core proxy differentiates between regular NFTs, and RMRK Parts and Themes.1986 pub fn get_nft_type(1987 collection_id: CollectionId,1988 token_id: TokenId,1989 ) -> Result<NftType, DispatchError> {1990 Self::get_nft_property_decoded(collection_id, token_id, TokenType)1991 .map_err(|_| <Error<T>>::NoAvailableNftId.into())1992 }19931994 /// Ensure that the type of the NFT equals the provided type, otherwise return an error.1995 pub fn ensure_nft_type(1996 collection_id: CollectionId,1997 token_id: TokenId,1998 nft_type: NftType,1999 ) -> DispatchResult {2000 let actual_type = Self::get_nft_type(collection_id, token_id)?;2001 ensure!(actual_type == nft_type, <Error<T>>::NoPermission);20022003 Ok(())2004 }20052006 /// Ensure that an account is the owner of the token, either directly2007 /// or at the top of the nesting hierarchy; return an error if it is not.2008 pub fn ensure_nft_owner(2009 collection_id: CollectionId,2010 token_id: TokenId,2011 possible_owner: &T::CrossAccountId,2012 nesting_budget: &dyn budget::Budget,2013 ) -> DispatchResult {2014 let is_owned = <PalletStructure<T>>::check_indirectly_owned(2015 possible_owner.clone(),2016 collection_id,2017 token_id,2018 None,2019 nesting_budget,2020 )2021 .map_err(Self::map_unique_err_to_proxy)?;20222023 ensure!(is_owned, <Error<T>>::NoPermission);20242025 Ok(())2026 }20272028 /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied,2029 /// or, if None are provided, return all non-scoped properties.2030 pub fn filter_user_properties<Key, Value, R, Mapper>(2031 collection_id: CollectionId,2032 token_id: Option<TokenId>,2033 filter_keys: Option<Vec<RmrkPropertyKey>>,2034 mapper: Mapper,2035 ) -> Result<Vec<R>, DispatchError>2036 where2037 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2038 Value: Decode + Default,2039 Mapper: Fn(Key, Value) -> R,2040 {2041 filter_keys2042 .map(|keys| {2043 let properties = keys2044 .into_iter()2045 .filter_map(|key| {2046 let key: Key = key.try_into().ok()?;20472048 let value = match token_id {2049 Some(token_id) => Self::get_nft_property_decoded(2050 collection_id,2051 token_id,2052 UserProperty(key.as_ref()),2053 ),2054 None => Self::get_collection_property_decoded(2055 collection_id,2056 UserProperty(key.as_ref()),2057 ),2058 }2059 .ok()?;20602061 Some(mapper(key, value))2062 })2063 .collect();20642065 Ok(properties)2066 })2067 .unwrap_or_else(|| {2068 let properties =2069 Self::iterate_user_properties(collection_id, token_id, mapper)?.collect();20702071 Ok(properties)2072 })2073 }20742075 /// Get all non-scoped properties from a collection or a token, and apply some transformation,2076 /// supplied by `mapper`, to each key-value pair.2077 pub fn iterate_user_properties<Key, Value, R, Mapper>(2078 collection_id: CollectionId,2079 token_id: Option<TokenId>,2080 mapper: Mapper,2081 ) -> Result<impl Iterator<Item = R>, DispatchError>2082 where2083 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2084 Value: Decode + Default,2085 Mapper: Fn(Key, Value) -> R,2086 {2087 let properties = match token_id {2088 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),2089 None => <PalletCommon<T>>::collection_properties(collection_id),2090 };20912092 let properties = properties.into_iter().filter_map(move |(key, value)| {2093 let key = strip_key_prefix(&key, USER_PROPERTY_PREFIX)?;20942095 let key: Key = key.to_vec().try_into().ok()?;2096 let value: Value = value.decode().ok()?;20972098 Some(mapper(key, value))2099 });21002101 Ok(properties)2102 }21032104 /// Match Unique errors to RMRK's own and return the RMRK error if a match is successful.2105 fn map_unique_err_to_proxy(err: DispatchError) -> DispatchError {2106 map_unique_err_to_proxy! {2107 match err {2108 CommonError::NoPermission => NoPermission,2109 CommonError::CollectionTokenLimitExceeded => CollectionFullOrLocked,2110 CommonError::PublicMintingNotAllowed => NoPermission,2111 CommonError::TokenNotFound => NoAvailableNftId,2112 CommonError::ApprovedValueTooLow => NoPermission,2113 CommonError::CantDestroyNotEmptyCollection => CollectionNotEmpty,2114 StructureError::TokenNotFound => NoAvailableNftId,2115 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf,2116 }2117 }2118 }2119}pallets/proxy-rmrk-core/src/rpc.rsdiffbeforeafterboth--- a/pallets/proxy-rmrk-core/src/rpc.rs
+++ b/pallets/proxy-rmrk-core/src/rpc.rs
@@ -68,7 +68,7 @@
}
let owner = match collection.token_owner(nft_id) {
- Some(owner) => match T::CrossTokenAddressMapping::address_to_token(&owner) {
+ Ok(owner) => match T::CrossTokenAddressMapping::address_to_token(&owner) {
Some((col, tok)) => {
let rmrk_collection = <Pallet<T>>::rmrk_collection_id(col)?;
@@ -76,7 +76,7 @@
}
None => RmrkAccountIdOrCollectionNftTuple::AccountId(owner.as_sub().clone()),
},
- None => return Ok(None),
+ _ => return Ok(None),
};
Ok(Some(RmrkInstanceInfo {
pallets/proxy-rmrk-equip/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/Cargo.toml
+++ b/pallets/proxy-rmrk-equip/Cargo.toml
@@ -1,50 +1,37 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-rmrk-equip"
version = "0.1.2"
-license = "GPLv3"
-edition = "2021"
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = '../common' }
-pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
+pallet-common = { default-features = false, path = "../common" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-rmrk-core = { default-features = false, path = "../proxy-rmrk-core" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[features]
default = ["std"]
+runtime-benchmarks = ['frame-benchmarking', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks']
std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
- "rmrk-traits/std",
- "pallet-common/std",
- "pallet-nonfungible/std",
- "pallet-rmrk-core/std",
- "pallet-evm/std",
- 'frame-benchmarking/std',
-]
-runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm/std",
+ "pallet-nonfungible/std",
+ "pallet-rmrk-core/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ 'frame-benchmarking/std',
]
try-runtime = ["frame-support/try-runtime"]
pallets/refungible/Cargo.tomldiffbeforeafterboth--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -1,57 +1,47 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-refungible"
version = "0.2.11"
-license = "GPLv3"
-edition = "2021"
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
+[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
-[dependencies]
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-common = { default-features = false, path = "../common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+pallet-structure = { default-features = false, path = "../structure" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
-pallet-common = { default-features = false, path = '../common' }
-pallet-structure = { default-features = false, path = '../structure' }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-struct-versioning = { path = "../../crates/struct-versioning" }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-ethereum = { version = "0.14.0", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-derivative = { version = "2.2.0", features = ["use_core"] }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[features]
default = ["std"]
+runtime-benchmarks = [
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system/runtime-benchmarks',
+ 'up-data-structs/runtime-benchmarks',
+]
std = [
- "ethereum/std",
- "evm-coder/std",
- 'frame-benchmarking/std',
- "frame-support/std",
- "frame-system/std",
- "pallet-common/std",
- "pallet-evm/std",
- "pallet-evm-coder-substrate/std",
- "pallet-structure/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
+ "evm-coder/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm-coder-substrate/std",
+ "pallet-evm/std",
+ "pallet-structure/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ 'frame-benchmarking/std',
]
-runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
- 'up-data-structs/runtime-benchmarks',
-]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
try-runtime = ["frame-support/try-runtime"]
-stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
pallets/refungible/src/common.rsdiffbeforeafterboth--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -21,7 +21,7 @@
use up_data_structs::{
CollectionId, TokenId, CreateItemExData, budget::Budget, Property, PropertyKey, PropertyValue,
PropertyKeyPermission, CollectionPropertiesVec, CreateRefungibleExMultipleOwners,
- CreateRefungibleExSingleOwner,
+ CreateRefungibleExSingleOwner, TokenOwnerError,
};
use pallet_common::{
CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight,
@@ -478,7 +478,7 @@
TokenId(<TokensMinted<T>>::get(self.id))
}
- fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId> {
+ fn token_owner(&self, token: TokenId) -> Result<T::CrossAccountId, TokenOwnerError> {
<Pallet<T>>::token_owner(self.id, token)
}
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -43,7 +43,7 @@
use sp_std::{collections::btree_map::BTreeMap, vec::Vec, vec};
use up_data_structs::{
CollectionId, CollectionPropertiesVec, mapping::TokenAddressMapping, Property, PropertyKey,
- PropertyKeyPermission, PropertyPermission, TokenId,
+ PropertyKeyPermission, PropertyPermission, TokenId, TokenOwnerError,
};
use crate::{
@@ -411,9 +411,12 @@
self.consume_store_reads(2)?;
let token = token_id.try_into()?;
let owner = <Pallet<T>>::token_owner(self.id, token);
- Ok(owner
+ owner
.map(|address| *address.as_eth())
- .unwrap_or_else(|| ADDRESS_FOR_PARTIALLY_OWNED_TOKENS))
+ .or_else(|err| match err {
+ TokenOwnerError::NotFound => Err(Error::Revert("token not found".into())),
+ TokenOwnerError::MultipleOwners => Ok(ADDRESS_FOR_PARTIALLY_OWNED_TOKENS),
+ })
}
/// @dev Not implemented
@@ -766,7 +769,12 @@
fn cross_owner_of(&self, token_id: U256) -> Result<eth::CrossAddress> {
Self::token_owner(&self, token_id.try_into()?)
.map(|o| eth::CrossAddress::from_sub_cross_account::<T>(&o))
- .ok_or(Error::Revert("key too large".into()))
+ .or_else(|err| match err {
+ TokenOwnerError::NotFound => Err(Error::Revert("token not found".into())),
+ TokenOwnerError::MultipleOwners => Ok(eth::CrossAddress::from_eth(
+ ADDRESS_FOR_PARTIALLY_OWNED_TOKENS,
+ )),
+ })
}
/// Returns the token properties.
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -107,7 +107,7 @@
AccessMode, budget::Budget, CollectionId, CollectionFlags, CreateCollectionData,
mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, Property, PropertyKey,
PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TokenId,
- TrySetProperty, PropertiesPermissionMap, CreateRefungibleExMultipleOwners,
+ TrySetProperty, PropertiesPermissionMap, CreateRefungibleExMultipleOwners, TokenOwnerError,
};
pub use pallet::*;
@@ -480,7 +480,7 @@
<Balance<T>>::remove((collection.id, token, owner));
<AccountBalance<T>>::insert((collection.id, owner), account_balance);
- if let Some(user) = Self::token_owner(collection.id, token) {
+ if let Ok(user) = Self::token_owner(collection.id, token) {
<PalletEvm<T>>::deposit_log(
ERC721Events::Transfer {
from: erc::ADDRESS_FOR_PARTIALLY_OWNED_TOKENS,
@@ -1365,17 +1365,20 @@
Ok(())
}
- fn token_owner(collection_id: CollectionId, token_id: TokenId) -> Option<T::CrossAccountId> {
+ fn token_owner(
+ collection_id: CollectionId,
+ token_id: TokenId,
+ ) -> Result<T::CrossAccountId, TokenOwnerError> {
let mut owner = None;
let mut count = 0;
for key in Balance::<T>::iter_key_prefix((collection_id, token_id)) {
count += 1;
if count > 1 {
- return None;
+ return Err(TokenOwnerError::MultipleOwners);
}
owner = Some(key);
}
- owner
+ owner.ok_or(TokenOwnerError::NotFound)
}
fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<u128> {
pallets/refungible/src/weights.rsdiffbeforeafterboth--- a/pallets/refungible/src/weights.rs
+++ b/pallets/refungible/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_refungible
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -66,53 +66,62 @@
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:1)
// Storage: Refungible TotalSupply (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(32_864_000 as u64)
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(5 as u64))
+ Weight::from_ref_time(37_536_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(4 as u64))
+ .saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible TotalSupply (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(11_880_472 as u64)
- // Standard Error: 5_240
- .saturating_add(Weight::from_ref_time(6_556_575 as u64).saturating_mul(b as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
+ Weight::from_ref_time(16_345_581 as u64)
+ // Standard Error: 5_346
+ .saturating_add(Weight::from_ref_time(9_281_076 as u64).saturating_mul(b as u64))
+ .saturating_add(T::DbWeight::get().reads(3 as u64))
+ .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(2 as u64))
- .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
+ .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:4 w:4)
+ // Storage: Refungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible TotalSupply (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(11_644_173 as u64)
- // Standard Error: 5_876
- .saturating_add(Weight::from_ref_time(8_214_607 as u64).saturating_mul(b as u64))
- .saturating_add(T::DbWeight::get().reads(1 as u64))
- .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
+ Weight::from_ref_time(11_246_602 as u64)
+ // Standard Error: 8_015
+ .saturating_add(Weight::from_ref_time(11_043_114 as u64).saturating_mul(b as u64))
+ .saturating_add(T::DbWeight::get().reads(2 as u64))
+ .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
.saturating_add(T::DbWeight::get().writes(1 as u64))
- .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
+ .saturating_add(T::DbWeight::get().writes((5 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible TokensMinted (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible TotalSupply (r:0 w:1)
// Storage: Refungible AccountBalance (r:4 w:4)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight {
- Weight::from_ref_time(21_817_067 as u64)
- // Standard Error: 5_215
- .saturating_add(Weight::from_ref_time(6_084_938 as u64).saturating_mul(b as u64))
- .saturating_add(T::DbWeight::get().reads(1 as u64))
+ Weight::from_ref_time(31_350_923 as u64)
+ // Standard Error: 4_061
+ .saturating_add(Weight::from_ref_time(6_007_108 as u64).saturating_mul(b as u64))
+ .saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
+ .saturating_add(T::DbWeight::get().writes(3 as u64))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible Balance (r:3 w:1)
@@ -120,7 +129,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn burn_item_partial() -> Weight {
- Weight::from_ref_time(47_087_000 as u64)
+ Weight::from_ref_time(47_342_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
@@ -131,14 +140,14 @@
// Storage: Refungible Owned (r:0 w:1)
// Storage: Refungible TokenProperties (r:0 w:1)
fn burn_item_fully() -> Weight {
- Weight::from_ref_time(40_135_000 as u64)
+ Weight::from_ref_time(40_664_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
fn transfer_normal() -> Weight {
- Weight::from_ref_time(30_749_000 as u64)
+ Weight::from_ref_time(31_585_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
@@ -147,7 +156,7 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_creating() -> Weight {
- Weight::from_ref_time(33_565_000 as u64)
+ Weight::from_ref_time(35_015_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
@@ -156,7 +165,7 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_removing() -> Weight {
- Weight::from_ref_time(37_406_000 as u64)
+ Weight::from_ref_time(38_209_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
@@ -165,68 +174,63 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_creating_removing() -> Weight {
- Weight::from_ref_time(36_689_000 as u64)
+ Weight::from_ref_time(38_549_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(23_177_000 as u64)
+ Weight::from_ref_time(24_503_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(20_649_000 as u64)
+ Weight::from_ref_time(24_584_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
fn transfer_from_normal() -> Weight {
- Weight::from_ref_time(41_288_000 as u64)
- .saturating_add(T::DbWeight::get().reads(5 as u64))
+ Weight::from_ref_time(41_001_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_creating() -> Weight {
- Weight::from_ref_time(44_807_000 as u64)
- .saturating_add(T::DbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(43_884_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_removing() -> Weight {
- Weight::from_ref_time(47_297_000 as u64)
- .saturating_add(T::DbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(47_515_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_from_creating_removing() -> Weight {
- Weight::from_ref_time(47_566_000 as u64)
- .saturating_add(T::DbWeight::get().reads(7 as u64))
+ Weight::from_ref_time(47_087_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(7 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
@@ -234,61 +238,61 @@
// Storage: Refungible Owned (r:0 w:1)
// Storage: Refungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(53_074_000 as u64)
- .saturating_add(T::DbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(52_735_000 as u64)
+ .saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(7 as u64))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:1)
fn set_token_property_permissions(b: u32, ) -> Weight {
- Weight::from_ref_time(5_170_000 as u64)
- // Standard Error: 40_532
- .saturating_add(Weight::from_ref_time(11_948_016 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(5_232_000 as u64)
+ // Standard Error: 43_746
+ .saturating_add(Weight::from_ref_time(12_961_609 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn set_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(25_518_267 as u64)
- // Standard Error: 20_451
- .saturating_add(Weight::from_ref_time(5_041_089 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(18_287_762 as u64)
+ // Standard Error: 31_915
+ .saturating_add(Weight::from_ref_time(7_070_524 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn delete_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(13_715_000 as u64)
- // Standard Error: 28_323
- .saturating_add(Weight::from_ref_time(13_113_351 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(15_075_000 as u64)
+ // Standard Error: 69_091
+ .saturating_add(Weight::from_ref_time(22_793_781 as u64).saturating_mul(b as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible Balance (r:1 w:1)
fn repartition_item() -> Weight {
- Weight::from_ref_time(25_574_000 as u64)
+ Weight::from_ref_time(25_147_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Refungible Balance (r:2 w:0)
fn token_owner() -> Weight {
- Weight::from_ref_time(9_819_000 as u64)
+ Weight::from_ref_time(9_921_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
}
// Storage: Refungible CollectionAllowance (r:0 w:1)
fn set_allowance_for_all() -> Weight {
- Weight::from_ref_time(16_228_000 as u64)
+ Weight::from_ref_time(17_822_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible CollectionAllowance (r:1 w:0)
fn allowance_for_all() -> Weight {
- Weight::from_ref_time(5_374_000 as u64)
+ Weight::from_ref_time(5_265_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
fn repair_item() -> Weight {
- Weight::from_ref_time(5_624_000 as u64)
+ Weight::from_ref_time(7_229_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
@@ -298,53 +302,62 @@
impl WeightInfo for () {
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:1)
// Storage: Refungible TotalSupply (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn create_item() -> Weight {
- Weight::from_ref_time(32_864_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(5 as u64))
+ Weight::from_ref_time(37_536_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(4 as u64))
+ .saturating_add(RocksDbWeight::get().writes(6 as u64))
}
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible TotalSupply (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(11_880_472 as u64)
- // Standard Error: 5_240
- .saturating_add(Weight::from_ref_time(6_556_575 as u64).saturating_mul(b as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
+ Weight::from_ref_time(16_345_581 as u64)
+ // Standard Error: 5_346
+ .saturating_add(Weight::from_ref_time(9_281_076 as u64).saturating_mul(b as u64))
+ .saturating_add(RocksDbWeight::get().reads(3 as u64))
+ .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
- .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
+ .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible TokensMinted (r:1 w:1)
// Storage: Refungible AccountBalance (r:4 w:4)
+ // Storage: Refungible TokenProperties (r:4 w:4)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible TotalSupply (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight {
- Weight::from_ref_time(11_644_173 as u64)
- // Standard Error: 5_876
- .saturating_add(Weight::from_ref_time(8_214_607 as u64).saturating_mul(b as u64))
- .saturating_add(RocksDbWeight::get().reads(1 as u64))
- .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
+ Weight::from_ref_time(11_246_602 as u64)
+ // Standard Error: 8_015
+ .saturating_add(Weight::from_ref_time(11_043_114 as u64).saturating_mul(b as u64))
+ .saturating_add(RocksDbWeight::get().reads(2 as u64))
+ .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
- .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64)))
+ .saturating_add(RocksDbWeight::get().writes((5 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible TokensMinted (r:1 w:1)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
// Storage: Refungible TotalSupply (r:0 w:1)
// Storage: Refungible AccountBalance (r:4 w:4)
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight {
- Weight::from_ref_time(21_817_067 as u64)
- // Standard Error: 5_215
- .saturating_add(Weight::from_ref_time(6_084_938 as u64).saturating_mul(b as u64))
- .saturating_add(RocksDbWeight::get().reads(1 as u64))
+ Weight::from_ref_time(31_350_923 as u64)
+ // Standard Error: 4_061
+ .saturating_add(Weight::from_ref_time(6_007_108 as u64).saturating_mul(b as u64))
+ .saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64)))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
+ .saturating_add(RocksDbWeight::get().writes(3 as u64))
.saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64)))
}
// Storage: Refungible Balance (r:3 w:1)
@@ -352,7 +365,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn burn_item_partial() -> Weight {
- Weight::from_ref_time(47_087_000 as u64)
+ Weight::from_ref_time(47_342_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(4 as u64))
}
@@ -363,14 +376,14 @@
// Storage: Refungible Owned (r:0 w:1)
// Storage: Refungible TokenProperties (r:0 w:1)
fn burn_item_fully() -> Weight {
- Weight::from_ref_time(40_135_000 as u64)
+ Weight::from_ref_time(40_664_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
fn transfer_normal() -> Weight {
- Weight::from_ref_time(30_749_000 as u64)
+ Weight::from_ref_time(31_585_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
@@ -379,7 +392,7 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_creating() -> Weight {
- Weight::from_ref_time(33_565_000 as u64)
+ Weight::from_ref_time(35_015_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(4 as u64))
}
@@ -388,7 +401,7 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_removing() -> Weight {
- Weight::from_ref_time(37_406_000 as u64)
+ Weight::from_ref_time(38_209_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(4 as u64))
}
@@ -397,68 +410,63 @@
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_creating_removing() -> Weight {
- Weight::from_ref_time(36_689_000 as u64)
+ Weight::from_ref_time(38_549_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve() -> Weight {
- Weight::from_ref_time(23_177_000 as u64)
+ Weight::from_ref_time(24_503_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve_from() -> Weight {
- Weight::from_ref_time(20_649_000 as u64)
+ Weight::from_ref_time(24_584_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
fn transfer_from_normal() -> Weight {
- Weight::from_ref_time(41_288_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(5 as u64))
+ Weight::from_ref_time(41_001_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_creating() -> Weight {
- Weight::from_ref_time(44_807_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(43_884_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_removing() -> Weight {
- Weight::from_ref_time(47_297_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(47_515_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:2 w:2)
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible TotalSupply (r:1 w:0)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_from_creating_removing() -> Weight {
- Weight::from_ref_time(47_566_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(7 as u64))
+ Weight::from_ref_time(47_087_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(6 as u64))
.saturating_add(RocksDbWeight::get().writes(7 as u64))
}
// Storage: Refungible Allowance (r:1 w:1)
- // Storage: Refungible CollectionAllowance (r:1 w:0)
// Storage: Refungible Balance (r:1 w:1)
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible AccountBalance (r:1 w:1)
@@ -466,61 +474,61 @@
// Storage: Refungible Owned (r:0 w:1)
// Storage: Refungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- Weight::from_ref_time(53_074_000 as u64)
- .saturating_add(RocksDbWeight::get().reads(6 as u64))
+ Weight::from_ref_time(52_735_000 as u64)
+ .saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(7 as u64))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:1)
fn set_token_property_permissions(b: u32, ) -> Weight {
- Weight::from_ref_time(5_170_000 as u64)
- // Standard Error: 40_532
- .saturating_add(Weight::from_ref_time(11_948_016 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(5_232_000 as u64)
+ // Standard Error: 43_746
+ .saturating_add(Weight::from_ref_time(12_961_609 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn set_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(25_518_267 as u64)
- // Standard Error: 20_451
- .saturating_add(Weight::from_ref_time(5_041_089 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(18_287_762 as u64)
+ // Standard Error: 31_915
+ .saturating_add(Weight::from_ref_time(7_070_524 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
fn delete_token_properties(b: u32, ) -> Weight {
- Weight::from_ref_time(13_715_000 as u64)
- // Standard Error: 28_323
- .saturating_add(Weight::from_ref_time(13_113_351 as u64).saturating_mul(b as u64))
+ Weight::from_ref_time(15_075_000 as u64)
+ // Standard Error: 69_091
+ .saturating_add(Weight::from_ref_time(22_793_781 as u64).saturating_mul(b as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible Balance (r:1 w:1)
fn repartition_item() -> Weight {
- Weight::from_ref_time(25_574_000 as u64)
+ Weight::from_ref_time(25_147_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Refungible Balance (r:2 w:0)
fn token_owner() -> Weight {
- Weight::from_ref_time(9_819_000 as u64)
+ Weight::from_ref_time(9_921_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
}
// Storage: Refungible CollectionAllowance (r:0 w:1)
fn set_allowance_for_all() -> Weight {
- Weight::from_ref_time(16_228_000 as u64)
+ Weight::from_ref_time(17_822_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible CollectionAllowance (r:1 w:0)
fn allowance_for_all() -> Weight {
- Weight::from_ref_time(5_374_000 as u64)
+ Weight::from_ref_time(5_265_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
// Storage: Refungible TokenProperties (r:1 w:1)
fn repair_item() -> Weight {
- Weight::from_ref_time(5_624_000 as u64)
+ Weight::from_ref_time(7_229_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
pallets/scheduler-v2/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler-v2/Cargo.toml
+++ b/pallets/scheduler-v2/Cargo.toml
@@ -1,29 +1,25 @@
[package]
-name = "pallet-unique-scheduler-v2"
-version = "0.1.0"
authors = ["Unique Network <support@uniquenetwork.io>"]
+description = "Unique Scheduler pallet"
edition = "2021"
+homepage = "https://unique.network"
license = "GPLv3"
-homepage = "https://unique.network"
-repository = "https://github.com/UniqueNetwork/unique-chain"
-description = "Unique Scheduler pallet"
+name = "pallet-unique-scheduler-v2"
readme = "README.md"
+repository = "https://github.com/UniqueNetwork/unique-chain"
+version = "0.1.0"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
- "derive",
-] }
-log = { version = "0.4.17", default-features = false }
-scale-info = { version = "2.1.1", default-features = false, features = [
- "derive",
-] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+log = { version = "0.4.17", default-features = false }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[dev-dependencies]
pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
@@ -32,11 +28,7 @@
[features]
default = ["std"]
-runtime-benchmarks = [
- "frame-benchmarking",
- "frame-support/runtime-benchmarks",
- "frame-system/runtime-benchmarks",
-]
+runtime-benchmarks = ["frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks"]
std = [
"codec/std",
"frame-benchmarking?/std",
@@ -44,9 +36,9 @@
"frame-system/std",
"log/std",
"scale-info/std",
+ "sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
- "sp-core/std",
]
try-runtime = ["frame-support/try-runtime"]
pallets/structure/Cargo.tomldiffbeforeafterboth--- a/pallets/structure/Cargo.toml
+++ b/pallets/structure/Cargo.toml
@@ -1,26 +1,33 @@
[package]
+edition = "2021"
name = "pallet-structure"
version = "0.1.2"
-edition = "2021"
[dependencies]
+parity-scale-codec = { version = "3.2.2", default-features = false, features = ["derive"] }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+log = { version = "0.4.17", default-features = false }
pallet-common = { path = "../common", default-features = false }
-parity-scale-codec = { version = "3.1.2", default-features = false, features = [
- "derive",
-] }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-up-data-structs = { path = "../../primitives/data-structs", default-features = false }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-log = { version = "0.4.17", default-features = false }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
[features]
default = ["std"]
-std = ["frame-support/std", "frame-system/std", "frame-benchmarking/std", "sp-std/std", "pallet-common/std", "scale-info/std", "parity-scale-codec/std", "up-data-structs/std", "pallet-evm/std"]
runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
+std = [
+ "frame-benchmarking/std",
+ "frame-support/std",
+ "frame-system/std",
+ "pallet-common/std",
+ "pallet-evm/std",
+ "parity-scale-codec/std",
+ "scale-info/std",
+ "sp-std/std",
+ "up-data-structs/std",
+]
try-runtime = ["frame-support/try-runtime"]
pallets/structure/src/lib.rsdiffbeforeafterboth--- a/pallets/structure/src/lib.rs
+++ b/pallets/structure/src/lib.rs
@@ -61,7 +61,9 @@
use frame_support::fail;
pub use pallet::*;
use pallet_common::{dispatch::CollectionDispatch, CollectionHandle};
-use up_data_structs::{CollectionId, TokenId, mapping::TokenAddressMapping, budget::Budget};
+use up_data_structs::{
+ CollectionId, TokenId, mapping::TokenAddressMapping, budget::Budget, TokenOwnerError,
+};
#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarking;
@@ -135,6 +137,8 @@
User(CrossAccountId),
/// Could not find the token provided as the owner.
TokenNotFound,
+ /// Nested token has multiple owners.
+ MultipleOwners,
/// Token owner is another token (still, the target token may not exist).
Token(CollectionId, TokenId),
}
@@ -159,11 +163,12 @@
let handle = handle.as_dyn();
Ok(match handle.token_owner(token) {
- Some(owner) => match T::CrossTokenAddressMapping::address_to_token(&owner) {
+ Ok(owner) => match T::CrossTokenAddressMapping::address_to_token(&owner) {
Some((collection, token)) => Parent::Token(collection, token),
None => Parent::User(owner),
},
- None => Parent::TokenNotFound,
+ Err(TokenOwnerError::MultipleOwners) => Parent::MultipleOwners,
+ Err(TokenOwnerError::NotFound) => Parent::TokenNotFound,
})
}
@@ -203,19 +208,27 @@
///
/// May return token address if parent token not yet exists
///
+ /// Returns `None` if the token has multiple owners.
+ ///
/// - `budget`: Limit for searching parents in depth.
pub fn find_topmost_owner(
collection: CollectionId,
token: TokenId,
budget: &dyn Budget,
- ) -> Result<T::CrossAccountId, DispatchError> {
+ ) -> Result<Option<T::CrossAccountId>, DispatchError> {
let owner = Self::parent_chain(collection, token)
.take_while(|_| budget.consume())
- .find(|p| matches!(p, Ok(Parent::User(_) | Parent::TokenNotFound)))
+ .find(|p| {
+ matches!(
+ p,
+ Ok(Parent::User(_) | Parent::TokenNotFound | Parent::MultipleOwners)
+ )
+ })
.ok_or(<Error<T>>::DepthLimit)??;
Ok(match owner {
- Parent::User(v) => v,
+ Parent::User(v) => Some(v),
+ Parent::MultipleOwners => None,
_ => fail!(<Error<T>>::TokenNotFound),
})
}
@@ -223,13 +236,15 @@
/// Find the topmost parent and check that assigning `for_nest` token as a child for
/// `token` wouldn't create a cycle.
///
+ /// Returns `None` if the token has multiple owners.
+ ///
/// - `budget`: Limit for searching parents in depth.
pub fn get_checked_topmost_owner(
collection: CollectionId,
token: TokenId,
for_nest: Option<(CollectionId, TokenId)>,
budget: &dyn Budget,
- ) -> Result<T::CrossAccountId, DispatchError> {
+ ) -> Result<Option<T::CrossAccountId>, DispatchError> {
// Tried to nest token in itself
if Some((collection, token)) == for_nest {
return Err(<Error<T>>::OuroborosDetected.into());
@@ -242,8 +257,9 @@
return Err(<Error<T>>::OuroborosDetected.into())
}
// Token is owned by other user
- Parent::User(user) => return Ok(user),
+ Parent::User(user) => return Ok(Some(user)),
Parent::TokenNotFound => return Err(<Error<T>>::TokenNotFound.into()),
+ Parent::MultipleOwners => return Ok(None),
// Continue parent chain
Parent::Token(_, _) => {}
}
@@ -284,12 +300,17 @@
budget: &dyn Budget,
) -> Result<bool, DispatchError> {
let target_parent = match T::CrossTokenAddressMapping::address_to_token(&user) {
- Some((collection, token)) => Self::find_topmost_owner(collection, token, budget)?,
+ Some((collection, token)) => match Self::find_topmost_owner(collection, token, budget)?
+ {
+ Some(topmost_owner) => topmost_owner,
+ None => return Ok(false),
+ },
None => user,
};
- Self::get_checked_topmost_owner(collection, token, for_nest, budget)
- .map(|indirect_owner| indirect_owner == target_parent)
+ Self::get_checked_topmost_owner(collection, token, for_nest, budget).map(|indirect_owner| {
+ indirect_owner.map_or(false, |indirect_owner| indirect_owner == target_parent)
+ })
}
/// Checks that `under` is valid token and that `token_id` could be nested under it
pallets/structure/src/weights.rsdiffbeforeafterboth--- a/pallets/structure/src/weights.rs
+++ b/pallets/structure/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_structure
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -43,7 +43,7 @@
// Storage: Common CollectionById (r:1 w:0)
// Storage: Nonfungible TokenData (r:1 w:0)
fn find_parent() -> Weight {
- Weight::from_ref_time(11_355_000 as u64)
+ Weight::from_ref_time(12_015_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
}
}
@@ -53,7 +53,7 @@
// Storage: Common CollectionById (r:1 w:0)
// Storage: Nonfungible TokenData (r:1 w:0)
fn find_parent() -> Weight {
- Weight::from_ref_time(11_355_000 as u64)
+ Weight::from_ref_time(12_015_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
}
}
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -16,93 +16,44 @@
[features]
default = ['std']
+limit-testing = ["up-data-structs/limit-testing"]
runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
std = [
- 'codec/std',
- 'serde/std',
- 'frame-support/std',
- 'frame-system/std',
- 'pallet-evm/std',
- 'pallet-common/std',
- 'up-data-structs/std',
- 'sp-std/std',
- 'sp-runtime/std',
- 'frame-benchmarking/std',
- 'evm-coder/std',
- 'pallet-evm-coder-substrate/std',
- 'pallet-nonfungible/std',
+ 'codec/std',
+ 'evm-coder/std',
+ 'frame-benchmarking/std',
+ 'frame-support/std',
+ 'frame-system/std',
+ 'pallet-common/std',
+ 'pallet-evm-coder-substrate/std',
+ 'pallet-evm/std',
+ 'pallet-nonfungible/std',
+ 'serde/std',
+ 'sp-runtime/std',
+ 'sp-std/std',
+ 'up-data-structs/std',
]
-try-runtime = ["frame-support/try-runtime"]
-limit-testing = ["up-data-structs/limit-testing"]
stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
-
-################################################################################
-# Standart Dependencies
-
-[dependencies.serde]
-default-features = false
-features = ['derive']
-version = '1.0.130'
-
-[dependencies.ethereum]
-version = "0.12.0"
-default-features = false
-
-################################################################################
-# Substrate Dependencies
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-default-features = false
-optional = true
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+try-runtime = ["frame-support/try-runtime"]
################################################################################
# Local Dependencies
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+ethereum = { version = "0.12.0", default-features = false }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-common = { default-features = false, path = "../common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
+pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+serde = { default-features = false, features = ['derive'], version = "1.0.130" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-common = { default-features = false, path = "../common" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
-pallet-nonfungible = { default-features = false, path = '../../pallets/nonfungible' }
-pallet-refungible = { default-features = false, path = '../../pallets/refungible' }
pallets/unique/src/weights.rsdiffbeforeafterboth--- a/pallets/unique/src/weights.rs
+++ b/pallets/unique/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_unique
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-12-26, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-01-18, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -59,7 +59,7 @@
// Storage: Common CollectionProperties (r:0 w:1)
// Storage: Common CollectionById (r:0 w:1)
fn create_collection() -> Weight {
- Weight::from_ref_time(52_640_000 as u64)
+ Weight::from_ref_time(43_964_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
@@ -71,27 +71,27 @@
// Storage: Common AdminAmount (r:0 w:1)
// Storage: Common CollectionProperties (r:0 w:1)
fn destroy_collection() -> Weight {
- Weight::from_ref_time(63_934_000 as u64)
+ Weight::from_ref_time(62_034_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Common CollectionById (r:1 w:0)
// Storage: Common Allowlist (r:0 w:1)
fn add_to_allow_list() -> Weight {
- Weight::from_ref_time(31_858_000 as u64)
+ Weight::from_ref_time(27_915_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:0)
// Storage: Common Allowlist (r:0 w:1)
fn remove_from_allow_list() -> Weight {
- Weight::from_ref_time(27_634_000 as u64)
+ Weight::from_ref_time(27_912_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn change_collection_owner() -> Weight {
- Weight::from_ref_time(25_212_000 as u64)
+ Weight::from_ref_time(27_282_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
@@ -99,7 +99,7 @@
// Storage: Common IsAdmin (r:1 w:1)
// Storage: Common AdminAmount (r:1 w:1)
fn add_collection_admin() -> Weight {
- Weight::from_ref_time(29_307_000 as u64)
+ Weight::from_ref_time(30_782_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
@@ -107,43 +107,43 @@
// Storage: Common IsAdmin (r:1 w:1)
// Storage: Common AdminAmount (r:1 w:1)
fn remove_collection_admin() -> Weight {
- Weight::from_ref_time(32_592_000 as u64)
+ Weight::from_ref_time(34_343_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_sponsor() -> Weight {
- Weight::from_ref_time(25_438_000 as u64)
+ Weight::from_ref_time(27_196_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn confirm_sponsorship() -> Weight {
- Weight::from_ref_time(24_965_000 as u64)
+ Weight::from_ref_time(27_116_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn remove_collection_sponsor() -> Weight {
- Weight::from_ref_time(25_094_000 as u64)
+ Weight::from_ref_time(27_019_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_transfers_enabled_flag() -> Weight {
- Weight::from_ref_time(12_800_000 as u64)
+ Weight::from_ref_time(13_405_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_limits() -> Weight {
- Weight::from_ref_time(25_908_000 as u64)
+ Weight::from_ref_time(27_709_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionProperties (r:1 w:1)
fn force_repair_collection() -> Weight {
- Weight::from_ref_time(10_598_000 as u64)
+ Weight::from_ref_time(10_991_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
@@ -158,7 +158,7 @@
// Storage: Common CollectionProperties (r:0 w:1)
// Storage: Common CollectionById (r:0 w:1)
fn create_collection() -> Weight {
- Weight::from_ref_time(52_640_000 as u64)
+ Weight::from_ref_time(43_964_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
@@ -170,27 +170,27 @@
// Storage: Common AdminAmount (r:0 w:1)
// Storage: Common CollectionProperties (r:0 w:1)
fn destroy_collection() -> Weight {
- Weight::from_ref_time(63_934_000 as u64)
+ Weight::from_ref_time(62_034_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
}
// Storage: Common CollectionById (r:1 w:0)
// Storage: Common Allowlist (r:0 w:1)
fn add_to_allow_list() -> Weight {
- Weight::from_ref_time(31_858_000 as u64)
+ Weight::from_ref_time(27_915_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:0)
// Storage: Common Allowlist (r:0 w:1)
fn remove_from_allow_list() -> Weight {
- Weight::from_ref_time(27_634_000 as u64)
+ Weight::from_ref_time(27_912_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn change_collection_owner() -> Weight {
- Weight::from_ref_time(25_212_000 as u64)
+ Weight::from_ref_time(27_282_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
@@ -198,7 +198,7 @@
// Storage: Common IsAdmin (r:1 w:1)
// Storage: Common AdminAmount (r:1 w:1)
fn add_collection_admin() -> Weight {
- Weight::from_ref_time(29_307_000 as u64)
+ Weight::from_ref_time(30_782_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
@@ -206,43 +206,43 @@
// Storage: Common IsAdmin (r:1 w:1)
// Storage: Common AdminAmount (r:1 w:1)
fn remove_collection_admin() -> Weight {
- Weight::from_ref_time(32_592_000 as u64)
+ Weight::from_ref_time(34_343_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_sponsor() -> Weight {
- Weight::from_ref_time(25_438_000 as u64)
+ Weight::from_ref_time(27_196_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn confirm_sponsorship() -> Weight {
- Weight::from_ref_time(24_965_000 as u64)
+ Weight::from_ref_time(27_116_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn remove_collection_sponsor() -> Weight {
- Weight::from_ref_time(25_094_000 as u64)
+ Weight::from_ref_time(27_019_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_transfers_enabled_flag() -> Weight {
- Weight::from_ref_time(12_800_000 as u64)
+ Weight::from_ref_time(13_405_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_limits() -> Weight {
- Weight::from_ref_time(25_908_000 as u64)
+ Weight::from_ref_time(27_709_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Common CollectionProperties (r:1 w:1)
fn force_repair_collection() -> Weight {
- Weight::from_ref_time(10_598_000 as u64)
+ Weight::from_ref_time(10_991_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
primitives/app_promotion_rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/app_promotion_rpc/Cargo.toml
+++ b/primitives/app_promotion_rpc/Cargo.toml
@@ -1,29 +1,16 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "app-promotion-rpc"
version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-pallet-common = { default-features = false, path = '../../pallets/common' }
-up-data-structs = { default-features = false, path = '../data-structs' }
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
- "derive",
-] }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive"] }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
-std = [
- "codec/std",
- "sp-core/std",
- "sp-std/std",
- "sp-api/std",
- "sp-runtime/std",
- "pallet-common/std",
- "up-data-structs/std",
-]
+std = ["codec/std", "sp-api/std", "sp-runtime/std", "sp-std/std"]
primitives/common/Cargo.tomldiffbeforeafterboth--- a/primitives/common/Cargo.toml
+++ b/primitives/common/Cargo.toml
@@ -11,52 +11,22 @@
[features]
default = ['std']
std = [
- 'sp-std/std',
- 'frame-support/std',
- 'sp-runtime/std',
- 'sp-core/std',
- 'sp-consensus-aura/std',
- 'fp-rpc/std',
- 'cumulus-primitives-core/std',
- 'pallet-evm/std',
+ 'cumulus-primitives-core/std',
+ 'fp-rpc/std',
+ 'frame-support/std',
+ 'pallet-evm/std',
+ 'sp-consensus-aura/std',
+ 'sp-core/std',
+ 'sp-runtime/std',
+ 'sp-std/std',
]
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.fp-rpc]
-default-features = false
-git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.36"
-
-[dependencies.cumulus-primitives-core]
-default-features = false
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-evm]
-default-features = false
-git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.36"
+[dependencies]
+cumulus-primitives-core = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
primitives/common/src/constants.rsdiffbeforeafterboth--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -52,10 +52,10 @@
pub const SESSION_LENGTH: BlockNumber = HOURS;
// Targeting 0.1 UNQ per transfer
-pub const WEIGHT_TO_FEE_COEFF: u64 = /*<weight2fee>*/77_071_069_464_131_590/*</weight2fee>*/;
+pub const WEIGHT_TO_FEE_COEFF: u64 = /*<weight2fee>*/77_191_946_012_018_089/*</weight2fee>*/;
// Targeting 0.15 UNQ per transfer via ETH
-pub const MIN_GAS_PRICE: u64 = /*<mingasprice>*/1_014_754_530_878/*</mingasprice>*/;
+pub const MIN_GAS_PRICE: u64 = /*<mingasprice>*/1_016_390_998_841/*</mingasprice>*/;
/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
/// This is used to limit the maximal weight of a single extrinsic.
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -1,50 +1,40 @@
[package]
-name = "up-data-structs"
authors = ["Unique Network <support@uniquenetwork.io>"]
description = "Unique data structs definitions"
edition = "2021"
+homepage = "https://unique.network"
license = 'GPLv3'
-homepage = "https://unique.network"
+name = "up-data-structs"
repository = 'https://github.com/UniqueNetwork/unique-chain'
version = "0.2.2"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
- 'derive',
-] }
-serde = { version = "1.0.130", features = [
- 'derive',
-], default-features = false, optional = true }
+bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ['derive'] }
+derivative = { version = "2.2.0", features = ["use_core"] }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+rmrk-traits = { default-features = false, path = "../rmrk-traits" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+serde = { version = "1.0.130", features = ['derive'], default-features = false, optional = true }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-derivative = { version = "2.2.0", features = ["use_core"] }
-struct-versioning = { path = "../../crates/struct-versioning" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-rmrk-traits = { default-features = false, path = "../rmrk-traits" }
-bondrewd = { version = "0.1.14", features = [
- "derive",
-], default-features = false }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+struct-versioning.path = "../../crates/struct-versioning"
[features]
default = ["std"]
+limit-testing = []
+runtime-benchmarks = []
+serde1 = ["serde/alloc"]
std = [
- "serde1",
- "serde/std",
- "codec/std",
- "frame-system/std",
- "frame-support/std",
- "sp-runtime/std",
- "sp-core/std",
- "sp-std/std",
- "pallet-evm/std",
- "rmrk-traits/std",
+ "codec/std",
+ "frame-support/std",
+ "pallet-evm/std",
+ "rmrk-traits/std",
+ "serde/std",
+ "serde1",
+ "sp-core/std",
+ "sp-runtime/std",
+ "sp-std/std",
]
-serde1 = ["serde/alloc"]
-limit-testing = []
-runtime-benchmarks = []
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -1099,6 +1099,13 @@
EmptyPropertyKey,
}
+/// Token owner error: it could be either `NotFound` ot `MultipleOwners`.
+#[derive(Debug)]
+pub enum TokenOwnerError {
+ NotFound,
+ MultipleOwners,
+}
+
/// Marker for scope of property.
///
/// Scoped property can't be changed by user. Used for external collections.
primitives/pov-estimate-rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/pov-estimate-rpc/Cargo.toml
+++ b/primitives/pov-estimate-rpc/Cargo.toml
@@ -1,28 +1,18 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "up-pov-estimate-rpc"
version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
- "derive",
-] }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive"] }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
serde = { version = "1.0.130", features = ["derive"], default-features = false, optional = true }
-scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
-std = [
- "codec/std",
- "serde/std",
- "scale-info/std",
- "sp-core/std",
- "sp-std/std",
- "sp-api/std",
- "sp-runtime/std",
-]
+std = ["codec/std", "scale-info/std", "serde/std", "sp-api/std", "sp-core/std", "sp-runtime/std", "sp-std/std"]
primitives/rmrk-rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/rmrk-rpc/Cargo.toml
+++ b/primitives/rmrk-rpc/Cargo.toml
@@ -1,28 +1,17 @@
[package]
+edition = "2021"
+license = ""
name = "rmrk-rpc"
version = "0.0.2"
-license = ""
-edition = "2021"
[dependencies]
-codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [
- "derive",
-] }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }
+rmrk-traits = { default-features = false, path = "../rmrk-traits" }
+serde = { version = "1.0.130", default-features = false, features = ["derive"] }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-serde = { version = "1.0.130", default-features = false, features = ["derive"] }
-rmrk-traits = { default-features = false, path = "../rmrk-traits" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
-std = [
- "codec/std",
- "sp-core/std",
- "sp-std/std",
- "sp-api/std",
- "sp-runtime/std",
- "serde/std",
- "rmrk-traits/std",
-]
+std = ["codec/std", "rmrk-traits/std", "serde/std", "sp-api/std", "sp-runtime/std", "sp-std/std"]
primitives/rmrk-traits/Cargo.tomldiffbeforeafterboth--- a/primitives/rmrk-traits/Cargo.toml
+++ b/primitives/rmrk-traits/Cargo.toml
@@ -1,23 +1,19 @@
[package]
-name = "rmrk-traits"
authors = ["Unique Network <support@uniquenetwork.io>"]
description = "RMRK proxy data structs definitions"
edition = "2021"
+homepage = "https://unique.network"
license = 'GPLv3'
-homepage = "https://unique.network"
+name = "rmrk-traits"
repository = 'https://github.com/UniqueNetwork/unique-chain'
version = "0.1.0"
[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive"] }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
serde = { version = "1.0.130", features = ["derive"], default-features = false, optional = true }
[features]
default = ["std"]
-std = [
- "serde1",
- "serde/std",
- "codec/std",
-]
serde1 = ["serde/alloc"]
+std = ["codec/std", "serde/std", "serde1"]
primitives/rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/rpc/Cargo.toml
+++ b/primitives/rpc/Cargo.toml
@@ -1,29 +1,27 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "up-rpc"
version = "0.1.3"
-license = "GPLv3"
-edition = "2021"
[dependencies]
-pallet-common = { default-features = false, path = '../../pallets/common' }
-up-data-structs = { default-features = false, path = '../data-structs' }
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
- "derive",
-] }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive"] }
+pallet-common = { default-features = false, path = "../../pallets/common" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+up-data-structs = { default-features = false, path = "../data-structs" }
[features]
default = ["std"]
std = [
"codec/std",
+ "pallet-common/std",
+ "sp-api/std",
"sp-core/std",
+ "sp-runtime/std",
"sp-std/std",
- "sp-api/std",
- "sp-runtime/std",
- "pallet-common/std",
"up-data-structs/std",
]
runtime/common/ethereum/precompiles/utils/macro/Cargo.tomldiffbeforeafterboth--- a/runtime/common/ethereum/precompiles/utils/macro/Cargo.toml
+++ b/runtime/common/ethereum/precompiles/utils/macro/Cargo.toml
@@ -1,8 +1,8 @@
[package]
-name = "precompile-utils-macro"
-authors = [ "StakeTechnologies", "PureStake" ]
+authors = ["PureStake", "StakeTechnologies"]
description = ""
edition = "2018"
+name = "precompile-utils-macro"
version = "0.1.0"
[lib]
@@ -13,4 +13,4 @@
proc-macro2 = "1.0"
quote = "1.0"
sha3 = "0.8"
-syn = { version = "1.0", features = [ "extra-traits", "fold", "full", "visit" ] }
+syn = { version = "1.0", features = ["extra-traits", "fold", "full", "visit"] }
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -16,11 +16,11 @@
#[macro_export]
macro_rules! dispatch_unique_runtime {
- ($collection:ident.$method:ident($($name:ident),*)) => {{
+ ($collection:ident.$method:ident($($name:ident),*) $($rest:tt)*) => {{
let collection = <Runtime as pallet_common::Config>::CollectionDispatch::dispatch(<pallet_common::CollectionHandle<Runtime>>::try_get($collection)?);
let dispatch = collection.as_dyn();
- Ok::<_, DispatchError>(dispatch.$method($($name),*))
+ Ok::<_, DispatchError>(dispatch.$method($($name),*) $($rest)*)
}};
}
@@ -73,7 +73,7 @@
}
fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {
- dispatch_unique_runtime!(collection.token_owner(token))
+ dispatch_unique_runtime!(collection.token_owner(token).ok())
}
fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec::<CrossAccountId>, DispatchError> {
@@ -83,7 +83,7 @@
fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {
let budget = up_data_structs::budget::Value::new(10);
- Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))
+ Ok(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?)
}
fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {
Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))
@@ -720,7 +720,7 @@
// list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
- let storage_info = AllPalletsReversedWithSystemFirst::storage_info();
+ let storage_info = AllPalletsWithSystem::storage_info();
return (list, storage_info)
}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -16,520 +16,289 @@
targets = ['x86_64-unknown-linux-gnu']
[features]
-default = ['std', 'opal-runtime']
+default = ['opal-runtime', 'std']
+limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
+opal-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'pallet-test-utils', 'refungible', 'rmrk']
+pov-estimate = []
runtime-benchmarks = [
- 'hex-literal',
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system-benchmarking',
- 'frame-system/runtime-benchmarks',
- 'pallet-ethereum/runtime-benchmarks',
- 'pallet-evm-migration/runtime-benchmarks',
- 'pallet-evm-coder-substrate/runtime-benchmarks',
- 'pallet-balances/runtime-benchmarks',
- 'pallet-timestamp/runtime-benchmarks',
- 'pallet-configuration/runtime-benchmarks',
- 'pallet-common/runtime-benchmarks',
- 'pallet-structure/runtime-benchmarks',
- 'pallet-fungible/runtime-benchmarks',
- 'pallet-refungible/runtime-benchmarks',
- 'pallet-nonfungible/runtime-benchmarks',
- 'pallet-proxy-rmrk-core/runtime-benchmarks',
- 'pallet-proxy-rmrk-equip/runtime-benchmarks',
- 'pallet-foreign-assets/runtime-benchmarks',
- 'pallet-unique/runtime-benchmarks',
- 'pallet-inflation/runtime-benchmarks',
- 'pallet-app-promotion/runtime-benchmarks',
- 'pallet-collator-selection/runtime-benchmarks',
- 'pallet-identity/runtime-benchmarks',
- 'pallet-unique-scheduler-v2/runtime-benchmarks',
- 'pallet-xcm/runtime-benchmarks',
- 'sp-runtime/runtime-benchmarks',
- 'xcm-builder/runtime-benchmarks',
- 'pallet-maintenance/runtime-benchmarks',
- 'cumulus-pallet-parachain-system/runtime-benchmarks',
-]
-try-runtime = [
- 'frame-try-runtime',
- 'frame-try-runtime?/try-runtime',
- 'frame-executive/try-runtime',
- 'frame-support/try-runtime',
- 'frame-system/try-runtime',
- 'cumulus-pallet-parachain-system/try-runtime',
- 'parachain-info/try-runtime',
- 'pallet-aura/try-runtime',
- 'cumulus-pallet-aura-ext/try-runtime',
- 'pallet-balances/try-runtime',
- 'pallet-randomness-collective-flip/try-runtime',
- 'pallet-timestamp/try-runtime',
- 'pallet-transaction-payment/try-runtime',
- 'pallet-treasury/try-runtime',
- 'pallet-sudo/try-runtime',
- 'orml-vesting/try-runtime',
- 'orml-xtokens/try-runtime',
- 'orml-tokens/try-runtime',
- 'cumulus-pallet-xcmp-queue/try-runtime',
- 'pallet-xcm/try-runtime',
- 'cumulus-pallet-xcm/try-runtime',
- 'cumulus-pallet-dmp-queue/try-runtime',
- "pallet-authorship/try-runtime",
- "pallet-collator-selection/try-runtime",
- "pallet-session/try-runtime",
- "pallet-identity/try-runtime",
- 'pallet-inflation/try-runtime',
- 'pallet-unique/try-runtime',
- 'pallet-configuration/try-runtime',
- 'pallet-charge-transaction/try-runtime',
- 'pallet-common/try-runtime',
- 'pallet-fungible/try-runtime',
- 'pallet-refungible/try-runtime',
- 'pallet-nonfungible/try-runtime',
- 'pallet-structure/try-runtime',
- 'pallet-proxy-rmrk-core/try-runtime',
- 'pallet-proxy-rmrk-equip/try-runtime',
- 'pallet-app-promotion/try-runtime',
- 'pallet-foreign-assets/try-runtime',
- 'pallet-ethereum/try-runtime',
- 'pallet-evm/try-runtime',
- 'pallet-evm-coder-substrate/try-runtime',
- 'pallet-evm-contract-helpers/try-runtime',
- 'pallet-evm-transaction-payment/try-runtime',
- 'pallet-evm-migration/try-runtime',
- 'pallet-base-fee/try-runtime',
- 'pallet-unique-scheduler-v2/try-runtime',
- 'pallet-maintenance/try-runtime',
- 'pallet-test-utils/try-runtime',
- 'fp-self-contained/try-runtime',
+ 'cumulus-pallet-parachain-system/runtime-benchmarks',
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system-benchmarking',
+ 'frame-system/runtime-benchmarks',
+ 'hex-literal',
+ 'pallet-app-promotion/runtime-benchmarks',
+ 'pallet-balances/runtime-benchmarks',
+ 'pallet-collator-selection/runtime-benchmarks',
+ 'pallet-common/runtime-benchmarks',
+ 'pallet-configuration/runtime-benchmarks',
+ 'pallet-ethereum/runtime-benchmarks',
+ 'pallet-evm-coder-substrate/runtime-benchmarks',
+ 'pallet-evm-migration/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
+ 'pallet-fungible/runtime-benchmarks',
+ 'pallet-identity/runtime-benchmarks',
+ 'pallet-inflation/runtime-benchmarks',
+ 'pallet-maintenance/runtime-benchmarks',
+ 'pallet-nonfungible/runtime-benchmarks',
+ 'pallet-proxy-rmrk-core/runtime-benchmarks',
+ 'pallet-proxy-rmrk-equip/runtime-benchmarks',
+ 'pallet-refungible/runtime-benchmarks',
+ 'pallet-structure/runtime-benchmarks',
+ 'pallet-timestamp/runtime-benchmarks',
+ 'pallet-unique-scheduler-v2/runtime-benchmarks',
+ 'pallet-unique/runtime-benchmarks',
+ 'pallet-xcm/runtime-benchmarks',
+ 'sp-runtime/runtime-benchmarks',
+ 'xcm-builder/runtime-benchmarks',
]
std = [
- 'codec/std',
- 'cumulus-pallet-aura-ext/std',
- 'cumulus-pallet-parachain-system/std',
- 'cumulus-pallet-xcm/std',
- 'cumulus-pallet-xcmp-queue/std',
- 'cumulus-primitives-core/std',
- 'cumulus-primitives-utility/std',
- 'frame-try-runtime/std',
- 'frame-executive/std',
- 'frame-support/std',
- 'frame-system/std',
- 'frame-system-rpc-runtime-api/std',
- 'pallet-aura/std',
- 'pallet-balances/std',
- # 'pallet-contracts/std',
- # 'pallet-contracts-primitives/std',
- # 'pallet-contracts-rpc-runtime-api/std',
- # 'pallet-contract-helpers/std',
+ 'codec/std',
+ 'cumulus-pallet-aura-ext/std',
+ 'cumulus-pallet-parachain-system/std',
+ 'cumulus-pallet-xcm/std',
+ 'cumulus-pallet-xcmp-queue/std',
+ 'cumulus-primitives-core/std',
+ 'cumulus-primitives-utility/std',
+ 'frame-executive/std',
+ 'frame-support/std',
+ 'frame-system-rpc-runtime-api/std',
+ 'frame-system/std',
+ 'frame-try-runtime/std',
+ 'pallet-aura/std',
+ 'pallet-balances/std',
+ # 'pallet-contracts/std',
+ # 'pallet-contracts-primitives/std',
+ # 'pallet-contracts-rpc-runtime-api/std',
+ # 'pallet-contract-helpers/std',
"pallet-authorship/std",
+ "pallet-session/std",
+ "sp-consensus-aura/std",
+ 'app-promotion-rpc/std',
+ 'evm-coder/std',
+ 'fp-evm-mapping/std',
+ 'fp-rpc/std',
+ 'fp-self-contained/std',
+ 'pallet-app-promotion/std',
+ 'pallet-base-fee/std',
+ 'pallet-charge-transaction/std',
'pallet-collator-selection/std',
- "pallet-session/std",
+ 'pallet-common/std',
+ 'pallet-configuration/std',
+ 'pallet-ethereum/std',
+ 'pallet-evm-coder-substrate/std',
+ 'pallet-evm-contract-helpers/std',
+ 'pallet-evm-migration/std',
+ 'pallet-evm-transaction-payment/std',
+ 'pallet-evm/std',
+ 'pallet-fungible/std',
'pallet-identity/std',
- 'pallet-randomness-collective-flip/std',
- 'pallet-sudo/std',
- 'pallet-timestamp/std',
- 'pallet-transaction-payment/std',
- 'pallet-transaction-payment-rpc-runtime-api/std',
- 'pallet-treasury/std',
- 'pallet-evm/std',
- 'pallet-evm-migration/std',
- 'pallet-evm-contract-helpers/std',
- 'pallet-evm-transaction-payment/std',
- 'pallet-evm-coder-substrate/std',
- 'pallet-ethereum/std',
- 'pallet-base-fee/std',
- 'fp-rpc/std',
- 'up-rpc/std',
- 'up-pov-estimate-rpc/std',
- 'app-promotion-rpc/std',
- 'fp-evm-mapping/std',
- 'fp-self-contained/std',
- 'parachain-info/std',
- 'serde',
- 'pallet-inflation/std',
- 'pallet-configuration/std',
- 'pallet-app-promotion/std',
- 'pallet-common/std',
- 'pallet-structure/std',
- 'pallet-fungible/std',
- 'pallet-refungible/std',
- 'pallet-nonfungible/std',
- 'pallet-proxy-rmrk-core/std',
- 'pallet-proxy-rmrk-equip/std',
- 'pallet-unique/std',
- 'pallet-unique-scheduler-v2/std',
- 'pallet-charge-transaction/std',
- 'up-data-structs/std',
- 'sp-api/std',
- 'sp-block-builder/std',
- "sp-consensus-aura/std",
- 'sp-core/std',
- 'sp-inherents/std',
- 'sp-io/std',
- 'sp-offchain/std',
- 'sp-runtime/std',
- 'sp-session/std',
- 'sp-std/std',
- 'sp-transaction-pool/std',
- 'sp-version/std',
- 'xcm/std',
- 'xcm-builder/std',
- 'xcm-executor/std',
- 'up-common/std',
- 'rmrk-rpc/std',
- 'evm-coder/std',
- 'up-sponsorship/std',
+ 'pallet-inflation/std',
+ 'pallet-nonfungible/std',
+ 'pallet-proxy-rmrk-core/std',
+ 'pallet-proxy-rmrk-equip/std',
+ 'pallet-randomness-collective-flip/std',
+ 'pallet-refungible/std',
+ 'pallet-structure/std',
+ 'pallet-sudo/std',
+ 'pallet-timestamp/std',
+ 'pallet-transaction-payment-rpc-runtime-api/std',
+ 'pallet-transaction-payment/std',
+ 'pallet-treasury/std',
+ 'pallet-unique-scheduler-v2/std',
+ 'pallet-unique/std',
+ 'parachain-info/std',
+ 'rmrk-rpc/std',
+ 'serde',
+ 'sp-api/std',
+ 'sp-block-builder/std',
+ 'sp-core/std',
+ 'sp-inherents/std',
+ 'sp-io/std',
+ 'sp-offchain/std',
+ 'sp-runtime/std',
+ 'sp-session/std',
+ 'sp-std/std',
+ 'sp-transaction-pool/std',
+ 'sp-version/std',
+ 'up-common/std',
+ 'up-data-structs/std',
+ 'up-pov-estimate-rpc/std',
+ 'up-rpc/std',
+ 'up-sponsorship/std',
+ 'xcm-builder/std',
+ 'xcm-executor/std',
+ 'xcm/std',
- "orml-vesting/std",
- "orml-tokens/std",
- "orml-xtokens/std",
- "orml-traits/std",
- "pallet-foreign-assets/std",
+ "orml-tokens/std",
+ "orml-traits/std",
+ "orml-vesting/std",
+ "orml-xtokens/std",
+ "pallet-foreign-assets/std",
- 'pallet-maintenance/std',
- 'pallet-test-utils/std',
+ 'pallet-maintenance/std',
+ 'pallet-test-utils/std',
]
-limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = [
- 'refungible',
- 'rmrk',
- 'app-promotion',
- 'collator-selection',
- 'foreign-assets',
- 'pallet-test-utils',
+try-runtime = [
+ "pallet-authorship/try-runtime",
+ "pallet-collator-selection/try-runtime",
+ "pallet-identity/try-runtime",
+ "pallet-session/try-runtime",
+ 'cumulus-pallet-aura-ext/try-runtime',
+ 'cumulus-pallet-dmp-queue/try-runtime',
+ 'cumulus-pallet-parachain-system/try-runtime',
+ 'cumulus-pallet-xcm/try-runtime',
+ 'cumulus-pallet-xcmp-queue/try-runtime',
+ 'fp-self-contained/try-runtime',
+ 'frame-executive/try-runtime',
+ 'frame-support/try-runtime',
+ 'frame-system/try-runtime',
+ 'frame-try-runtime',
+ 'frame-try-runtime?/try-runtime',
+ 'orml-tokens/try-runtime',
+ 'orml-vesting/try-runtime',
+ 'orml-xtokens/try-runtime',
+ 'pallet-app-promotion/try-runtime',
+ 'pallet-aura/try-runtime',
+ 'pallet-balances/try-runtime',
+ 'pallet-base-fee/try-runtime',
+ 'pallet-charge-transaction/try-runtime',
+ 'pallet-common/try-runtime',
+ 'pallet-configuration/try-runtime',
+ 'pallet-ethereum/try-runtime',
+ 'pallet-evm-coder-substrate/try-runtime',
+ 'pallet-evm-contract-helpers/try-runtime',
+ 'pallet-evm-migration/try-runtime',
+ 'pallet-evm-transaction-payment/try-runtime',
+ 'pallet-evm/try-runtime',
+ 'pallet-foreign-assets/try-runtime',
+ 'pallet-fungible/try-runtime',
+ 'pallet-inflation/try-runtime',
+ 'pallet-maintenance/try-runtime',
+ 'pallet-nonfungible/try-runtime',
+ 'pallet-proxy-rmrk-core/try-runtime',
+ 'pallet-proxy-rmrk-equip/try-runtime',
+ 'pallet-randomness-collective-flip/try-runtime',
+ 'pallet-refungible/try-runtime',
+ 'pallet-structure/try-runtime',
+ 'pallet-sudo/try-runtime',
+ 'pallet-test-utils/try-runtime',
+ 'pallet-timestamp/try-runtime',
+ 'pallet-transaction-payment/try-runtime',
+ 'pallet-treasury/try-runtime',
+ 'pallet-unique-scheduler-v2/try-runtime',
+ 'pallet-unique/try-runtime',
+ 'pallet-xcm/try-runtime',
+ 'parachain-info/try-runtime',
]
-pov-estimate = []
-refungible = []
-scheduler = []
-rmrk = []
-foreign-assets = []
app-promotion = []
collator-selection = []
+foreign-assets = []
pallet-test-utils = []
-
-################################################################################
-# Substrate Dependencies
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-try-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-executive]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.hex-literal]
-optional = true
-version = '0.3.3'
-
-[dependencies.serde]
-default-features = false
-features = ['derive']
-optional = true
-version = '1.0.130'
-
-[dependencies.pallet-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-authorship]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-session]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-balances]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-# Contracts specific packages
-# [dependencies.pallet-contracts]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-primitives]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-rpc-runtime-api]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-[dependencies.pallet-randomness-collective-flip]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-sudo]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-timestamp]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-treasury]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-arithmetic]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-block-builder]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-inherents]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-offchain]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+refungible = []
+rmrk = []
+scheduler = []
-[dependencies.sp-session]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-transaction-pool]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-version]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.smallvec]
-version = '1.6.1'
-
################################################################################
-# Cumulus dependencies
-
-[dependencies.parachain-info]
-default-features = false
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-pallet-aura-ext]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-parachain-system]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-core]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcm]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-dmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-utility]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-timestamp]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-################################################################################
-# Polkadot dependencies
-
-[dependencies.polkadot-parachain]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-builder]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-executor]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.pallet-xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-################################################################################
# local dependencies
[dependencies]
-orml-vesting.workspace = true
-orml-xtokens.workspace = true
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+hex-literal = { optional = true, version = "0.3.3" }
orml-tokens.workspace = true
orml-traits.workspace = true
+orml-vesting.workspace = true
+orml-xtokens.workspace = true
+pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+serde = { default-features = false, features = ['derive'], optional = true, version = "1.0.130" }
+smallvec = "1.6.1"
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
-log = { version = "0.4.16", default-features = false }
-up-common = { path = "../../primitives/common", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
derivative = "2.2.0"
-pallet-unique = { path = '../../pallets/unique', default-features = false }
-up-rpc = { path = "../../primitives/rpc", default-features = false }
-up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
-rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-inflation = { path = '../../pallets/inflation', default-features = false }
-pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
-up-data-structs = { path = '../../primitives/data-structs', default-features = false }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+log = { version = "0.4.16", default-features = false }
+num_enum = { version = "0.5.3", default-features = false }
+pallet-app-promotion = { path = "../../pallets/app-promotion", default-features = false }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-collator-selection = { default-features = false, path = "../../pallets/collator-selection" }
-pallet-identity = { default-features = false, path = "../../pallets/identity" }
-pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
-pallet-structure = { default-features = false, path = "../../pallets/structure" }
-pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
-pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
-pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
-pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
-pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
-pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }
-pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
-pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
-pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+pallet-evm-contract-helpers = { path = "../../pallets/evm-contract-helpers", default-features = false }
+pallet-evm-migration = { path = "../../pallets/evm-migration", default-features = false }
pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
+pallet-evm-transaction-payment = { path = "../../pallets/evm-transaction-payment", default-features = false }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
+pallet-identity = { default-features = false, path = "../../pallets/identity" }
+pallet-inflation = { path = "../../pallets/inflation", default-features = false }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
-precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
-num_enum = { version = "0.5.3", default-features = false }
+pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
+pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
+pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
+pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
+pallet-unique = { path = "../../pallets/unique", default-features = false }
+pallet-unique-scheduler-v2 = { path = "../../pallets/scheduler-v2", default-features = false }
+precompile-utils-macro.path = "../common/ethereum/precompiles/utils/macro"
+rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+up-common = { path = "../../primitives/common", default-features = false }
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
+up-rpc = { path = "../../primitives/rpc", default-features = false }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
################################################################################
# Test dependencies
@@ -540,16 +309,9 @@
# Other Dependencies
impl-trait-for-tuples = "0.2.2"
-
-################################################################################
-# Dev Dependencies
-[dev-dependencies.logtest]
-version = "2.0.0"
-
-################################################################################
-# Build Dependencies
+[dev-dependencies]
+logtest = "2.0.0"
-[build-dependencies.substrate-wasm-builder]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+[build-dependencies]
+substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -16,512 +16,281 @@
targets = ['x86_64-unknown-linux-gnu']
[features]
-default = ['std', 'quartz-runtime']
+become-sapphire = []
+default = ['quartz-runtime', 'std']
+limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
+pov-estimate = []
+quartz-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'refungible']
runtime-benchmarks = [
- 'hex-literal',
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system-benchmarking',
- 'frame-system/runtime-benchmarks',
- 'pallet-ethereum/runtime-benchmarks',
- 'pallet-evm-migration/runtime-benchmarks',
- 'pallet-evm-coder-substrate/runtime-benchmarks',
- 'pallet-balances/runtime-benchmarks',
- 'pallet-timestamp/runtime-benchmarks',
- 'pallet-configuration/runtime-benchmarks',
- 'pallet-common/runtime-benchmarks',
- 'pallet-structure/runtime-benchmarks',
- 'pallet-fungible/runtime-benchmarks',
- 'pallet-refungible/runtime-benchmarks',
- 'pallet-nonfungible/runtime-benchmarks',
- 'pallet-proxy-rmrk-core/runtime-benchmarks',
- 'pallet-proxy-rmrk-equip/runtime-benchmarks',
- 'pallet-unique/runtime-benchmarks',
- 'pallet-foreign-assets/runtime-benchmarks',
- 'pallet-inflation/runtime-benchmarks',
- 'pallet-collator-selection/runtime-benchmarks',
- 'pallet-identity/runtime-benchmarks',
- 'pallet-app-promotion/runtime-benchmarks',
- 'pallet-xcm/runtime-benchmarks',
- 'sp-runtime/runtime-benchmarks',
- 'xcm-builder/runtime-benchmarks',
- 'pallet-maintenance/runtime-benchmarks',
- 'cumulus-pallet-parachain-system/runtime-benchmarks',
-]
-try-runtime = [
- 'frame-try-runtime',
- 'frame-executive/try-runtime',
- 'frame-support/try-runtime',
- 'frame-system/try-runtime',
- 'cumulus-pallet-parachain-system/try-runtime',
- 'parachain-info/try-runtime',
- 'pallet-aura/try-runtime',
- 'cumulus-pallet-aura-ext/try-runtime',
- 'pallet-balances/try-runtime',
- 'pallet-randomness-collective-flip/try-runtime',
- 'pallet-timestamp/try-runtime',
- 'pallet-transaction-payment/try-runtime',
- 'pallet-treasury/try-runtime',
- 'pallet-sudo/try-runtime',
- 'orml-vesting/try-runtime',
- 'orml-xtokens/try-runtime',
- 'orml-tokens/try-runtime',
- 'cumulus-pallet-xcmp-queue/try-runtime',
- 'pallet-xcm/try-runtime',
- 'cumulus-pallet-xcm/try-runtime',
- 'cumulus-pallet-dmp-queue/try-runtime',
- "pallet-authorship/try-runtime",
- "pallet-collator-selection/try-runtime",
- "pallet-session/try-runtime",
- "pallet-identity/try-runtime",
- 'pallet-inflation/try-runtime',
- 'pallet-unique/try-runtime',
- 'pallet-configuration/try-runtime',
- 'pallet-charge-transaction/try-runtime',
- 'pallet-common/try-runtime',
- 'pallet-fungible/try-runtime',
- 'pallet-refungible/try-runtime',
- 'pallet-nonfungible/try-runtime',
- 'pallet-structure/try-runtime',
- 'pallet-proxy-rmrk-core/try-runtime',
- 'pallet-proxy-rmrk-equip/try-runtime',
- 'pallet-app-promotion/try-runtime',
- 'pallet-foreign-assets/try-runtime',
- 'pallet-ethereum/try-runtime',
- 'pallet-evm/try-runtime',
- 'pallet-evm-coder-substrate/try-runtime',
- 'pallet-evm-contract-helpers/try-runtime',
- 'pallet-evm-transaction-payment/try-runtime',
- 'pallet-evm-migration/try-runtime',
- 'pallet-maintenance/try-runtime',
- 'fp-self-contained/try-runtime',
+ 'cumulus-pallet-parachain-system/runtime-benchmarks',
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system-benchmarking',
+ 'frame-system/runtime-benchmarks',
+ 'hex-literal',
+ 'pallet-app-promotion/runtime-benchmarks',
+ 'pallet-balances/runtime-benchmarks',
+ 'pallet-collator-selection/runtime-benchmarks',
+ 'pallet-common/runtime-benchmarks',
+ 'pallet-configuration/runtime-benchmarks',
+ 'pallet-ethereum/runtime-benchmarks',
+ 'pallet-evm-coder-substrate/runtime-benchmarks',
+ 'pallet-evm-migration/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
+ 'pallet-fungible/runtime-benchmarks',
+ 'pallet-identity/runtime-benchmarks',
+ 'pallet-inflation/runtime-benchmarks',
+ 'pallet-maintenance/runtime-benchmarks',
+ 'pallet-nonfungible/runtime-benchmarks',
+ 'pallet-proxy-rmrk-core/runtime-benchmarks',
+ 'pallet-proxy-rmrk-equip/runtime-benchmarks',
+ 'pallet-refungible/runtime-benchmarks',
+ 'pallet-structure/runtime-benchmarks',
+ 'pallet-timestamp/runtime-benchmarks',
+ 'pallet-unique/runtime-benchmarks',
+ 'pallet-xcm/runtime-benchmarks',
+ 'sp-runtime/runtime-benchmarks',
+ 'xcm-builder/runtime-benchmarks',
]
std = [
- 'codec/std',
- 'cumulus-pallet-aura-ext/std',
- 'cumulus-pallet-parachain-system/std',
- 'cumulus-pallet-xcm/std',
- 'cumulus-pallet-xcmp-queue/std',
- 'cumulus-primitives-core/std',
- 'cumulus-primitives-utility/std',
- 'frame-try-runtime/std',
- 'frame-executive/std',
- 'frame-support/std',
- 'frame-system/std',
- 'frame-system-rpc-runtime-api/std',
- 'pallet-aura/std',
- 'pallet-balances/std',
- # 'pallet-contracts/std',
- # 'pallet-contracts-primitives/std',
- # 'pallet-contracts-rpc-runtime-api/std',
- # 'pallet-contract-helpers/std',
+ 'codec/std',
+ 'cumulus-pallet-aura-ext/std',
+ 'cumulus-pallet-parachain-system/std',
+ 'cumulus-pallet-xcm/std',
+ 'cumulus-pallet-xcmp-queue/std',
+ 'cumulus-primitives-core/std',
+ 'cumulus-primitives-utility/std',
+ 'frame-executive/std',
+ 'frame-support/std',
+ 'frame-system-rpc-runtime-api/std',
+ 'frame-system/std',
+ 'frame-try-runtime/std',
+ 'pallet-aura/std',
+ 'pallet-balances/std',
+ # 'pallet-contracts/std',
+ # 'pallet-contracts-primitives/std',
+ # 'pallet-contracts-rpc-runtime-api/std',
+ # 'pallet-contract-helpers/std',
"pallet-authorship/std",
- 'pallet-collator-selection/std',
- "pallet-session/std",
"pallet-identity/std",
- 'pallet-randomness-collective-flip/std',
- 'pallet-sudo/std',
- 'pallet-timestamp/std',
- 'pallet-transaction-payment/std',
- 'pallet-transaction-payment-rpc-runtime-api/std',
- 'pallet-treasury/std',
- 'pallet-evm/std',
- 'pallet-evm-migration/std',
- 'pallet-evm-contract-helpers/std',
- 'pallet-evm-transaction-payment/std',
- 'pallet-evm-coder-substrate/std',
- 'pallet-ethereum/std',
- 'pallet-base-fee/std',
- 'fp-rpc/std',
- 'up-rpc/std',
- 'up-pov-estimate-rpc/std',
- 'app-promotion-rpc/std',
- 'fp-evm-mapping/std',
- 'fp-self-contained/std',
- 'parachain-info/std',
- 'serde',
- 'pallet-inflation/std',
- 'pallet-configuration/std',
- 'pallet-app-promotion/std',
- 'pallet-common/std',
- 'pallet-structure/std',
- 'pallet-fungible/std',
- 'pallet-refungible/std',
- 'pallet-nonfungible/std',
- 'pallet-proxy-rmrk-core/std',
- 'pallet-proxy-rmrk-equip/std',
- 'pallet-unique/std',
- 'pallet-charge-transaction/std',
- 'up-data-structs/std',
- 'sp-api/std',
- 'sp-block-builder/std',
- "sp-consensus-aura/std",
- 'sp-core/std',
- 'sp-inherents/std',
- 'sp-io/std',
- 'sp-offchain/std',
- 'sp-runtime/std',
- 'sp-session/std',
- 'sp-std/std',
- 'sp-transaction-pool/std',
- 'sp-version/std',
- 'xcm/std',
- 'xcm-builder/std',
- 'xcm-executor/std',
- 'up-common/std',
- 'rmrk-rpc/std',
- 'evm-coder/std',
- 'up-sponsorship/std',
+ "pallet-session/std",
+ "sp-consensus-aura/std",
+ 'app-promotion-rpc/std',
+ 'evm-coder/std',
+ 'fp-evm-mapping/std',
+ 'fp-rpc/std',
+ 'fp-self-contained/std',
+ 'pallet-app-promotion/std',
+ 'pallet-base-fee/std',
+ 'pallet-charge-transaction/std',
+ 'pallet-collator-selection/std',
+ 'pallet-common/std',
+ 'pallet-configuration/std',
+ 'pallet-ethereum/std',
+ 'pallet-evm-coder-substrate/std',
+ 'pallet-evm-contract-helpers/std',
+ 'pallet-evm-migration/std',
+ 'pallet-evm-transaction-payment/std',
+ 'pallet-evm/std',
+ 'pallet-fungible/std',
+ 'pallet-inflation/std',
+ 'pallet-nonfungible/std',
+ 'pallet-proxy-rmrk-core/std',
+ 'pallet-proxy-rmrk-equip/std',
+ 'pallet-randomness-collective-flip/std',
+ 'pallet-refungible/std',
+ 'pallet-structure/std',
+ 'pallet-sudo/std',
+ 'pallet-timestamp/std',
+ 'pallet-transaction-payment-rpc-runtime-api/std',
+ 'pallet-transaction-payment/std',
+ 'pallet-treasury/std',
+ 'pallet-unique/std',
+ 'parachain-info/std',
+ 'rmrk-rpc/std',
+ 'serde',
+ 'sp-api/std',
+ 'sp-block-builder/std',
+ 'sp-core/std',
+ 'sp-inherents/std',
+ 'sp-io/std',
+ 'sp-offchain/std',
+ 'sp-runtime/std',
+ 'sp-session/std',
+ 'sp-std/std',
+ 'sp-transaction-pool/std',
+ 'sp-version/std',
+ 'up-common/std',
+ 'up-data-structs/std',
+ 'up-pov-estimate-rpc/std',
+ 'up-rpc/std',
+ 'up-sponsorship/std',
+ 'xcm-builder/std',
+ 'xcm-executor/std',
+ 'xcm/std',
- "orml-vesting/std",
- "orml-tokens/std",
- "orml-xtokens/std",
- "orml-traits/std",
- "pallet-foreign-assets/std",
- "pallet-maintenance/std",
+ "orml-tokens/std",
+ "orml-traits/std",
+ "orml-vesting/std",
+ "orml-xtokens/std",
+ "pallet-foreign-assets/std",
+ "pallet-maintenance/std",
+]
+try-runtime = [
+ "pallet-authorship/try-runtime",
+ "pallet-collator-selection/try-runtime",
+ "pallet-identity/try-runtime",
+ "pallet-session/try-runtime",
+ 'cumulus-pallet-aura-ext/try-runtime',
+ 'cumulus-pallet-dmp-queue/try-runtime',
+ 'cumulus-pallet-parachain-system/try-runtime',
+ 'cumulus-pallet-xcm/try-runtime',
+ 'cumulus-pallet-xcmp-queue/try-runtime',
+ 'fp-self-contained/try-runtime',
+ 'frame-executive/try-runtime',
+ 'frame-support/try-runtime',
+ 'frame-system/try-runtime',
+ 'frame-try-runtime',
+ 'orml-tokens/try-runtime',
+ 'orml-vesting/try-runtime',
+ 'orml-xtokens/try-runtime',
+ 'pallet-app-promotion/try-runtime',
+ 'pallet-aura/try-runtime',
+ 'pallet-balances/try-runtime',
+ 'pallet-charge-transaction/try-runtime',
+ 'pallet-common/try-runtime',
+ 'pallet-configuration/try-runtime',
+ 'pallet-ethereum/try-runtime',
+ 'pallet-evm-coder-substrate/try-runtime',
+ 'pallet-evm-contract-helpers/try-runtime',
+ 'pallet-evm-migration/try-runtime',
+ 'pallet-evm-transaction-payment/try-runtime',
+ 'pallet-evm/try-runtime',
+ 'pallet-foreign-assets/try-runtime',
+ 'pallet-fungible/try-runtime',
+ 'pallet-inflation/try-runtime',
+ 'pallet-maintenance/try-runtime',
+ 'pallet-nonfungible/try-runtime',
+ 'pallet-proxy-rmrk-core/try-runtime',
+ 'pallet-proxy-rmrk-equip/try-runtime',
+ 'pallet-randomness-collective-flip/try-runtime',
+ 'pallet-refungible/try-runtime',
+ 'pallet-structure/try-runtime',
+ 'pallet-sudo/try-runtime',
+ 'pallet-timestamp/try-runtime',
+ 'pallet-transaction-payment/try-runtime',
+ 'pallet-treasury/try-runtime',
+ 'pallet-unique/try-runtime',
+ 'pallet-xcm/try-runtime',
+ 'parachain-info/try-runtime',
]
-limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-quartz-runtime = ['refungible', 'app-promotion', 'collator-selection', 'foreign-assets']
-become-sapphire = []
-pov-estimate = []
+app-promotion = []
+collator-selection = []
+foreign-assets = []
refungible = []
-scheduler = []
rmrk = []
-foreign-assets = []
-collator-selection = []
-app-promotion = []
-
-################################################################################
-# Substrate Dependencies
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-try-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-executive]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.hex-literal]
-optional = true
-version = '0.3.3'
-
-[dependencies.serde]
-default-features = false
-features = ['derive']
-optional = true
-version = '1.0.130'
-
-[dependencies.pallet-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-authorship]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-session]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-balances]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-# Contracts specific packages
-# [dependencies.pallet-contracts]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-primitives]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-rpc-runtime-api]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-[dependencies.pallet-randomness-collective-flip]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-sudo]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-timestamp]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+scheduler = []
-[dependencies.pallet-transaction-payment-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-treasury]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-arithmetic]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-block-builder]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-inherents]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-offchain]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-session]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-transaction-pool]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-version]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.smallvec]
-version = '1.6.1'
-
################################################################################
-# Cumulus dependencies
-
-[dependencies.parachain-info]
-default-features = false
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-pallet-aura-ext]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-parachain-system]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-core]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcm]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-dmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-utility]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-timestamp]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-################################################################################
-# Polkadot dependencies
-
-[dependencies.polkadot-parachain]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-builder]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-executor]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.pallet-xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-################################################################################
-# RMRK dependencies
-
-# todo git
-[dependencies.rmrk-rpc]
-default-features = false
-path = "../../primitives/rmrk-rpc"
-
-################################################################################
# local dependencies
[dependencies]
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+hex-literal = { optional = true, version = "0.3.3" }
+orml-tokens.workspace = true
+orml-traits.workspace = true
orml-vesting.workspace = true
orml-xtokens.workspace = true
-orml-tokens.workspace = true
-orml-traits.workspace = true
+pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+rmrk-rpc = { default-features = false, path = "../../primitives/rmrk-rpc" }
+serde = { default-features = false, features = ['derive'], optional = true, version = "1.0.130" }
+smallvec = "1.6.1"
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
-log = { version = "0.4.16", default-features = false }
-up-common = { path = "../../primitives/common", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
derivative = "2.2.0"
-pallet-unique = { path = '../../pallets/unique', default-features = false }
-up-rpc = { path = "../../primitives/rpc", default-features = false }
-up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-inflation = { path = '../../pallets/inflation', default-features = false }
-pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
-up-data-structs = { path = '../../primitives/data-structs', default-features = false }
+log = { version = "0.4.16", default-features = false }
+pallet-app-promotion = { path = "../../pallets/app-promotion", default-features = false }
pallet-collator-selection = { default-features = false, path = "../../pallets/collator-selection" }
-pallet-identity = { default-features = false, path = "../../pallets/identity" }
+pallet-common = { default-features = false, path = "../../pallets/common" }
pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
-pallet-common = { default-features = false, path = "../../pallets/common" }
-pallet-structure = { default-features = false, path = "../../pallets/structure" }
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
-pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+pallet-identity = { default-features = false, path = "../../pallets/identity" }
+pallet-inflation = { path = "../../pallets/inflation", default-features = false }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
+pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
+pallet-unique = { path = "../../pallets/unique", default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+up-common = { path = "../../primitives/common", default-features = false }
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
+up-rpc = { path = "../../primitives/rpc", default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
-pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
-pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
-pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+num_enum = { version = "0.5.3", default-features = false }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
+pallet-evm-contract-helpers = { path = "../../pallets/evm-contract-helpers", default-features = false }
+pallet-evm-migration = { path = "../../pallets/evm-migration", default-features = false }
pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
+pallet-evm-transaction-payment = { path = "../../pallets/evm-transaction-payment", default-features = false }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
-precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
-num_enum = { version = "0.5.3", default-features = false }
+precompile-utils-macro.path = "../common/ethereum/precompiles/utils/macro"
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
################################################################################
# Test dependencies
@@ -533,15 +302,8 @@
impl-trait-for-tuples = "0.2.2"
-################################################################################
-# Dev Dependencies
+[dev-dependencies]
+logtest = "2.0.0"
-[dev-dependencies.logtest]
-version = "2.0.0"
-
-################################################################################
-# Build Dependencies
-
-[build-dependencies.substrate-wasm-builder]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+[build-dependencies]
+substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
runtime/tests/Cargo.tomldiffbeforeafterboth--- a/runtime/tests/Cargo.toml
+++ b/runtime/tests/Cargo.toml
@@ -1,7 +1,7 @@
[package]
+edition = "2021"
name = "tests"
version = "0.1.1"
-edition = "2021"
[features]
default = ['refungible']
@@ -9,12 +9,12 @@
refungible = []
[dependencies]
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
+up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
@@ -22,25 +22,23 @@
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-common = { path = '../../pallets/common' }
-pallet-structure = { path = '../../pallets/structure' }
-pallet-fungible = { path = '../../pallets/fungible' }
-pallet-nonfungible = { path = '../../pallets/nonfungible' }
-pallet-refungible = { path = '../../pallets/refungible' }
-pallet-unique = { path = '../../pallets/unique' }
+pallet-common.path = "../../pallets/common"
+pallet-fungible.path = "../../pallets/fungible"
+pallet-nonfungible.path = "../../pallets/nonfungible"
+pallet-refungible.path = "../../pallets/refungible"
+pallet-structure.path = "../../pallets/structure"
+pallet-unique.path = "../../pallets/unique"
-pallet-evm-coder-substrate = { path = '../../pallets/evm-coder-substrate' }
+pallet-evm-coder-substrate.path = "../../pallets/evm-coder-substrate"
-parity-scale-codec = { version = "3.1.2", default-features = false, features = [
- "derive",
-] }
+parity-scale-codec = { version = "3.2.2", default-features = false, features = ["derive"] }
scale-info = "*"
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -17,503 +17,277 @@
[features]
default = ['std', 'unique-runtime']
+limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
+pov-estimate = []
runtime-benchmarks = [
- 'hex-literal',
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system-benchmarking',
- 'frame-system/runtime-benchmarks',
- 'pallet-ethereum/runtime-benchmarks',
- 'pallet-evm-migration/runtime-benchmarks',
- 'pallet-evm-coder-substrate/runtime-benchmarks',
- 'pallet-balances/runtime-benchmarks',
- 'pallet-timestamp/runtime-benchmarks',
- 'pallet-configuration/runtime-benchmarks',
- 'pallet-common/runtime-benchmarks',
- 'pallet-structure/runtime-benchmarks',
- 'pallet-fungible/runtime-benchmarks',
- 'pallet-refungible/runtime-benchmarks',
- 'pallet-nonfungible/runtime-benchmarks',
- 'pallet-proxy-rmrk-core/runtime-benchmarks',
- 'pallet-proxy-rmrk-equip/runtime-benchmarks',
- 'pallet-unique/runtime-benchmarks',
- 'pallet-foreign-assets/runtime-benchmarks',
- 'pallet-inflation/runtime-benchmarks',
- 'pallet-collator-selection/runtime-benchmarks',
- 'pallet-identity/runtime-benchmarks',
- 'pallet-app-promotion/runtime-benchmarks',
- 'pallet-xcm/runtime-benchmarks',
- 'sp-runtime/runtime-benchmarks',
- 'xcm-builder/runtime-benchmarks',
- 'up-data-structs/runtime-benchmarks',
- 'pallet-maintenance/runtime-benchmarks',
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system-benchmarking',
+ 'frame-system/runtime-benchmarks',
+ 'hex-literal',
+ 'pallet-app-promotion/runtime-benchmarks',
+ 'pallet-balances/runtime-benchmarks',
+ 'pallet-collator-selection/runtime-benchmarks',
+ 'pallet-common/runtime-benchmarks',
+ 'pallet-configuration/runtime-benchmarks',
+ 'pallet-ethereum/runtime-benchmarks',
+ 'pallet-evm-coder-substrate/runtime-benchmarks',
+ 'pallet-evm-migration/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
+ 'pallet-fungible/runtime-benchmarks',
+ 'pallet-identity/runtime-benchmarks',
+ 'pallet-inflation/runtime-benchmarks',
+ 'pallet-maintenance/runtime-benchmarks',
+ 'pallet-nonfungible/runtime-benchmarks',
+ 'pallet-proxy-rmrk-core/runtime-benchmarks',
+ 'pallet-proxy-rmrk-equip/runtime-benchmarks',
+ 'pallet-refungible/runtime-benchmarks',
+ 'pallet-structure/runtime-benchmarks',
+ 'pallet-timestamp/runtime-benchmarks',
+ 'pallet-unique/runtime-benchmarks',
+ 'pallet-xcm/runtime-benchmarks',
+ 'sp-runtime/runtime-benchmarks',
+ 'up-data-structs/runtime-benchmarks',
+ 'xcm-builder/runtime-benchmarks',
+]
+std = [
+ 'codec/std',
+ 'cumulus-pallet-aura-ext/std',
+ 'cumulus-pallet-parachain-system/std',
+ 'cumulus-pallet-xcm/std',
+ 'cumulus-pallet-xcmp-queue/std',
+ 'cumulus-primitives-core/std',
+ 'cumulus-primitives-utility/std',
+ 'frame-executive/std',
+ 'frame-support/std',
+ 'frame-system-rpc-runtime-api/std',
+ 'frame-system/std',
+ 'frame-try-runtime/std',
+ 'pallet-aura/std',
+ 'pallet-balances/std',
+ # 'pallet-contracts/std',
+ # 'pallet-contracts-primitives/std',
+ # 'pallet-contracts-rpc-runtime-api/std',
+ # 'pallet-contract-helpers/std',
+ "pallet-authorship/std",
+ "pallet-identity/std",
+ "pallet-session/std",
+ "sp-consensus-aura/std",
+ 'app-promotion-rpc/std',
+ 'evm-coder/std',
+ 'fp-evm-mapping/std',
+ 'fp-rpc/std',
+ 'fp-self-contained/std',
+ 'pallet-app-promotion/std',
+ 'pallet-base-fee/std',
+ 'pallet-charge-transaction/std',
+ 'pallet-collator-selection/std',
+ 'pallet-common/std',
+ 'pallet-configuration/std',
+ 'pallet-ethereum/std',
+ 'pallet-evm-coder-substrate/std',
+ 'pallet-evm-contract-helpers/std',
+ 'pallet-evm-migration/std',
+ 'pallet-evm-transaction-payment/std',
+ 'pallet-evm/std',
+ 'pallet-fungible/std',
+ 'pallet-inflation/std',
+ 'pallet-nonfungible/std',
+ 'pallet-proxy-rmrk-core/std',
+ 'pallet-proxy-rmrk-equip/std',
+ 'pallet-randomness-collective-flip/std',
+ 'pallet-refungible/std',
+ 'pallet-structure/std',
+ 'pallet-sudo/std',
+ 'pallet-timestamp/std',
+ 'pallet-transaction-payment-rpc-runtime-api/std',
+ 'pallet-transaction-payment/std',
+ 'pallet-treasury/std',
+ 'pallet-unique/std',
+ 'parachain-info/std',
+ 'rmrk-rpc/std',
+ 'sp-api/std',
+ 'sp-block-builder/std',
+ 'sp-core/std',
+ 'sp-inherents/std',
+ 'sp-io/std',
+ 'sp-offchain/std',
+ 'sp-runtime/std',
+ 'sp-session/std',
+ 'sp-std/std',
+ 'sp-transaction-pool/std',
+ 'sp-version/std',
+ 'up-common/std',
+ 'up-data-structs/std',
+ 'up-pov-estimate-rpc/std',
+ 'up-rpc/std',
+ 'up-sponsorship/std',
+ 'xcm-builder/std',
+ 'xcm-executor/std',
+ 'xcm/std',
+
+ "orml-tokens/std",
+ "orml-traits/std",
+ "orml-vesting/std",
+ "orml-xtokens/std",
+ "pallet-foreign-assets/std",
+ "pallet-maintenance/std",
]
+stubgen = ["evm-coder/stubgen"]
try-runtime = [
- 'frame-try-runtime',
- 'frame-executive/try-runtime',
- 'frame-support/try-runtime',
- 'frame-system/try-runtime',
- 'cumulus-pallet-parachain-system/try-runtime',
- 'parachain-info/try-runtime',
- 'pallet-aura/try-runtime',
- 'cumulus-pallet-aura-ext/try-runtime',
- 'pallet-balances/try-runtime',
- 'pallet-randomness-collective-flip/try-runtime',
- 'pallet-timestamp/try-runtime',
- 'pallet-transaction-payment/try-runtime',
- 'pallet-treasury/try-runtime',
- 'pallet-sudo/try-runtime',
- 'orml-vesting/try-runtime',
- 'orml-xtokens/try-runtime',
- 'orml-tokens/try-runtime',
- 'cumulus-pallet-xcmp-queue/try-runtime',
- 'pallet-xcm/try-runtime',
- 'cumulus-pallet-xcm/try-runtime',
- 'cumulus-pallet-dmp-queue/try-runtime',
"pallet-authorship/try-runtime",
"pallet-collator-selection/try-runtime",
+ "pallet-identity/try-runtime",
"pallet-session/try-runtime",
- "pallet-identity/try-runtime",
- 'pallet-inflation/try-runtime',
- 'pallet-unique/try-runtime',
- 'pallet-configuration/try-runtime',
- 'pallet-charge-transaction/try-runtime',
- 'pallet-common/try-runtime',
- 'pallet-fungible/try-runtime',
- 'pallet-refungible/try-runtime',
- 'pallet-nonfungible/try-runtime',
- 'pallet-structure/try-runtime',
- 'pallet-proxy-rmrk-core/try-runtime',
- 'pallet-proxy-rmrk-equip/try-runtime',
- 'pallet-app-promotion/try-runtime',
- 'pallet-foreign-assets/try-runtime',
- 'pallet-ethereum/try-runtime',
- 'pallet-evm/try-runtime',
- 'pallet-evm-coder-substrate/try-runtime',
- 'pallet-evm-contract-helpers/try-runtime',
- 'pallet-evm-transaction-payment/try-runtime',
- 'pallet-evm-migration/try-runtime',
- 'pallet-maintenance/try-runtime',
- 'fp-self-contained/try-runtime',
-]
-std = [
- 'codec/std',
- 'cumulus-pallet-aura-ext/std',
- 'cumulus-pallet-parachain-system/std',
- 'cumulus-pallet-xcm/std',
- 'cumulus-pallet-xcmp-queue/std',
- 'cumulus-primitives-core/std',
- 'cumulus-primitives-utility/std',
- 'frame-try-runtime/std',
- 'frame-executive/std',
- 'frame-support/std',
- 'frame-system/std',
- 'frame-system-rpc-runtime-api/std',
- 'pallet-aura/std',
- 'pallet-balances/std',
- # 'pallet-contracts/std',
- # 'pallet-contracts-primitives/std',
- # 'pallet-contracts-rpc-runtime-api/std',
- # 'pallet-contract-helpers/std',
- "pallet-authorship/std",
- 'pallet-collator-selection/std',
- "pallet-session/std",
- "pallet-identity/std",
- 'pallet-randomness-collective-flip/std',
- 'pallet-sudo/std',
- 'pallet-timestamp/std',
- 'pallet-transaction-payment/std',
- 'pallet-transaction-payment-rpc-runtime-api/std',
- 'pallet-treasury/std',
- 'pallet-evm/std',
- 'pallet-evm-migration/std',
- 'pallet-evm-contract-helpers/std',
- 'pallet-evm-transaction-payment/std',
- 'pallet-evm-coder-substrate/std',
- 'pallet-ethereum/std',
- 'pallet-base-fee/std',
- 'fp-rpc/std',
- 'up-rpc/std',
- 'up-pov-estimate-rpc/std',
- 'app-promotion-rpc/std',
- 'fp-evm-mapping/std',
- 'fp-self-contained/std',
- 'parachain-info/std',
- 'serde',
- 'pallet-inflation/std',
- 'pallet-configuration/std',
- 'pallet-app-promotion/std',
- 'pallet-common/std',
- 'pallet-structure/std',
- 'pallet-fungible/std',
- 'pallet-refungible/std',
- 'pallet-nonfungible/std',
- 'pallet-proxy-rmrk-core/std',
- 'pallet-proxy-rmrk-equip/std',
- 'pallet-unique/std',
- 'pallet-charge-transaction/std',
- 'up-data-structs/std',
- 'sp-api/std',
- 'sp-block-builder/std',
- "sp-consensus-aura/std",
- 'sp-core/std',
- 'sp-inherents/std',
- 'sp-io/std',
- 'sp-offchain/std',
- 'sp-runtime/std',
- 'sp-session/std',
- 'sp-std/std',
- 'sp-transaction-pool/std',
- 'sp-version/std',
- 'xcm/std',
- 'xcm-builder/std',
- 'xcm-executor/std',
- 'up-common/std',
- 'rmrk-rpc/std',
- 'evm-coder/std',
- 'up-sponsorship/std',
-
- "orml-vesting/std",
- "orml-tokens/std",
- "orml-xtokens/std",
- "orml-traits/std",
- "pallet-foreign-assets/std",
- "pallet-maintenance/std",
+ 'cumulus-pallet-aura-ext/try-runtime',
+ 'cumulus-pallet-dmp-queue/try-runtime',
+ 'cumulus-pallet-parachain-system/try-runtime',
+ 'cumulus-pallet-xcm/try-runtime',
+ 'cumulus-pallet-xcmp-queue/try-runtime',
+ 'fp-self-contained/try-runtime',
+ 'frame-executive/try-runtime',
+ 'frame-support/try-runtime',
+ 'frame-system/try-runtime',
+ 'frame-try-runtime',
+ 'orml-tokens/try-runtime',
+ 'orml-vesting/try-runtime',
+ 'orml-xtokens/try-runtime',
+ 'pallet-app-promotion/try-runtime',
+ 'pallet-aura/try-runtime',
+ 'pallet-balances/try-runtime',
+ 'pallet-charge-transaction/try-runtime',
+ 'pallet-common/try-runtime',
+ 'pallet-configuration/try-runtime',
+ 'pallet-ethereum/try-runtime',
+ 'pallet-evm-coder-substrate/try-runtime',
+ 'pallet-evm-contract-helpers/try-runtime',
+ 'pallet-evm-migration/try-runtime',
+ 'pallet-evm-transaction-payment/try-runtime',
+ 'pallet-evm/try-runtime',
+ 'pallet-foreign-assets/try-runtime',
+ 'pallet-fungible/try-runtime',
+ 'pallet-inflation/try-runtime',
+ 'pallet-maintenance/try-runtime',
+ 'pallet-nonfungible/try-runtime',
+ 'pallet-proxy-rmrk-core/try-runtime',
+ 'pallet-proxy-rmrk-equip/try-runtime',
+ 'pallet-randomness-collective-flip/try-runtime',
+ 'pallet-refungible/try-runtime',
+ 'pallet-structure/try-runtime',
+ 'pallet-sudo/try-runtime',
+ 'pallet-timestamp/try-runtime',
+ 'pallet-transaction-payment/try-runtime',
+ 'pallet-treasury/try-runtime',
+ 'pallet-unique/try-runtime',
+ 'pallet-xcm/try-runtime',
+ 'parachain-info/try-runtime',
]
-limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
unique-runtime = ['foreign-assets']
-pov-estimate = []
-stubgen = ["evm-coder/stubgen"]
+collator-selection = []
+foreign-assets = []
refungible = []
-scheduler = []
rmrk = []
-foreign-assets = []
-collator-selection = []
-
-################################################################################
-# Substrate Dependencies
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies.frame-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-try-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-executive]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-support]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-benchmarking]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-optional = true
-branch = "polkadot-v0.9.36"
-
-[dependencies.frame-system-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.hex-literal]
-optional = true
-version = '0.3.3'
-
-[dependencies.serde]
-default-features = false
-features = ['derive']
-optional = true
-version = '1.0.130'
-
-[dependencies.pallet-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-authorship]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-session]
-default-features = false
-git = 'https://github.com/paritytech/substrate'
-branch = 'polkadot-v0.9.36'
-
-[dependencies.pallet-balances]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-# Contracts specific packages
-# [dependencies.pallet-contracts]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-primitives]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-# [dependencies.pallet-contracts-rpc-runtime-api]
-# git = 'https://github.com/paritytech/substrate'
-# default-features = false
-# branch = 'master'
-# version = '4.0.0-dev'
-
-[dependencies.pallet-randomness-collective-flip]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-sudo]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-timestamp]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-transaction-payment-rpc-runtime-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.pallet-treasury]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-arithmetic]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-api]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-block-builder]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-core]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-consensus-aura]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-inherents]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-io]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-offchain]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-runtime]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-session]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-std]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-transaction-pool]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.sp-version]
-default-features = false
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
-
-[dependencies.smallvec]
-version = '1.6.1'
-
-################################################################################
-# Cumulus dependencies
-
-[dependencies.parachain-info]
-default-features = false
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-
-[dependencies.cumulus-pallet-aura-ext]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-parachain-system]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-core]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcm]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-dmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-pallet-xcmp-queue]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-utility]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-[dependencies.cumulus-primitives-timestamp]
-git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.36"
-default-features = false
-
-################################################################################
-# Polkadot dependencies
-
-[dependencies.polkadot-parachain]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-builder]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.xcm-executor]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
-
-[dependencies.pallet-xcm]
-git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.36"
-default-features = false
+scheduler = []
################################################################################
# local dependencies
[dependencies]
-orml-vesting.workspace = true
-orml-xtokens.workspace = true
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.1.2" }
+cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false }
+frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.36" }
+hex-literal = { optional = true, version = "0.3.3" }
orml-tokens.workspace = true
orml-traits.workspace = true
+orml-vesting.workspace = true
+orml-xtokens.workspace = true
+pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
+polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+smallvec = "1.6.1"
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
-log = { version = "0.4.16", default-features = false }
-up-common = { path = "../../primitives/common", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-derivative = "2.2.0"
-pallet-unique = { path = '../../pallets/unique', default-features = false }
-up-rpc = { path = "../../primitives/rpc", default-features = false }
-up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
-rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
-pallet-inflation = { path = '../../pallets/inflation', default-features = false }
-pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
-up-data-structs = { path = '../../primitives/data-structs', default-features = false }
+derivative = "2.2.0"
+log = { version = "0.4.16", default-features = false }
+pallet-app-promotion = { path = "../../pallets/app-promotion", default-features = false }
pallet-collator-selection = { default-features = false, path = "../../pallets/collator-selection" }
-pallet-identity = { default-features = false, path = "../../pallets/identity" }
-pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
-pallet-structure = { default-features = false, path = "../../pallets/structure" }
+pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
-pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+pallet-identity = { default-features = false, path = "../../pallets/identity" }
+pallet-inflation = { path = "../../pallets/inflation", default-features = false }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
+pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
+pallet-unique = { path = "../../pallets/unique", default-features = false }
+rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+up-common = { path = "../../primitives/common", default-features = false }
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
+up-rpc = { path = "../../primitives/rpc", default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
+evm-coder = { default-features = false, path = "../../crates/evm-coder" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+num_enum = { version = "0.5.3", default-features = false }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
-pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
-pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-contract-helpers = { path = "../../pallets/evm-contract-helpers", default-features = false }
+pallet-evm-migration = { path = "../../pallets/evm-migration", default-features = false }
pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
+pallet-evm-transaction-payment = { path = "../../pallets/evm-transaction-payment", default-features = false }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
-precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
-num_enum = { version = "0.5.3", default-features = false }
+precompile-utils-macro.path = "../common/ethereum/precompiles/utils/macro"
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
################################################################################
# Test dependencies
@@ -525,15 +299,8 @@
impl-trait-for-tuples = "0.2.2"
-################################################################################
-# Dev Dependencies
+[dev-dependencies]
+logtest = "2.0.0"
-[dev-dependencies.logtest]
-version = "2.0.0"
-
-################################################################################
-# Build Dependencies
-
-[build-dependencies.substrate-wasm-builder]
-git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.36"
+[build-dependencies]
+substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
smart_contracs/transfer/.gitignorediffbeforeafterboth--- a/smart_contracs/transfer/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ignore build artifacts from the local tests sub-crate.
-/target/
-
-# Ignore backup files creates by cargo fmt.
-**/*.rs.bk
-
-# Remove Cargo.lock when creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
smart_contracs/transfer/Cargo.tomldiffbeforeafterboth--- a/smart_contracs/transfer/Cargo.toml
+++ /dev/null
@@ -1,38 +0,0 @@
-[package]
-name = "nft_transfer"
-version = "0.1.0"
-authors = ["[Greg Zaitsev] <[your_email]>"]
-edition = "2021"
-
-[workspace]
-
-[dependencies]
-ink_primitives = { default-features = false }
-ink_metadata = { default-features = false, features = ["derive"], optional = true }
-ink_env = { default-features = false }
-ink_storage = { default-features = false }
-ink_lang = { default-features = false }
-
-scale = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] }
-scale-info = { version = "0.6.0", default-features = false, features = ["derive"] }
-
-[lib]
-name = "nft_transfer"
-path = "lib.rs"
-crate-type = [
- # Used for normal contract Wasm blobs.
- "cdylib",
-]
-
-[features]
-default = ["std"]
-std = [
- "ink_metadata/std",
- "ink_env/std",
- "ink_storage/std",
- "ink_lang/std",
- "ink_primitives/std",
- "scale/std",
- "scale-info/std",
-]
-ink-as-dependency = []
smart_contracs/transfer/lib.rsdiffbeforeafterboth--- a/smart_contracs/transfer/lib.rs
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-extern crate alloc;
-use alloc::vec::Vec;
-
-use ink_lang as ink;
-use ink_env::{Environment, DefaultEnvironment};
-
-pub enum NftEnvironment {}
-
-impl Environment for NftEnvironment {
- const MAX_EVENT_TOPICS: usize =
- <DefaultEnvironment as Environment>::MAX_EVENT_TOPICS;
-
- type AccountId = <DefaultEnvironment as Environment>::AccountId;
- type Balance = <DefaultEnvironment as Environment>::Balance;
- type Hash = <DefaultEnvironment as Environment>::Hash;
- type BlockNumber = <DefaultEnvironment as Environment>::BlockNumber;
- type Timestamp = <DefaultEnvironment as Environment>::Timestamp;
-
- type ChainExtension = NftChainExtension;
-}
-
-/// The shared error code for the NFT chain extension.
-#[derive(
- Debug, Copy, Clone, PartialEq, Eq, scale::Encode, scale::Decode,
-)]
-pub enum NftErrorCode {
- SomeError,
-}
-
-impl ink_env::chain_extension::FromStatusCode for NftErrorCode {
- fn from_status_code(status_code: u32) -> Result<(), Self> {
- match status_code {
- 0 => Ok(()),
- 1 => Err(Self::SomeError),
- _ => panic!("encountered unknown status code"),
- }
- }
-}
-
-#[derive(scale::Encode, scale::Decode, scale_info::TypeInfo)]
-pub enum CreateItemData {
- Nft {
- const_data: Vec<u8>,
- },
- Fungible {
- value: u128,
- },
- ReFungible {
- const_data: Vec<u8>,
- pieces: u128,
- },
-}
-
-type DefaultAccountId = <DefaultEnvironment as Environment>::AccountId;
-
-#[ink::chain_extension]
-pub trait NftChainExtension {
- type ErrorCode = NftErrorCode;
-
- /// Transfer one NFT token from sender
- ///
- #[ink(extension = 0, returns_result = false)]
- fn transfer(recipient: DefaultAccountId, collection_id: u32, token_id: u32, amount: u128);
- #[ink(extension = 1, returns_result = false)]
- fn create_item(owner: DefaultAccountId, collection_id: u32, data: CreateItemData);
- #[ink(extension = 2, returns_result = false)]
- fn create_multiple_items(owner: DefaultAccountId, collection_id: u32, data: Vec<CreateItemData>);
- #[ink(extension = 3, returns_result = false)]
- fn approve(spender: DefaultAccountId, collection_id: u32, item_id: u32, amount: u128);
- #[ink(extension = 4, returns_result = false)]
- fn transfer_from(owner: DefaultAccountId, recipient: DefaultAccountId, collection_id: u32, item_id: u32, amount: u128);
- #[ink(extension = 6, returns_result = false)]
- fn toggle_allow_list(collection_id: u32, address: DefaultAccountId, allowlisted: bool);
-}
-
-#[ink::contract(env = crate::NftEnvironment, dynamic_storage_allocator = true)]
-mod nft_transfer {
- use alloc::vec::Vec;
- // use ink_storage::Vec;
- use crate::CreateItemData;
-
- #[ink(storage)]
- pub struct NftTransfer {
- }
-
- impl NftTransfer {
- /// Default Constructor
- ///
- /// Constructors can delegate to other constructors.
- #[ink(constructor)]
- pub fn default() -> Self {
- Self {}
- }
-
- /// Transfer one NFT token
- #[ink(message)]
- pub fn transfer(&mut self, recipient: AccountId, collection_id: u32, token_id: u32, amount: u128) {
- let _ = self.env()
- .extension()
- .transfer(recipient, collection_id, token_id, amount);
- }
- #[ink(message)]
- pub fn create_item(&mut self, recipient: AccountId, collection_id: u32, data: CreateItemData) {
- let _ = self.env()
- .extension()
- .create_item(recipient, collection_id, data);
- }
- #[ink(message)]
- pub fn create_multiple_items(&mut self, owner: AccountId, collection_id: u32, data: Vec<CreateItemData>) {
- let _ = self.env()
- .extension()
- .create_multiple_items(owner, collection_id, data);
- }
- #[ink(message)]
- pub fn approve(&mut self, spender: AccountId, collection_id: u32, item_id: u32, amount: u128) {
- let _ = self.env()
- .extension()
- .approve(spender, collection_id, item_id, amount);
- }
- #[ink(message)]
- pub fn transfer_from(&mut self, owner: AccountId, recipient: AccountId, collection_id: u32, item_id: u32, amount: u128) {
- let _ = self.env()
- .extension()
- .transfer_from(owner, recipient, collection_id, item_id, amount);
- }
- #[ink(message)]
- pub fn toggle_allow_list(&mut self, collection_id: u32, address: AccountId, allowlisted: bool) {
- let _ = self.env()
- .extension()
- .toggle_allow_list(collection_id, address, allowlisted);
- }
-
- }
-
-}
test-pallets/utils/Cargo.tomldiffbeforeafterboth--- a/test-pallets/utils/Cargo.toml
+++ b/test-pallets/utils/Cargo.toml
@@ -1,34 +1,27 @@
[package]
+edition = "2021"
+license = "GPLv3"
name = "pallet-test-utils"
+publish = false
version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
-publish = false
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
- "derive",
-] }
-scale-info = { version = "2.1.1", default-features = false, features = [
- "derive",
-] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
# pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
-pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }
+pallet-unique-scheduler-v2 = { path = "../../pallets/scheduler-v2", default-features = false }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
std = [
"codec/std",
- "scale-info/std",
"frame-support/std",
"frame-system/std",
"pallet-unique-scheduler-v2/std",
+ "scale-info/std",
"sp-std/std",
]
-try-runtime = [
- "frame-support/try-runtime",
- "pallet-unique-scheduler-v2/try-runtime",
-]
+try-runtime = ["frame-support/try-runtime", "pallet-unique-scheduler-v2/try-runtime"]
tests/flipper-src/.gitignorediffbeforeafterboth--- a/tests/flipper-src/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ignore build artifacts from the local tests sub-crate.
-/target/
-
-# Ignore backup files creates by cargo fmt.
-**/*.rs.bk
-
-# Remove Cargo.lock when creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
\ No newline at end of file
tests/flipper-src/Cargo.tomldiffbeforeafterboth--- a/tests/flipper-src/Cargo.toml
+++ /dev/null
@@ -1,35 +0,0 @@
-[package]
-name = "flipper"
-version = "3.0.0-rc1"
-authors = ["Parity Technologies <admin@parity.io>"]
-edition = "2021"
-
-[dependencies]
-ink_primitives = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
-ink_metadata = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false, features = ["derive"], optional = true }
-ink_env = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
-ink_storage = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
-ink_lang = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
-
-scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
-scale-info = { version = "0.4", default-features = false, features = ["derive"], optional = true }
-
-[lib]
-name = "flipper"
-path = "lib.rs"
-crate-type = ["cdylib"]
-
-[features]
-default = ["std"]
-std = [
- "ink_primitives/std",
- "ink_metadata",
- "ink_metadata/std",
- "ink_env/std",
- "ink_storage/std",
- "ink_lang/std",
- "scale/std",
- "scale-info",
- "scale-info/std",
-]
-ink-as-dependency = []
tests/flipper-src/build.shdiffbeforeafterboth--- a/tests/flipper-src/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-rustup component add rust-src --toolchain nightly
-cargo +nightly contract build
-cargo +nightly contract generate-metadata
tests/flipper-src/lib.rsdiffbeforeafterboth--- a/tests/flipper-src/lib.rs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original License
-// Copyright 2018-2020 Parity Technologies (UK) Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use ink_lang as ink;
-
-#[ink::contract]
-pub mod flipper {
- #[ink(storage)]
- pub struct Flipper {
- value: bool,
- }
-
- impl Flipper {
- /// Creates a new flipper smart contract initialized with the given value.
- #[ink(constructor)]
- pub fn new(init_value: bool) -> Self {
- Self { value: init_value }
- }
-
- /// Creates a new flipper smart contract initialized to `false`.
- #[ink(constructor)]
- pub fn default() -> Self {
- Self::new(Default::default())
- }
-
- /// Flips the current value of the Flipper's bool.
- #[ink(message)]
- pub fn flip(&mut self) {
- self.value = !self.value;
- }
-
- /// Returns the current value of the Flipper's bool.
- #[ink(message)]
- pub fn get(&self) -> bool {
- self.value
- }
- }
-
- #[cfg(test)]
- mod tests {
- use super::*;
-
- #[test]
- fn default_works() {
- let flipper = Flipper::default();
- assert_eq!(flipper.get(), false);
- }
-
- #[test]
- fn it_works() {
- let mut flipper = Flipper::new(false);
- assert_eq!(flipper.get(), false);
- flipper.flip();
- assert_eq!(flipper.get(), true);
- }
- }
-}
\ No newline at end of file
tests/ink-types-node-runtime/.gitignorediffbeforeafterboth--- a/tests/ink-types-node-runtime/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-# Ignore build artifacts
-/target/
-/examples/**/target/
-
-# Ignore backup files creates by cargo fmt.
-**/*.rs.bk
-
-# Remove Cargo.lock when creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
-
-# Ignore VS Code artifacts.
-**/.vscode/**
-
-# Ignore history files.
-**/.history/**
\ No newline at end of file
tests/ink-types-node-runtime/Cargo.tomldiffbeforeafterboth--- a/tests/ink-types-node-runtime/Cargo.toml
+++ /dev/null
@@ -1,54 +0,0 @@
-[package]
-name = "ink_types_node_runtime"
-version = "0.1.0"
-authors = ["Parity Technologies <admin@parity.io>"]
-edition = "2021"
-
-license = "GPL-3.0"
-readme = "README.md"
-
-repository = "https://github.com/paritytech/ink"
-documentation = "https://github.com/paritytech/ink/wiki"
-homepage = "https://www.parity.io/"
-
-description = "[ink!] Rust based eDSL for writing smart contracts for Substrate"
-keywords = ["wasm", "parity", "webassembly", "blockchain", "edsl"]
-categories = ["no-std", "embedded"]
-
-include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
-
-[dependencies]
-ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }
-frame-system = { git = "https://github.com/paritytech/substrate/", package = "frame-system", default-features = false }
-pallet-indices = { git = "https://github.com/paritytech/substrate/", package = "pallet-indices", default-features = false }
-sp-core = { git = "https://github.com/paritytech/substrate/", package = "sp-core", default-features = false }
-sp-io = { git = "https://github.com/paritytech/substrate/", package = "sp-io", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
-sp-runtime = { git = "https://github.com/paritytech/substrate/", package = "sp-runtime", default-features = false }
-scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
-
-[dependencies.type-metadata]
-git = "https://github.com/type-metadata/type-metadata.git"
-rev = "02eae9f35c40c943b56af5b60616219f2b72b47d"
-default-features = false
-features = ["derive"]
-optional = true
-
-
-[dev-dependencies]
-node-runtime = { git = "https://github.com/paritytech/substrate/", package = "node-runtime", features = ["std"] }
-
-[features]
-default = ["std"]
-std = [
- "ink_core/std",
- "frame-system/std",
- "pallet-indices/std",
- "sp-core/std",
- "sp-io/std",
- "sp-runtime/std",
-]
-ink-generate-abi = [
- "std",
- "type-metadata",
- "ink_core/ink-generate-abi",
-]
tests/ink-types-node-runtime/README.mddiffbeforeafterboth--- a/tests/ink-types-node-runtime/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Node runtime types for `ink!`
-
-Defines types for [ink!](https://github.com/paritytech/ink) smart contracts targeting [Substrate's `node-runtime`](https://github.com/paritytech/substrate/blob/master/bin/node/runtime/src/lib.rs).
-
-Supplies an implementation of the [ink! `EnvTypes` trait](https://github.com/paritytech/ink/blob/master/core/src/env/types.rs#L128).
-
-See `ink!` [examples](./examples) for usage.
-
-## Requirements
-```
-rustup component add rust-src --toolchain nightly
-rustup target add wasm32-unknown-unknown --toolchain nightly
-rustup target add wasm32-unknown-unknown --toolchain stable
-cargo install cargo-contract --vers 0.6.1 --force
-```
-
-## Build
-
-### Runtime Dependencies
-```
-cargo +nightly build --release
-```
-
-### ink! Smart Contract
-```
-cargo +nightly contract build
-cargo +nightly contract generate-metadata
-```
-
-## Test
-```
-cargo +nightly test
-```
\ No newline at end of file
tests/ink-types-node-runtime/examples/calls/.gitignorediffbeforeafterboth--- a/tests/ink-types-node-runtime/examples/calls/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ignore build artifacts from the local tests sub-crate.
-/target/
-
-# Ignore backup files creates by cargo fmt.
-**/*.rs.bk
-
-# Remove Cargo.lock when creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
\ No newline at end of file
tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/Cargo.tomldiffbeforeafterboth--- a/tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/Cargo.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-[package]
-name = "abi-gen"
-version = "0.1.0"
-authors = ["Parity Technologies <admin@parity.io>"]
-edition = "2021"
-publish = false
-
-[[bin]]
-name = "abi-gen"
-path = "main.rs"
-
-[dependencies]
-contract = { path = "../..", package = "calls", default-features = false, features = ["ink-generate-abi"] }
-ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false, features = ["ink-generate-abi"] }
-serde = "1.0.101"
-serde_json = "1.0.55"
tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/main.rsdiffbeforeafterboth--- a/tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/main.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-fn main() -> Result<(), std::io::Error> {
- let abi = <contract::Calls as ink_lang::GenerateAbi>::generate_abi();
- let contents = serde_json::to_string_pretty(&abi)?;
- std::fs::create_dir("target").ok();
- std::fs::write("target/metadata.json", contents)?;
- Ok(())
-}
tests/ink-types-node-runtime/examples/calls/Cargo.tomldiffbeforeafterboth--- a/tests/ink-types-node-runtime/examples/calls/Cargo.toml
+++ /dev/null
@@ -1,73 +0,0 @@
-[package]
-name = "calls"
-version = "0.1.0"
-authors = ["Parity Technologies <admin@parity.io>"]
-edition = "2021"
-
-[dependencies]
-ink_abi = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_abi", default-features = false, features = ["derive"], optional = true }
-ink_primitives = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_primitives", default-features = false }
-ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }
-ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false }
-ink_prelude = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_prelude", default-features = false }
-
-scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
-sp-keyring = { git = "https://github.com/paritytech/substrate/", package = "sp-keyring", optional = true }
-ink_types_node_runtime = { path = "../../", default-features = false }
-
-[dependencies.type-metadata]
-git = "https://github.com/type-metadata/type-metadata.git"
-rev = "02eae9f35c40c943b56af5b60616219f2b72b47d"
-default-features = false
-features = ["derive"]
-optional = true
-
-[lib]
-name = "calls"
-path = "lib.rs"
-crate-type = [
- # Used for normal contract Wasm blobs.
- "cdylib",
- # Used for ABI generation.
- "rlib",
-]
-
-[features]
-default = ["test-env"]
-std = [
- "ink_abi/std",
- "ink_core/std",
- "ink_primitives/std",
- "scale/std",
- "type-metadata/std",
- "ink_types_node_runtime/std",
- "sp-keyring",
-]
-test-env = [
- "std",
- "ink_lang/test-env",
-]
-ink-generate-abi = [
- "std",
- "ink_abi",
- "type-metadata",
- "ink_core/ink-generate-abi",
- "ink_lang/ink-generate-abi",
- "ink_types_node_runtime/ink-generate-abi",
-]
-ink-as-dependency = []
-
-[profile.release]
-panic = "abort"
-lto = true
-opt-level = "z"
-overflow-checks = true
-codegen-units = 1
-
-[workspace]
-members = [
- ".ink/abi_gen"
-]
-exclude = [
- ".ink"
-]
tests/ink-types-node-runtime/examples/calls/lib.rsdiffbeforeafterboth--- a/tests/ink-types-node-runtime/examples/calls/lib.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use ink_lang as ink;
-
-#[ink::contract(version = "0.1.0", env = NodeRuntimeTypes)]
-mod calls {
- use ink_core::env;
- use ink_prelude::*;
- use ink_types_node_runtime::{calls as runtime_calls, NodeRuntimeTypes};
-
- /// This simple dummy contract dispatches substrate runtime calls
- #[ink(storage)]
- struct Calls {}
-
- impl Calls {
- #[ink(constructor)]
- fn new(&mut self) {}
-
- /// Dispatches a `transfer` call to the Balances srml module
- #[ink(message)]
- fn balance_transfer(&self, dest: AccountId, value: Balance) {
- // create the Balances::transfer Call
- let transfer_call = runtime_calls::transfer_balance(dest, value);
-
- // dispatch the call to the runtime
- let result = self.env().invoke_runtime(&transfer_call);
-
- // report result to console
- // NOTE: println should only be used on a development chain)
- env::println(&format!("Balance transfer invoke_runtime result {:?}", result));
- }
- }
-
- #[cfg(test)]
- mod tests {
- use super::*;
- use sp_keyring::AccountKeyring;
-
- #[test]
- fn dispatches_balances_call() {
- let calls = Calls::new();
- let alice = AccountId::from(AccountKeyring::Alice.to_account_id());
- // assert_eq!(calls.env().dispatched_calls().into_iter().count(), 0);
- calls.balance_transfer(alice, 10000);
- // assert_eq!(calls.env().dispatched_calls().into_iter().count(), 1);
- }
- }
-}
tests/ink-types-node-runtime/src/calls.rsdiffbeforeafterboth--- a/tests/ink-types-node-runtime/src/calls.rs
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original License
-// Copyright 2019 Parity Technologies (UK) Ltd.
-// This file is part of ink!.
-//
-// ink! is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// ink! is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with ink!. If not, see <http://www.gnu.org/licenses/>.
-
-use ink_core::env::EnvTypes;
-use scale::{Codec, Decode, Encode};
-use pallet_indices::address::Address;
-use sp_runtime::traits::Member;
-use crate::{AccountId, AccountIndex, Balance, NodeRuntimeTypes};
-
-/// Default runtime Call type, a subset of the runtime Call module variants
-///
-/// The codec indices of the modules *MUST* match those in the concrete runtime.
-#[derive(Encode, Decode)]
-#[cfg_attr(feature = "std", derive(Clone, PartialEq, Eq))]
-pub enum Call {
- #[codec(index = "5")]
- Balances(Balances<NodeRuntimeTypes, AccountIndex>),
-}
-
-impl From<Balances<NodeRuntimeTypes, AccountIndex>> for Call {
- fn from(balances_call: Balances<NodeRuntimeTypes, AccountIndex>) -> Call {
- Call::Balances(balances_call)
- }
-}
-/// Generic Balance Call, could be used with other runtimes
-#[derive(Encode, Decode, Clone, PartialEq, Eq)]
-pub enum Balances<T, AccountIndex>
-where
- T: EnvTypes,
- T::AccountId: Member + Codec,
- AccountIndex: Member + Codec,
-{
- #[allow(non_camel_case_types)]
- #[codec(index = "3")]
- transfer(T::AccountId, #[codec(compact)] T::Balance),
- #[allow(non_camel_case_types)]
- #[codec(index = "6")]
- set_balance(
- Address<T::AccountId, AccountIndex>,
- #[codec(compact)] T::Balance,
- #[codec(compact)] T::Balance,
- ),
-}
-
-/// Construct a `Balances::transfer` call
-pub fn transfer_balance(account: AccountId, balance: Balance) -> Call {
- Balances::<NodeRuntimeTypes, AccountIndex>::transfer(account, balance).into()
-}
-
-#[cfg(test)]
-mod tests {
- use crate::{calls, AccountIndex, NodeRuntimeTypes};
- use super::Call;
-
- use node_runtime::{self, Runtime};
- use pallet_indices::address;
- use scale::{Decode, Encode};
-
-
- #[test]
- fn call_balance_transfer() {
- let balance = 10_000;
- let account_index = 0;
-
- let contract_address = calls::Address::Index(account_index);
- let contract_transfer =
- calls::Balances::<NodeRuntimeTypes, AccountIndex>::transfer(contract_address, balance);
- let contract_call = Call::Balances(contract_transfer);
-
- let srml_address = address::Address::Index(account_index);
- let srml_transfer = node_runtime::BalancesCall::<Runtime>::transfer(srml_address, balance);
- let srml_call = node_runtime::Call::Balances(srml_transfer);
-
- let contract_call_encoded = contract_call.encode();
- let srml_call_encoded = srml_call.encode();
-
- assert_eq!(srml_call_encoded, contract_call_encoded);
-
- let srml_call_decoded: node_runtime::Call =
- Decode::decode(&mut contract_call_encoded.as_slice())
- .expect("Balances transfer call decodes to srml type");
- let srml_call_encoded = srml_call_decoded.encode();
- let contract_call_decoded: Call = Decode::decode(&mut srml_call_encoded.as_slice())
- .expect("Balances transfer call decodes back to contract type");
- assert!(contract_call == contract_call_decoded);
- }
-}
tests/ink-types-node-runtime/src/lib.rsdiffbeforeafterboth--- a/tests/ink-types-node-runtime/src/lib.rs
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original License
-// Copyright 2018-2019 Parity Technologies (UK) Ltd.
-// This file is part of ink!.
-//
-// ink! is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// ink! is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with ink!. If not, see <http://www.gnu.org/licenses/>.
-
-//! Definitions for environment types for contracts targeted at a
-//! substrate chain with the default `node-runtime` configuration.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use core::{array::TryFromSliceError, convert::TryFrom};
-use ink_core::env::Clear;
-use scale::{Decode, Encode};
-use sp_core::crypto::AccountId32;
-#[cfg(feature = "ink-generate-abi")]
-use type_metadata::{HasTypeId, HasTypeDef, Metadata, MetaType, TypeId, TypeDef, TypeIdArray};
-
-pub mod calls;
-
-/// Contract environment types defined in substrate node-runtime
-#[cfg_attr(feature = "ink-generate-abi", derive(Metadata))]
-#[derive(Clone, Debug, PartialEq, Eq)]
-pub enum NodeRuntimeTypes {}
-
-#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode)]
-pub struct AccountId (AccountId32);
-
-impl From<AccountId32> for AccountId {
- fn from(account: AccountId32) -> Self {
- AccountId(account)
- }
-}
-
-#[cfg(feature = "ink-generate-abi")]
-impl HasTypeId for AccountId {
- fn type_id() -> TypeId {
- TypeIdArray::new(32, MetaType::new::<u8>()).into()
- }
-}
-
-#[cfg(feature = "ink-generate-abi")]
-impl HasTypeDef for AccountId {
- fn type_def() -> TypeDef {
- TypeDef::builtin()
- }
-}
-
-/// The default SRML balance type.
-pub type Balance = u128;
-
-/// The default SRML hash type.
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Encode, Decode)]
-pub struct Hash([u8; 32]);
-
-impl From<[u8; 32]> for Hash {
- fn from(hash: [u8; 32]) -> Hash {
- Hash(hash)
- }
-}
-
-impl<'a> TryFrom<&'a [u8]> for Hash {
- type Error = TryFromSliceError;
-
- fn try_from(bytes: &'a [u8]) -> Result<Hash, TryFromSliceError> {
- let hash = <[u8; 32]>::try_from(bytes)?;
- Ok(Hash(hash))
- }
-}
-
-impl AsRef<[u8]> for Hash {
- fn as_ref(&self) -> &[u8] {
- &self.0[..]
- }
-}
-
-impl AsMut<[u8]> for Hash {
- fn as_mut(&mut self) -> &mut [u8] {
- &mut self.0[..]
- }
-}
-
-impl Clear for Hash {
- fn is_clear(&self) -> bool {
- self.as_ref().iter().all(|&byte| byte == 0x00)
- }
-
- fn clear() -> Self {
- Self([0x00; 32])
- }
-}
-
-/// The default SRML moment type.
-pub type Moment = u64;
-
-/// The default SRML blocknumber type.
-pub type BlockNumber = u64;
-
-/// The default SRML AccountIndex type.
-pub type AccountIndex = u32;
-
-/// The default timestamp type.
-pub type Timestamp = u64;
-
-impl ink_core::env::EnvTypes for NodeRuntimeTypes {
- type AccountId = AccountId;
- type Balance = Balance;
- type Hash = Hash;
- type Timestamp = Timestamp;
- type BlockNumber = BlockNumber;
- type Call = calls::Call;
-}
tests/loadtester-src/.gitignorediffbeforeafterboth--- a/tests/loadtester-src/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ignore build artifacts from the local tests sub-crate.
-/target/
-
-# Ignore backup files creates by cargo fmt.
-**/*.rs.bk
-
-# Remove Cargo.lock when creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
\ No newline at end of file
tests/loadtester-src/Cargo.tomldiffbeforeafterboth--- a/tests/loadtester-src/Cargo.toml
+++ /dev/null
@@ -1,36 +0,0 @@
-[package]
-name = "loadtester"
-version = "0.1.0"
-authors = ["[your_name] <[your_email]>"]
-edition = "2021"
-
-[dependencies]
-ink_primitives = { version = "3.0.0-rc2", default-features = false }
-ink_metadata = { version = "3.0.0-rc2", default-features = false, features = ["derive"], optional = true }
-ink_env = { version = "3.0.0-rc2", default-features = false }
-ink_storage = { version = "3.0.0-rc2", default-features = false }
-ink_lang = { version = "3.0.0-rc2", default-features = false }
-ink_prelude = { version = "3.0.0-rc2", default-features = false }
-
-scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
-scale-info = { version = "0.4.1", default-features = false, features = ["derive"], optional = true }
-
-[lib]
-name = "loadtester"
-path = "lib.rs"
-crate-type = [
- # Used for normal contract Wasm blobs.
- "cdylib",
-]
-
-[features]
-default = ["std"]
-std = [
- "ink_metadata/std",
- "ink_env/std",
- "ink_storage/std",
- "ink_primitives/std",
- "scale/std",
- "scale-info/std",
-]
-ink-as-dependency = []
tests/loadtester-src/lib.rsdiffbeforeafterboth--- a/tests/loadtester-src/lib.rs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original License
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use ink_lang as ink;
-
-#[ink::contract]
-mod loadtester {
- use ink_storage::collections::Vec as InkVec;
-
- #[ink(storage)]
- pub struct LoadTester {
- vector: InkVec<u64>,
- }
-
- impl LoadTester {
- #[ink(constructor)]
- pub fn new() -> Self {
- Self {
- vector: InkVec::new(),
- }
- }
-
- #[ink(message)]
- pub fn bloat(&mut self, count: u64){
- for i in 1..count+1 {
- self.vector.push(i);
- }
- }
-
- #[ink(message)]
- pub fn get(&self) -> u128 {
- let mut sum: u128 = 0;
- for num in self.vector.iter() {
- sum += *num as u128;
- }
- sum
- }
- }
-
- #[cfg(test)]
- mod tests {
-
- use super::*;
-
- #[test]
- fn it_works() {
- let mut lt = LoadTester::new();
- lt.bloat(4);
- assert_eq!(lt.get(), [1,2,3,4]);
- lt.bloat(3);
- assert_eq!(lt.get(), [1,2,3,4,1,2,3]);
- }
- }
-}
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -88,8 +88,9 @@
"testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts",
"testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",
"testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
- "testCollatorSelection": "mocha --timeout 9999999 -r ts-node/register ./**/collatorSelection.*test.ts",
- "testIdentity": "mocha --timeout 9999999 -r ts-node/register ./**/identity.*test.ts",
+ "testCollators": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/collator-selection/**.*test.ts",
+ "testCollatorSelection": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/collatorSelection.*test.ts",
+ "testIdentity": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/identity.*test.ts",
"testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
"testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",
"testEthCreateNFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createNFTCollection.test.ts",
tests/src/collator-selection/collatorSelection.seqtest.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collator-selection/collatorSelection.seqtest.ts
@@ -0,0 +1,468 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util';
+
+async function resetInvulnerables() {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const superuser = await privateKey('//Alice');
+ const alice = await privateKey('//Alice');
+ const bob = await privateKey('//Bob');
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ if (!invulnerables.includes(alice.address) || !invulnerables.includes(bob.address) || invulnerables.length != 2) {
+ console.warn('Alice and Bob are not the invulnerables! Reinstating them back. '
+ + 'Current invulnerables\' size: ' + invulnerables.length);
+
+ let nonce = await helper.chain.getNonce(alice.address);
+ // In case there are too many invulnerables already, remove some of them, leaving space for Alice and Bob.
+ if (invulnerables.length + 2 >= helper.collatorSelection.maxCollators()) {
+ await Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerables.pop()], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerables.pop()], true, {nonce: nonce++}),
+ ]);
+ }
+
+ nonce = await helper.chain.getNonce(alice.address);
+ await Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
+ ]);
+
+ nonce = await helper.chain.getNonce(alice.address);
+ await Promise.all(invulnerables.map((invulnerable: any) => {
+ if (invulnerable == alice.address || invulnerable == bob.address) return new Promise<void>(res => res());
+ return helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerable], true, {nonce: nonce++});
+ }));
+ }
+ });
+}
+
+// todo:collator Most preferable to launch this test in parallel somehow -- or change the session period (1 hr).
+describe('Integration Test: Collator Selection', () => {
+ let superuser: IKeyringPair;
+ let previousLicenseBond = 0n;
+ let licenseBond = 0n;
+
+ before(async function() {
+ if (!process.env.RUN_COLLATOR_TESTS) this.skip();
+
+ await usingPlaygrounds(async (helper, privateKey) => {
+ requirePalletsOrSkip(this, helper, [Pallets.CollatorSelection]);
+ superuser = await privateKey('//Alice');
+
+ previousLicenseBond = await helper.collatorSelection.getLicenseBond();
+ licenseBond = 10n * helper.balance.getOneTokenNominal();
+ await helper.getSudo().collatorSelection.setLicenseBond(superuser, licenseBond);
+ });
+ });
+
+ describe('Dynamic shuffling of collators', () => {
+ // These two are the default invulnerables, and should return to be invulnerables after this suite.
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ let charlie: IKeyringPair;
+ let dave: IKeyringPair;
+
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ // todo:collator see again if blocks start to be finalized in dev mode
+ // Skip the collator block production in dev mode, since the blocks are sealed automatically.
+ if (await helper.arrange.isDevNode()) this.skip();
+
+ alice = await privateKey('//Alice');
+ bob = await privateKey('//Bob');
+ charlie = await privateKey('//Charlie');
+ dave = await privateKey('//Dave');
+
+ expect((await helper.session.setOwnKeysFromAddress(charlie))
+ .status.toLowerCase()).to.be.equal('success');
+ expect((await helper.session.setOwnKeysFromAddress(dave))
+ .status.toLowerCase()).to.be.equal('success');
+
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ if (!invulnerables.includes(alice.address) || !invulnerables.includes(bob.address) || invulnerables.length != 2) {
+ console.warn('Alice and Bob are not the invulnerables! Reinstating them back. '
+ + 'Current invulnerables\' size: ' + invulnerables.length);
+
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
+ ]);
+
+ nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(invulnerables.map((invulnerable: any) => {
+ if (invulnerable == alice.address || invulnerable == bob.address) return new Promise((res) => res);
+ return helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerable], true, {nonce: nonce++});
+ }));
+ }
+ });
+ });
+
+ itSub('Change invulnerables and make sure they start producing blocks', async ({helper}) => {
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await expect(Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [charlie.address], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [dave.address], true, {nonce: nonce++}),
+ ])).to.be.fulfilled;
+
+ nonce = await helper.chain.getNonce(superuser.address);
+ await expect(Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [alice.address], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [bob.address], true, {nonce: nonce++}),
+ ])).to.be.fulfilled;
+
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ expect(newInvulnerables).to.contain(charlie.address).and.contain(dave.address).and.be.length(2);
+
+ await helper.wait.newSessions(2);
+
+ const newValidators = await helper.callRpc('api.query.session.validators');
+ expect(newValidators).to.contain(charlie.address).and.contain(dave.address).and.be.length(2);
+
+ const lastBlockNumber = await helper.chain.getLatestBlockNumber();
+ await helper.wait.newBlocks(1);
+ const lastCharlieBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [charlie.address])).toNumber();
+ const lastDaveBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [dave.address])).toNumber();
+ expect(lastCharlieBlock >= lastBlockNumber || lastDaveBlock >= lastBlockNumber).to.be.true;
+ });
+
+ after(async () => {
+ await usingPlaygrounds(async (helper) => {
+ if (await helper.arrange.isDevNode()) return;
+
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all([
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
+ ]);
+
+ nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all([
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [charlie.address], true, {nonce: nonce++}),
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [dave.address], true, {nonce: nonce++}),
+ ]);
+ });
+ });
+ });
+
+ describe('Getting and releasing licenses to collate', () => {
+ let charlie: IKeyringPair;
+ let dave: IKeyringPair;
+ let crowd: IKeyringPair[];
+
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ charlie = await privateKey('//Charlie');
+ dave = await privateKey('//Dave');
+ crowd = await helper.arrange.createCrowd(20, 100n, superuser);
+
+ // set session keys for everyone
+ expect((await helper.session.setOwnKeysFromAddress(charlie))
+ .status.toLowerCase()).to.be.equal('success');
+ expect((await helper.session.setOwnKeysFromAddress(dave))
+ .status.toLowerCase()).to.be.equal('success');
+ await Promise.all(crowd.map(acc => helper.session.setOwnKeysFromAddress(acc)));
+ });
+ });
+
+ describe('Positive', () => {
+ itSub('Can lease and release a license', async ({helper}) => {
+ const account = crowd.pop()!;
+
+ // make sure it does not have any reserved funds
+ expect((await helper.balance.getSubstrateFull(account.address)).reserved).to.be.equal(0n);
+
+ // getting a license reserves a license bond cost
+ await helper.collatorSelection.obtainLicense(account);
+ expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(licenseBond);
+ expect((await helper.balance.getSubstrateFull(account.address)).reserved).to.be.equal(licenseBond);
+
+ // releasing a license un-reserves the license bond cost
+ await helper.collatorSelection.releaseLicense(account);
+ expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(0n);
+
+ const balance = await helper.balance.getSubstrateFull(account.address);
+ expect(balance.reserved).to.be.equal(0n);
+ expect(balance.free > 100n - licenseBond);
+ });
+
+ itSub('Can force revoke a license', async ({helper}) => {
+ const account = crowd.pop()!;
+
+ // getting a license reserves a license bond cost
+ const previousBalance = await helper.balance.getSubstrateFull(account.address);
+ await helper.collatorSelection.obtainLicense(account);
+ expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(licenseBond);
+
+ // force-releasing a license un-reserves the license bond cost as well
+ await helper.getSudo().collatorSelection.forceReleaseLicense(superuser, account.address);
+ expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(previousBalance.reserved);
+
+ const balance = await helper.balance.getSubstrateFull(account.address);
+ expect(balance.reserved).to.be.equal(previousBalance.reserved);
+ expect(balance.free > previousBalance.free - licenseBond);
+ });
+ });
+
+ describe('Negative', () => {
+ itSub('Cannot get a license without session keys set', async ({helper}) => {
+ const [account] = await helper.arrange.createAccounts([100n], superuser);
+ await expect(helper.collatorSelection.obtainLicense(account))
+ .to.be.rejectedWith(/collatorSelection.ValidatorNotRegistered/);
+ });
+
+ itSub('Cannot register a license twice', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await expect(helper.collatorSelection.obtainLicense(account))
+ .to.be.rejectedWith(/collatorSelection.AlreadyHoldingLicense/);
+ });
+
+ itSub('Cannot release a license twice', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await helper.collatorSelection.releaseLicense(account);
+ await expect(helper.collatorSelection.releaseLicense(account))
+ .to.be.rejectedWith(/collatorSelection.NoLicense/);
+ });
+
+ itSub('Cannot force revoke a license as non-sudo', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await expect(helper.collatorSelection.forceReleaseLicense(superuser, account.address))
+ .to.be.rejectedWith(/BadOrigin/);
+ });
+ });
+ });
+
+ describe('Onboarding, collating, and offboarding as collator candidates', () => {
+ // These two are the default invulnerables, and should return to be invulnerables after this suite.
+ let charlie: IKeyringPair;
+ let dave: IKeyringPair;
+ let crowd: IKeyringPair[];
+
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ charlie = await privateKey('//Charlie');
+ dave = await privateKey('//Dave');
+ crowd = await helper.arrange.createCrowd(20, 100n, superuser);
+
+ // set session keys for everyone
+ expect((await helper.session.setOwnKeysFromAddress(charlie))
+ .status.toLowerCase()).to.be.equal('success');
+ expect((await helper.session.setOwnKeysFromAddress(dave))
+ .status.toLowerCase()).to.be.equal('success');
+ await Promise.all(crowd.map(acc => helper.session.setOwnKeysFromAddress(acc)));
+ });
+ });
+
+ describe('Positive', () => {
+ itSub('Can onboard and offboard repeatedly', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await helper.collatorSelection.onboard(account);
+ expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([account.address]);
+
+ await helper.collatorSelection.offboard(account);
+ expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([]);
+
+ await helper.collatorSelection.onboard(account);
+ expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([account.address]);
+
+ await helper.collatorSelection.offboard(account);
+ expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([]);
+ });
+
+ itSub('Penalizes and forfeits license from faulty collators', async ({helper}) => {
+ // This one shouldn't even be able to produce blocks.
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await helper.collatorSelection.onboard(account);
+ expect(await helper.collatorSelection.getCandidates()).to.contain(account.address);
+
+ // Wait for 3 new sessions before checking that the collator will be kicked:
+ // one to get collator onboarded, and another two for the collator to fail
+ await helper.wait.newSessions(3);
+
+ expect(await helper.collatorSelection.getCandidates()).to.not.contain(account.address);
+ expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(0n);
+
+ // The account's reserved funds get slashed as a penalty
+ const balance = await helper.balance.getSubstrateFull(account.address);
+ expect(balance.reserved).to.be.equal(0n);
+ expect(balance.free < 100n - licenseBond);
+ });
+ });
+
+ describe('Negative', () => {
+ itSub('Cannot onboard without a license', async ({helper}) => {
+ const account = crowd.pop()!;
+ await expect(helper.collatorSelection.onboard(account))
+ .to.be.rejectedWith(/collatorSelection.NoLicense/);
+ });
+
+ itSub('Cannot offboard without a license', async ({helper}) => {
+ const account = crowd.pop()!;
+ await expect(helper.collatorSelection.offboard(account))
+ .to.be.rejectedWith(/collatorSelection.NotCandidate/);
+ });
+
+ itSub('Cannot offboard while not onboarded', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await expect(helper.collatorSelection.offboard(account))
+ .to.be.rejectedWith(/collatorSelection.NotCandidate/);
+ });
+
+ itSub('Cannot onboard while already onboarded', async ({helper}) => {
+ const account = crowd.pop()!;
+ await helper.collatorSelection.obtainLicense(account);
+ await helper.collatorSelection.onboard(account);
+ await expect(helper.collatorSelection.onboard(account))
+ .to.be.rejectedWith(/collatorSelection.AlreadyCandidate/);
+ });
+ });
+ });
+
+ describe('Addition and removal of invulnerables', () => {
+ before(async function() {
+ await resetInvulnerables();
+ });
+
+ describe('Positive', () => {
+ itSub('Adds an invulnerable', async ({helper}) => {
+ const [account] = await helper.arrange.createAccounts([10n], superuser);
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+
+ await helper.session.setOwnKeysFromAddress(account);
+ await helper.getSudo().collatorSelection.addInvulnerable(superuser, account.address);
+
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ expect(invulnerables.concat(account.address)).to.have.all.members(newInvulnerables);
+ });
+
+ itSub('Removes an invulnerable', async ({helper}) => {
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ const lastInvulnerable = invulnerables.pop()!;
+
+ await helper.getSudo().collatorSelection.removeInvulnerable(superuser, lastInvulnerable);
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ // invulnerables had its last element removed, so they should be equal
+ expect(newInvulnerables).to.have.all.members(invulnerables);
+ });
+ });
+
+ describe('Negative', () => {
+ itSub('Does not duplicate an invulnerable', async ({helper}) => {
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ // adding an already invulnerable should not fail, but should not duplicate it either
+ await expect(helper.getSudo().collatorSelection.addInvulnerable(superuser, invulnerables[0]))
+ .to.be.fulfilled;
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ expect(newInvulnerables).to.have.all.members(invulnerables);
+ });
+
+ itSub('Cannot remove a non-existent invulnerable', async ({helper}) => {
+ const [account] = await helper.arrange.createAccounts([0n], superuser);
+ await expect(helper.getSudo().collatorSelection.removeInvulnerable(superuser, account.address))
+ .to.be.rejectedWith(/collatorSelection.NotInvulnerable/);
+ });
+
+ itSub('Cannot allow invulnerables to be empty', async ({helper}) => {
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ const lastInvulnerable = invulnerables.pop()!;
+
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(invulnerables.map((i: any) =>
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [i], true, {nonce: nonce++})));
+
+ await expect(helper.getSudo().collatorSelection.removeInvulnerable(superuser, lastInvulnerable))
+ .to.be.rejectedWith(/collatorSelection.TooFewInvulnerables/);
+
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ expect(newInvulnerables).to.be.deep.equal([lastInvulnerable]);
+
+ // restore the invulnerables to the previous state
+ nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(invulnerables.map((i: any) =>
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [i], true, {nonce: nonce++})));
+ });
+
+ itSub('Cannot have too many invulnerables', async ({helper}) => {
+ // todo:collator make sure that there is enough session time for a set of tests
+ // 28 non-functioning collators, teehee.
+
+ const invulnerablesLength = (await helper.collatorSelection.getInvulnerables()).length;
+ const invulnerablesUntilLimit = helper.collatorSelection.maxCollators() - invulnerablesLength;
+ const newInvulnerables = await helper.arrange.createAccounts(Array(invulnerablesUntilLimit).fill(10n), superuser);
+ const [lastInvulnerable] = await helper.arrange.createAccounts([10n], superuser);
+
+ await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
+ helper.session.setOwnKeysFromAddress(i)));
+ await helper.session.setOwnKeysFromAddress(lastInvulnerable);
+
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [i.address], true, {nonce: nonce++})));
+
+ await expect(helper.getSudo().collatorSelection.addInvulnerable(superuser, lastInvulnerable.address))
+ .to.be.rejectedWith(/collatorSelection.TooManyInvulnerables/);
+
+ // restore the invulnerables to the previous state
+ nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [i.address], true, {nonce: nonce++})));
+ });
+
+ itSub('Forbids a non-sudo to add an invulnerable', async ({helper}) => {
+ const [account] = await helper.arrange.createAccounts([10n], superuser);
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+
+ await helper.session.setOwnKeysFromAddress(account);
+ await expect(helper.collatorSelection.addInvulnerable(superuser, account.address))
+ .to.be.rejectedWith(/BadOrigin/);
+
+ const newInvulnerables = await helper.collatorSelection.getInvulnerables();
+ expect(newInvulnerables).to.be.members(invulnerables);
+ });
+
+ itSub('Forbids a non-sudo to remove an invulnerable', async ({helper}) => {
+ const invulnerables = await helper.collatorSelection.getInvulnerables();
+ await expect(helper.collatorSelection.removeInvulnerable(superuser, invulnerables[0]))
+ .to.be.rejectedWith(/BadOrigin/);
+ expect(await helper.collatorSelection.getInvulnerables()).to.have.all.members(invulnerables);
+ });
+ });
+ });
+
+ after(async function() {
+ if (!process.env.RUN_COLLATOR_TESTS) return;
+
+ await usingPlaygrounds(async (helper) => {
+ if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;
+
+ await helper.getSudo().collatorSelection.setLicenseBond(superuser, previousLicenseBond);
+
+ const candidates = await helper.collatorSelection.getCandidates();
+ let nonce = await helper.chain.getNonce(superuser.address);
+ await Promise.all(candidates.map(candidate =>
+ helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.forceReleaseLicense', [candidate], true, {nonce: nonce++})));
+ });
+ });
+});
\ No newline at end of file
tests/src/collator-selection/identity.seqtest.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collator-selection/identity.seqtest.ts
@@ -0,0 +1,284 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util';
+import {UniqueHelper} from '../util/playgrounds/unique';
+
+async function getIdentities(helper: UniqueHelper) {
+ const identities: [string, any][] = [];
+ for(const [key, value] of await helper.getApi().query.identity.identityOf.entries())
+ identities.push([(key as any).toHuman(), (value as any).unwrap()]);
+ return identities;
+}
+
+async function getIdentityAccounts(helper: UniqueHelper) {
+ return (await getIdentities(helper)).flatMap(([key, _value]) => key);
+}
+
+async function getSubIdentityAccounts(helper: UniqueHelper, address: string) {
+ return ((await helper.getApi().query.identity.subsOf(address)).toHuman() as any)[1];
+}
+
+async function getSubIdentityName(helper: UniqueHelper, address: string) {
+ return ((await helper.getApi().query.identity.superOf(address)).toHuman() as any);
+}
+
+describe('Integration Test: Identities Manipulation', () => {
+ let superuser: IKeyringPair;
+
+ before(async function() {
+ if (!process.env.RUN_COLLATOR_TESTS) this.skip();
+
+ await usingPlaygrounds(async (helper, privateKey) => {
+ requirePalletsOrSkip(this, helper, [Pallets.Identity]);
+ superuser = await privateKey('//Alice');
+ });
+ });
+
+ itSub('Normal calls do not work', async ({helper}) => {
+ // console.error = () => {};
+ await expect(helper.executeExtrinsic(superuser, 'api.tx.identity.setIdentity', [{info: {display: {Raw: 'Meowser'}}}]))
+ .to.be.rejectedWith(/Transaction call is not expected/);
+ });
+
+ describe('Identities', () => {
+ itSub('Sets identities', async ({helper}) => {
+ const oldIdentitiesCount = (await getIdentityAccounts(helper)).length;
+
+ const crowdSize = 10;
+ const crowd = await helper.arrange.createCrowd(crowdSize, 0n, superuser);
+ const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
+
+ expect((await getIdentityAccounts(helper)).length).to.be.equal(oldIdentitiesCount + crowdSize);
+ });
+
+ itSub('Setting identities does not delete existing but does overwrite', async ({helper}) => {
+ const crowd = await helper.arrange.createCrowd(10, 0n, superuser);
+ const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
+
+ // insert a single identity
+ let singleIdentity = identities.pop()!;
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [[singleIdentity]]);
+
+ const oldIdentitiesCount = (await getIdentityAccounts(helper)).length;
+
+ // change an identity and push it with a few new others
+ singleIdentity = [singleIdentity[0], {info: {display: {Raw: 'something special'}}}];
+ identities.push(singleIdentity);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
+
+ // oldIdentitiesCount + 9 because one identity is overwritten, not inserted on top
+ expect((await getIdentityAccounts(helper)).length).to.be.equal(oldIdentitiesCount + 9);
+ expect((await helper.callRpc('api.query.identity.identityOf', [singleIdentity[0]])).toHuman().info.display)
+ .to.be.deep.equal({Raw: 'something special'});
+ });
+
+ itSub('Removes identities', async ({helper}) => {
+ const crowd = await helper.arrange.createCrowd(10, 0n, superuser);
+ const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
+ const oldIdentities = await getIdentityAccounts(helper);
+
+ // delete a couple, check that they are no longer there
+ const scapegoats = [crowd.pop()!.address, crowd.pop()!.address];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [scapegoats]);
+ const newIdentities = await getIdentityAccounts(helper);
+ expect(newIdentities.concat(scapegoats)).to.be.have.members(oldIdentities);
+ });
+ });
+
+ describe('Sub-identities', () => {
+ itSub('Sets subs', async ({helper}) => {
+ const crowdSize = 18;
+ const crowd = await helper.arrange.createCrowd(crowdSize, 0n, superuser);
+ const supers = [crowd.pop()!, crowd.pop()!, crowd.pop()!];
+
+ const subsPerSup = crowd.length / supers.length;
+ let subCount = 0;
+ const subs = [
+ crowd.slice(subCount, subCount += subsPerSup + 1),
+ crowd.slice(subCount, subCount += subsPerSup),
+ crowd.slice(subCount, subCount += subsPerSup - 1),
+ ];
+
+ const subsInfo = supers.map((acc, i) => [
+ acc.address, [
+ 1000000n + BigInt(i + 1),
+ subs[i].map((sub, j) => [
+ sub.address, {Raw: `accounter #${j}`},
+ ]),
+ ],
+ ]);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo]);
+
+ for (let i = 0; i < supers.length; i++) {
+ // check deposit
+ expect(((await helper.getApi().query.identity.subsOf(supers[i].address)).toJSON() as any)[0]).to.be.equal(1000001 + i);
+
+ const subsAccounts = await getSubIdentityAccounts(helper, supers[i].address);
+ // check sub-identities as account ids
+ expect(subsAccounts).to.include.members(subs[i].map(x => x.address));
+
+ for (let j = 0; j < subsAccounts.length; j++) {
+ // check sub-identities' names
+ expect((await getSubIdentityName(helper, subsAccounts[j]))[1]).to.be.deep.equal({Raw: `accounter #${j}`});
+ }
+ }
+ });
+
+ itSub('Setting sub-identities does not delete other existing but does overwrite own', async ({helper}) => {
+ const crowdSize = 18;
+ const crowd = await helper.arrange.createCrowd(crowdSize, 0n, superuser);
+ const supers = [crowd.pop()!, crowd.pop()!, crowd.pop()!];
+
+ const subsPerSup = crowd.length / supers.length;
+ let subCount = 0;
+ const subs = [
+ crowd.slice(subCount, subCount += subsPerSup + 1),
+ crowd.slice(subCount, subCount += subsPerSup),
+ crowd.slice(subCount, subCount += subsPerSup - 1),
+ ];
+
+ const subsInfo1 = supers.map((acc, i) => [
+ acc.address, [
+ 1000000n + BigInt(i + 1),
+ subs[i].map((sub, j) => [
+ sub.address, {Raw: `accounter #${j}`},
+ ]),
+ ],
+ ]);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo1]);
+
+ // change some sub-identities...
+ subs[2].pop(); subs[2].pop(); subs[2].push(...await helper.arrange.createAccounts([0n], superuser));
+
+ // ...and set them
+ const subsInfo2 = [[
+ supers[2].address, [
+ 999999n,
+ subs[2].map((sub, j) => [
+ sub.address, {Raw: `discounter #${j}`},
+ ]),
+ ],
+ ]];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo2]);
+
+ // make sure everything else is the same
+ for (let i = 0; i < supers.length - 1; i++) {
+ // check deposit
+ expect(((await helper.getApi().query.identity.subsOf(supers[i].address)).toJSON() as any)[0]).to.be.equal(1000001 + i);
+
+ const subsAccounts = await getSubIdentityAccounts(helper, supers[i].address);
+ // check sub-identities as account ids
+ expect(subsAccounts).to.include.members(subs[i].map(x => x.address));
+
+ for (let j = 0; j < subsAccounts; j++) {
+ // check sub-identities' names
+ expect((await getSubIdentityName(helper, subsAccounts[j]))[1]).to.be.deep.equal({Raw: `accounter #${j}`});
+ }
+ }
+
+ // check deposit
+ expect(((await helper.getApi().query.identity.subsOf(supers[2].address)).toJSON() as any)[0]).to.be.equal(999999);
+
+ const subsAccounts = await getSubIdentityAccounts(helper, supers[2].address);
+ // check sub-identities as account ids
+ expect(subsAccounts).to.include.members(subs[2].map(x => x.address));
+
+ for (let j = 0; j < subsAccounts.length; j++) {
+ // check sub-identities' names
+ expect((await getSubIdentityName(helper, subsAccounts[j]))[1]).to.be.deep.equal({Raw: `discounter #${j}`});
+ }
+ });
+
+ itSub('Removes sub-identities', async ({helper}) => {
+ const crowdSize = 3;
+ const crowd = await helper.arrange.createCrowd(crowdSize, 0n, superuser);
+ const sup = crowd.pop()!;
+
+ const subsInfo1 = [[
+ sup.address, [
+ 1000000n,
+ crowd.map((sub, j) => [
+ sub.address, {Raw: `accounter #${j}`},
+ ]),
+ ],
+ ]];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo1]);
+
+ // empty sub-identities should delete the records
+ const subsInfo2 = [[
+ sup.address, [
+ 1000000n,
+ [],
+ ],
+ ]];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo2]);
+
+ // check deposit
+ expect((await helper.getApi().query.identity.subsOf(sup.address)).toHuman()).to.be.deep.equal(['0', []]);
+
+ for (let j = 0; j < crowd.length; j++) {
+ // check sub-identities' names
+ expect((await getSubIdentityName(helper, crowd[j].address))).to.be.null;
+ }
+ });
+
+ itSub('Removing identities deletes associated sub-identities', async ({helper}) => {
+ const crowd = await helper.arrange.createCrowd(3, 0n, superuser);
+ const sup = crowd.pop()!;
+
+ // insert identity
+ const identities = [[sup.address, {info: {display: {Raw: 'mental'}}}]];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
+
+ // and its sub-identities
+ const subsInfo = [[
+ sup.address, [
+ 1000000n,
+ crowd.map((sub, j) => [
+ sub.address, {Raw: `accounter #${j}`},
+ ]),
+ ],
+ ]];
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsInfo]);
+
+ // delete top identity
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [[sup.address]]);
+
+ // check that sub-identities are deleted
+ expect((await helper.getApi().query.identity.subsOf(sup.address)).toHuman()).to.be.deep.equal(['0', []]);
+
+ for (let j = 0; j < crowd.length; j++) {
+ // check sub-identities' names
+ expect((await getSubIdentityName(helper, crowd[j].address))).to.be.null;
+ }
+ });
+ });
+
+ after(async function() {
+ if (!process.env.RUN_COLLATOR_TESTS) return;
+
+ await usingPlaygrounds(async helper => {
+ if (helper.fetchMissingPalletNames([Pallets.Identity]).length != 0) return;
+
+ const identitiesToRemove: string[] = await getIdentityAccounts(helper);
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [identitiesToRemove]);
+ });
+ });
+});
tests/src/collatorSelection.seqtest.tsdiffbeforeafterboth--- a/tests/src/collatorSelection.seqtest.ts
+++ /dev/null
@@ -1,465 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from './util';
-
-async function resetInvulnerables() {
- await usingPlaygrounds(async (helper, privateKey) => {
- const superuser = await privateKey('//Alice');
- const alice = await privateKey('//Alice');
- const bob = await privateKey('//Bob');
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- if (!invulnerables.includes(alice.address) || !invulnerables.includes(bob.address) || invulnerables.length != 2) {
- console.warn('Alice and Bob are not the invulnerables! Reinstating them back. '
- + 'Current invulnerables\' size: ' + invulnerables.length);
-
- let nonce = await helper.chain.getNonce(alice.address);
- // In case there are too many invulnerables already, remove some of them, leaving space for Alice and Bob.
- if (invulnerables.length + 2 >= helper.collatorSelection.maxCollators()) {
- await Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerables.pop()], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerables.pop()], true, {nonce: nonce++}),
- ]);
- }
-
- nonce = await helper.chain.getNonce(alice.address);
- await Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
- ]);
-
- nonce = await helper.chain.getNonce(alice.address);
- await Promise.all(invulnerables.map((invulnerable: any) => {
- if (invulnerable == alice.address || invulnerable == bob.address) return new Promise<void>(res => res());
- return helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerable], true, {nonce: nonce++});
- }));
- }
- });
-}
-
-// todo:collator Most preferable to launch this test in parallel somehow -- or change the session period (1 hr).
-describe('Integration Test: Collator Selection', () => {
- let superuser: IKeyringPair;
- let previousLicenseBond = 0n;
- let licenseBond = 0n;
-
- before(async function() {
- await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.CollatorSelection]);
- superuser = await privateKey('//Alice');
-
- previousLicenseBond = await helper.collatorSelection.getLicenseBond();
- licenseBond = 10n * helper.balance.getOneTokenNominal();
- await helper.getSudo().collatorSelection.setLicenseBond(superuser, licenseBond);
- });
- });
-
- describe('Dynamic shuffling of collators', () => {
- // These two are the default invulnerables, and should return to be invulnerables after this suite.
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- let charlie: IKeyringPair;
- let dave: IKeyringPair;
-
- before(async function() {
- await usingPlaygrounds(async (helper, privateKey) => {
- // todo:collator see again if blocks start to be finalized in dev mode
- // Skip the collator block production in dev mode, since the blocks are sealed automatically.
- if (await helper.arrange.isDevNode()) this.skip();
-
- alice = await privateKey('//Alice');
- bob = await privateKey('//Bob');
- charlie = await privateKey('//Charlie');
- dave = await privateKey('//Dave');
-
- expect((await helper.session.setOwnKeysFromAddress(charlie))
- .status.toLowerCase()).to.be.equal('success');
- expect((await helper.session.setOwnKeysFromAddress(dave))
- .status.toLowerCase()).to.be.equal('success');
-
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- if (!invulnerables.includes(alice.address) || !invulnerables.includes(bob.address) || invulnerables.length != 2) {
- console.warn('Alice and Bob are not the invulnerables! Reinstating them back. '
- + 'Current invulnerables\' size: ' + invulnerables.length);
-
- let nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
- ]);
-
- nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(invulnerables.map((invulnerable: any) => {
- if (invulnerable == alice.address || invulnerable == bob.address) return new Promise((res) => res);
- return helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [invulnerable], true, {nonce: nonce++});
- }));
- }
- });
- });
-
- itSub('Change invulnerables and make sure they start producing blocks', async ({helper}) => {
- let nonce = await helper.chain.getNonce(superuser.address);
- await expect(Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [charlie.address], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [dave.address], true, {nonce: nonce++}),
- ])).to.be.fulfilled;
-
- nonce = await helper.chain.getNonce(superuser.address);
- await expect(Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [alice.address], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [bob.address], true, {nonce: nonce++}),
- ])).to.be.fulfilled;
-
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- expect(newInvulnerables).to.contain(charlie.address).and.contain(dave.address).and.be.length(2);
-
- await helper.wait.newSessions(2);
-
- const newValidators = await helper.callRpc('api.query.session.validators');
- expect(newValidators).to.contain(charlie.address).and.contain(dave.address).and.be.length(2);
-
- const lastBlockNumber = await helper.chain.getLatestBlockNumber();
- await helper.wait.newBlocks(1);
- const lastCharlieBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [charlie.address])).toNumber();
- const lastDaveBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [dave.address])).toNumber();
- expect(lastCharlieBlock >= lastBlockNumber || lastDaveBlock >= lastBlockNumber).to.be.true;
- });
-
- after(async () => {
- await usingPlaygrounds(async (helper) => {
- if (await helper.arrange.isDevNode()) return;
-
- let nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all([
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [alice.address], true, {nonce: nonce++}),
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [bob.address], true, {nonce: nonce++}),
- ]);
-
- nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all([
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [charlie.address], true, {nonce: nonce++}),
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [dave.address], true, {nonce: nonce++}),
- ]);
- });
- });
- });
-
- describe('Getting and releasing licenses to collate', () => {
- let charlie: IKeyringPair;
- let dave: IKeyringPair;
- let crowd: IKeyringPair[];
-
- before(async function() {
- await usingPlaygrounds(async (helper, privateKey) => {
- charlie = await privateKey('//Charlie');
- dave = await privateKey('//Dave');
- crowd = await helper.arrange.createCrowd(20, 100n, superuser);
-
- // set session keys for everyone
- expect((await helper.session.setOwnKeysFromAddress(charlie))
- .status.toLowerCase()).to.be.equal('success');
- expect((await helper.session.setOwnKeysFromAddress(dave))
- .status.toLowerCase()).to.be.equal('success');
- await Promise.all(crowd.map(acc => helper.session.setOwnKeysFromAddress(acc)));
- });
- });
-
- describe('Positive', () => {
- itSub('Can lease and release a license', async ({helper}) => {
- const account = crowd.pop()!;
-
- // make sure it does not have any reserved funds
- expect((await helper.balance.getSubstrateFull(account.address)).reserved).to.be.equal(0n);
-
- // getting a license reserves a license bond cost
- await helper.collatorSelection.obtainLicense(account);
- expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(licenseBond);
- expect((await helper.balance.getSubstrateFull(account.address)).reserved).to.be.equal(licenseBond);
-
- // releasing a license un-reserves the license bond cost
- await helper.collatorSelection.releaseLicense(account);
- expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(0n);
-
- const balance = await helper.balance.getSubstrateFull(account.address);
- expect(balance.reserved).to.be.equal(0n);
- expect(balance.free > 100n - licenseBond);
- });
-
- itSub('Can force revoke a license', async ({helper}) => {
- const account = crowd.pop()!;
-
- // getting a license reserves a license bond cost
- const previousBalance = await helper.balance.getSubstrateFull(account.address);
- await helper.collatorSelection.obtainLicense(account);
- expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(licenseBond);
-
- // force-releasing a license un-reserves the license bond cost as well
- await helper.getSudo().collatorSelection.forceReleaseLicense(superuser, account.address);
- expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(previousBalance.reserved);
-
- const balance = await helper.balance.getSubstrateFull(account.address);
- expect(balance.reserved).to.be.equal(previousBalance.reserved);
- expect(balance.free > previousBalance.free - licenseBond);
- });
- });
-
- describe('Negative', () => {
- itSub('Cannot get a license without session keys set', async ({helper}) => {
- const [account] = await helper.arrange.createAccounts([100n], superuser);
- await expect(helper.collatorSelection.obtainLicense(account))
- .to.be.rejectedWith(/collatorSelection.ValidatorNotRegistered/);
- });
-
- itSub('Cannot register a license twice', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await expect(helper.collatorSelection.obtainLicense(account))
- .to.be.rejectedWith(/collatorSelection.AlreadyHoldingLicense/);
- });
-
- itSub('Cannot release a license twice', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await helper.collatorSelection.releaseLicense(account);
- await expect(helper.collatorSelection.releaseLicense(account))
- .to.be.rejectedWith(/collatorSelection.NoLicense/);
- });
-
- itSub('Cannot force revoke a license as non-sudo', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await expect(helper.collatorSelection.forceReleaseLicense(superuser, account.address))
- .to.be.rejectedWith(/BadOrigin/);
- });
- });
- });
-
- describe('Onboarding, collating, and offboarding as collator candidates', () => {
- // These two are the default invulnerables, and should return to be invulnerables after this suite.
- let charlie: IKeyringPair;
- let dave: IKeyringPair;
- let crowd: IKeyringPair[];
-
- before(async function() {
- await usingPlaygrounds(async (helper, privateKey) => {
- charlie = await privateKey('//Charlie');
- dave = await privateKey('//Dave');
- crowd = await helper.arrange.createCrowd(20, 100n, superuser);
-
- // set session keys for everyone
- expect((await helper.session.setOwnKeysFromAddress(charlie))
- .status.toLowerCase()).to.be.equal('success');
- expect((await helper.session.setOwnKeysFromAddress(dave))
- .status.toLowerCase()).to.be.equal('success');
- await Promise.all(crowd.map(acc => helper.session.setOwnKeysFromAddress(acc)));
- });
- });
-
- describe('Positive', () => {
- itSub('Can onboard and offboard repeatedly', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await helper.collatorSelection.onboard(account);
- expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([account.address]);
-
- await helper.collatorSelection.offboard(account);
- expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([]);
-
- await helper.collatorSelection.onboard(account);
- expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([account.address]);
-
- await helper.collatorSelection.offboard(account);
- expect(await helper.collatorSelection.getCandidates()).to.be.deep.equal([]);
- });
-
- itSub('Penalizes and forfeits license from faulty collators', async ({helper}) => {
- // This one shouldn't even be able to produce blocks.
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await helper.collatorSelection.onboard(account);
- expect(await helper.collatorSelection.getCandidates()).to.contain(account.address);
-
- // Wait for 3 new sessions before checking that the collator will be kicked:
- // one to get collator onboarded, and another two for the collator to fail
- await helper.wait.newSessions(3);
-
- expect(await helper.collatorSelection.getCandidates()).to.not.contain(account.address);
- expect(await helper.collatorSelection.hasLicense(account.address)).to.be.equal(0n);
-
- // The account's reserved funds get slashed as a penalty
- const balance = await helper.balance.getSubstrateFull(account.address);
- expect(balance.reserved).to.be.equal(0n);
- expect(balance.free < 100n - licenseBond);
- });
- });
-
- describe('Negative', () => {
- itSub('Cannot onboard without a license', async ({helper}) => {
- const account = crowd.pop()!;
- await expect(helper.collatorSelection.onboard(account))
- .to.be.rejectedWith(/collatorSelection.NoLicense/);
- });
-
- itSub('Cannot offboard without a license', async ({helper}) => {
- const account = crowd.pop()!;
- await expect(helper.collatorSelection.offboard(account))
- .to.be.rejectedWith(/collatorSelection.NotCandidate/);
- });
-
- itSub('Cannot offboard while not onboarded', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await expect(helper.collatorSelection.offboard(account))
- .to.be.rejectedWith(/collatorSelection.NotCandidate/);
- });
-
- itSub('Cannot onboard while already onboarded', async ({helper}) => {
- const account = crowd.pop()!;
- await helper.collatorSelection.obtainLicense(account);
- await helper.collatorSelection.onboard(account);
- await expect(helper.collatorSelection.onboard(account))
- .to.be.rejectedWith(/collatorSelection.AlreadyCandidate/);
- });
- });
- });
-
- describe('Addition and removal of invulnerables', () => {
- before(async function() {
- await resetInvulnerables();
- });
-
- describe('Positive', () => {
- itSub('Adds an invulnerable', async ({helper}) => {
- const [account] = await helper.arrange.createAccounts([10n], superuser);
- const invulnerables = await helper.collatorSelection.getInvulnerables();
-
- await helper.session.setOwnKeysFromAddress(account);
- await helper.getSudo().collatorSelection.addInvulnerable(superuser, account.address);
-
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- expect(invulnerables.concat(account.address)).to.have.all.members(newInvulnerables);
- });
-
- itSub('Removes an invulnerable', async ({helper}) => {
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- const lastInvulnerable = invulnerables.pop()!;
-
- await helper.getSudo().collatorSelection.removeInvulnerable(superuser, lastInvulnerable);
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- // invulnerables had its last element removed, so they should be equal
- expect(newInvulnerables).to.have.all.members(invulnerables);
- });
- });
-
- describe('Negative', () => {
- itSub('Does not duplicate an invulnerable', async ({helper}) => {
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- // adding an already invulnerable should not fail, but should not duplicate it either
- await expect(helper.getSudo().collatorSelection.addInvulnerable(superuser, invulnerables[0]))
- .to.be.fulfilled;
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- expect(newInvulnerables).to.have.all.members(invulnerables);
- });
-
- itSub('Cannot remove a non-existent invulnerable', async ({helper}) => {
- const [account] = await helper.arrange.createAccounts([0n], superuser);
- await expect(helper.getSudo().collatorSelection.removeInvulnerable(superuser, account.address))
- .to.be.rejectedWith(/collatorSelection.NotInvulnerable/);
- });
-
- itSub('Cannot allow invulnerables to be empty', async ({helper}) => {
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- const lastInvulnerable = invulnerables.pop()!;
-
- let nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(invulnerables.map((i: any) =>
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [i], true, {nonce: nonce++})));
-
- await expect(helper.getSudo().collatorSelection.removeInvulnerable(superuser, lastInvulnerable))
- .to.be.rejectedWith(/collatorSelection.TooFewInvulnerables/);
-
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- expect(newInvulnerables).to.be.deep.equal([lastInvulnerable]);
-
- // restore the invulnerables to the previous state
- nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(invulnerables.map((i: any) =>
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [i], true, {nonce: nonce++})));
- });
-
- itSub('Cannot have too many invulnerables', async ({helper}) => {
- // todo:collator make sure that there is enough session time for a set of tests
- // 28 non-functioning collators, teehee.
-
- const invulnerablesLength = (await helper.collatorSelection.getInvulnerables()).length;
- const invulnerablesUntilLimit = helper.collatorSelection.maxCollators() - invulnerablesLength;
- const newInvulnerables = await helper.arrange.createAccounts(Array(invulnerablesUntilLimit).fill(10n), superuser);
- const [lastInvulnerable] = await helper.arrange.createAccounts([10n], superuser);
-
- await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
- helper.session.setOwnKeysFromAddress(i)));
- await helper.session.setOwnKeysFromAddress(lastInvulnerable);
-
- let nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.addInvulnerable', [i.address], true, {nonce: nonce++})));
-
- await expect(helper.getSudo().collatorSelection.addInvulnerable(superuser, lastInvulnerable.address))
- .to.be.rejectedWith(/collatorSelection.TooManyInvulnerables/);
-
- // restore the invulnerables to the previous state
- nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(newInvulnerables.map((i: IKeyringPair) =>
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [i.address], true, {nonce: nonce++})));
- });
-
- itSub('Forbids a non-sudo to add an invulnerable', async ({helper}) => {
- const [account] = await helper.arrange.createAccounts([10n], superuser);
- const invulnerables = await helper.collatorSelection.getInvulnerables();
-
- await helper.session.setOwnKeysFromAddress(account);
- await expect(helper.collatorSelection.addInvulnerable(superuser, account.address))
- .to.be.rejectedWith(/BadOrigin/);
-
- const newInvulnerables = await helper.collatorSelection.getInvulnerables();
- expect(newInvulnerables).to.be.members(invulnerables);
- });
-
- itSub('Forbids a non-sudo to remove an invulnerable', async ({helper}) => {
- const invulnerables = await helper.collatorSelection.getInvulnerables();
- await expect(helper.collatorSelection.removeInvulnerable(superuser, invulnerables[0]))
- .to.be.rejectedWith(/BadOrigin/);
- expect(await helper.collatorSelection.getInvulnerables()).to.have.all.members(invulnerables);
- });
- });
- });
-
- after(async () => {
- // eslint-disable-next-line require-await
- await usingPlaygrounds(async (helper) => {
- if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;
-
- await helper.getSudo().collatorSelection.setLicenseBond(superuser, previousLicenseBond);
-
- const candidates = await helper.collatorSelection.getCandidates();
- let nonce = await helper.chain.getNonce(superuser.address);
- await Promise.all(candidates.map(candidate =>
- helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.forceReleaseLicense', [candidate], true, {nonce: nonce++})));
- });
- });
-});
\ No newline at end of file
tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -173,7 +173,7 @@
});
itEth('RFT to NFT', async ({helper}) => {
- const owner = await helper.eth.createAccountWithBalance(donor, 20n);
+ const owner = await helper.eth.createAccountWithBalance(donor, 30n);
const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner);
const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await mintRFTToken(helper, owner, fractionalizer, 100n);
tests/src/identity.seqtest.tsdiffbeforeafterboth--- a/tests/src/identity.seqtest.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from './util';
-import {UniqueHelper} from './util/playgrounds/unique';
-
-async function getIdentities(helper: UniqueHelper) {
- const identities: [string, any][] = [];
- for(const [key, value] of await helper.getApi().query.identity.identityOf.entries())
- identities.push([(key as any).toHuman(), (value as any).unwrap()]);
- return identities;
-}
-
-async function getIdentityAccounts(helper: UniqueHelper) {
- return (await getIdentities(helper)).flatMap(([key, _value]) => key);
-}
-
-describe('Integration Test: Identities Manipulation', () => {
- let superuser: IKeyringPair;
-
- before(async function() {
- await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.Identity]);
- superuser = await privateKey('//Alice');
- });
- });
-
- itSub('Normal calls do not work', async ({helper}) => {
- // console.error = () => {};
- await expect(helper.executeExtrinsic(superuser, 'api.tx.identity.setIdentity', [{info: {display: {Raw: 'Meowser'}}}]))
- .to.be.rejectedWith(/Transaction call is not expected/);
- });
-
- itSub('Sets identities', async ({helper}) => {
- const oldIdentitiesCount = (await getIdentityAccounts(helper)).length;
-
- const crowdSize = 10;
- const crowd = await helper.arrange.createCrowd(crowdSize, 0n, superuser);
- const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
-
- expect((await getIdentityAccounts(helper)).length).to.be.equal(oldIdentitiesCount + crowdSize);
- });
-
- itSub('Setting identities does not delete existing but does overwrite', async ({helper}) => {
- const crowd = await helper.arrange.createCrowd(10, 0n, superuser);
- const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
-
- // insert a single identity
- let singleIdentity = identities.pop()!;
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [[singleIdentity]]);
-
- const oldIdentitiesCount = (await getIdentityAccounts(helper)).length;
-
- // change an identity and push it with a few new others
- singleIdentity = [singleIdentity[0], {info: {display: {Raw: 'something special'}}}];
- identities.push(singleIdentity);
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
-
- // oldIdentitiesCount + 9 because one identity is overwritten, not inserted on top
- expect((await getIdentityAccounts(helper)).length).to.be.equal(oldIdentitiesCount + 9);
- expect((await helper.callRpc('api.query.identity.identityOf', [singleIdentity[0]])).toHuman().info.display)
- .to.be.deep.equal({Raw: 'something special'});
- });
-
- itSub('Removes identities', async ({helper}) => {
- const crowd = await helper.arrange.createCrowd(10, 0n, superuser);
- const identities = crowd.map((acc, i) => [acc.address, {info: {display: {Raw: `accounter #${i}`}}}]);
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identities]);
- const oldIdentities = await getIdentityAccounts(helper);
-
- // delete a couple, check that they are no longer there
- const scapegoats = [crowd.pop()!.address, crowd.pop()!.address];
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [scapegoats]);
- const newIdentities = await getIdentityAccounts(helper);
- expect(newIdentities.concat(scapegoats)).to.be.have.members(oldIdentities);
- });
-
- after(async function() {
- await usingPlaygrounds(async helper => {
- if (helper.fetchMissingPalletNames([Pallets.Identity]).length != 0) return;
-
- const identitiesToRemove: string[] = await getIdentityAccounts(helper);
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [identitiesToRemove]);
- });
- });
-});
tests/src/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/nesting/nest.test.ts
+++ b/tests/src/nesting/nest.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {IKeyringPair} from '@polkadot/types/types';
-import {expect, itSub, usingPlaygrounds} from '../util';
+import {expect, itSub, Pallets, usingPlaygrounds} from '../util';
describe('Integration Test: Composite nesting tests', () => {
let alice: IKeyringPair;
@@ -68,7 +68,7 @@
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
const donor = await privateKey({filename: __filename});
- [alice, bob, charlie] = await helper.arrange.createAccounts([50n, 10n, 10n], donor);
+ [alice, bob, charlie] = await helper.arrange.createAccounts([200n, 10n, 10n], donor);
});
});
@@ -218,6 +218,38 @@
await collectionFT.transfer(charlie, targetToken.nestingAccount(), 2n);
expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(7n);
});
+
+ itSub.ifWithPallets('ReFungible: getTopmostOwner works correctly with Nesting', [Pallets.ReFungible], async({helper}) => {
+ const collectionNFT = await helper.nft.mintCollection(alice, {
+ permissions: {
+ nesting: {
+ tokenOwner: true,
+ },
+ },
+ });
+ const collectionRFT = await helper.rft.mintCollection(alice);
+
+ const nft = await collectionNFT.mintToken(alice, {Substrate: alice.address});
+ const rft = await collectionRFT.mintToken(alice, 100n, {Substrate: alice.address});
+
+ expect(await rft.getTopmostOwner()).deep.equal({Substrate: alice.address});
+
+ await rft.transfer(alice, nft.nestingAccount(), 40n);
+
+ expect(await rft.getTopmostOwner()).deep.equal(null);
+
+ await rft.transfer(alice, nft.nestingAccount(), 60n);
+
+ expect(await rft.getTopmostOwner()).deep.equal({Substrate: alice.address});
+
+ await rft.transferFrom(alice, nft.nestingAccount(), {Substrate: alice.address}, 30n);
+
+ expect(await rft.getTopmostOwner()).deep.equal(null);
+
+ await rft.transferFrom(alice, nft.nestingAccount(), {Substrate: alice.address}, 70n);
+
+ expect(await rft.getTopmostOwner()).deep.equal({Substrate: alice.address});
+ });
});
describe('Negative Test: Nesting', () => {
tests/src/util/identitySetter.tsdiffbeforeafterboth--- a/tests/src/util/identitySetter.ts
+++ b/tests/src/util/identitySetter.ts
@@ -1,5 +1,8 @@
// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
// SPDX-License-Identifier: Apache-2.0
+//
+// Usage: `yarn setIdentities [relay WS URL] [parachain WS URL] [sudo key]`
+// Example: `yarn setIdentities wss://polkadot-rpc.dwellir.com ws://localhost:9944 escape pattern miracle train sudden cart adapt embark wedding alien lamp mesh`
import {encodeAddress} from '@polkadot/keyring';
import {usingPlaygrounds, Pallets} from './index';
@@ -9,36 +12,81 @@
const paraUrl = process.argv[3] ?? 'ws://localhost:9944';
const key = process.argv.length > 4 ? process.argv.slice(4).join(' ') : '//Alice';
+function extractAccountId(key: any): string {
+ return (key as any).toHuman()[0];
+}
+
function extractIdentity(key: any, value: any): [string, any] {
- return [(key as any).toHuman()[0], (value as any).unwrap()];
+ return [extractAccountId(key), (value as any).unwrap()];
}
-async function getIdentities(helper: ChainHelperBase) {
+async function getIdentities(helper: ChainHelperBase, noneCasePredicate?: (key: any, value: any) => void) {
const identities: [string, any][] = [];
- for(const [key, value] of await helper.getApi().query.identity.identityOf.entries())
+ for(const [key, v] of await helper.getApi().query.identity.identityOf.entries()) {
+ const value = v as any;
+ if (value.isNone) {
+ if (noneCasePredicate) noneCasePredicate(key, value);
+ continue;
+ }
identities.push(extractIdentity(key, value));
+ }
return identities;
}
-// This is a utility for pulling
+function constructSubInfo(identityAccount: string, subQuery: any, supers: any[], ss58?: number): [string, any] {
+ const deposit = subQuery.toJSON()[0];
+ const subIdentities = subQuery.toHuman()[1];
+ subIdentities.map((sub: string) => supers.find((sup: any) => sup[0] === sub));
+ // supers.find((x: any) => x[0] === subIdentities[0])![1].toHuman();
+ return [
+ encodeAddress(identityAccount, ss58), [
+ deposit,
+ subIdentities.map((sub: string) => [
+ encodeAddress(sub, ss58),
+ supers.find((sup: any) => sup[0] === sub)![1].toJSON()[1],
+ ]),
+ ],
+ ];
+}
+
+async function getSubs(helper: ChainHelperBase) {
+ return (await helper.getApi().query.identity.subsOf.entries()).map(([key, value]) => [extractAccountId(key), value as any]);
+}
+
+async function getSupers(helper: ChainHelperBase) {
+ return (await helper.getApi().query.identity.superOf.entries()).map(([key, value]) => [extractAccountId(key), value as any]);
+}
+
+// The utility for pulling identity and sub-identity data
const forceInsertIdentities = async (): Promise<void> => {
const identitiesOnRelay: any[] = [];
+ const subsOnRelay: any[] = [];
const identitiesToRemove: string[] = [];
await usingPlaygrounds(async helper => {
try {
// iterate over every identity
- for(const [key, v] of await helper.getApi().query.identity.identityOf.entries()) {
- const value = v as any;
- if (value.isNone) {
- // in the nigh-impossible case that storage map would actually give None for a value, might as well delete it
- identitiesToRemove.push((key as any).toHuman()[0]);
- continue;
- }
-
+ for(const [key, value] of await getIdentities(helper, (key, _value) => identitiesToRemove.push((key as any).toHuman()[0]))) {
// if any of the judgements resulted in a good confirmed outcome, keep this identity
- if (value.unwrap().toHuman().judgements.filter((x: any) => x[1] == 'Reasonable' || x[1] == 'KnownGood').length == 0) continue;
- identitiesOnRelay.push(extractIdentity(key, value));
+ if (value.toHuman().judgements.filter((x: any) => x[1] == 'Reasonable' || x[1] == 'KnownGood').length == 0) continue;
+ identitiesOnRelay.push([key, value]);
+ }
+
+ const sublessIdentities = [...identitiesOnRelay];
+ const supersOfSubs = await getSupers(helper);
+
+ // iterate over every sub-identity
+ for(const [key, value] of await getSubs(helper)) {
+ // only get subs of the identities interesting to us
+ const identityIndex = sublessIdentities.findIndex((x: any) => x[0] == key);
+ if (identityIndex == -1) continue;
+ sublessIdentities.splice(identityIndex, 1);
+ subsOnRelay.push(constructSubInfo(key, value, supersOfSubs));
}
+
+ // mark the rest of sub-identities for deletion with empty arrays
+ /*for(const [account, _identity] of sublessIdentities) {
+ subsOnRelay.push([account, ['0', []]]);
+ }*/
} catch (error) {
console.error(error);
throw Error('Error during fetching identities');
@@ -60,7 +108,7 @@
const identity = paraIdentities.find(i => i[0] === encodedKey);
if (identity) {
// only update if the identity info does not exist or is changed
- if (value.toString() === identity[1].toString()) {
+ if (JSON.stringify(value) === JSON.stringify(identity[1])) {
continue;
}
}
@@ -71,11 +119,36 @@
// identitiesToRemove.push((key as any).toHuman()[0]);
}
- // await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [identitiesToRemove]);
- await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identitiesToAdd]);
- console.log(`Tried to upload ${identitiesToAdd.length} identities `
- + `and found ${identitiesToRemove.length} identities for potential removal. `
- + `Now there are ${(await helper.getApi().query.identity.identityOf.keys()).length}.`);
+ const paraSubs = await getSubs(helper);
+ const supersOfSubs = await getSupers(helper);
+ const subsToUpdate: any[] = [];
+
+ if (identitiesToRemove.length != 0)
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceRemoveIdentities', [identitiesToRemove]);
+ if (identitiesToAdd.length != 0)
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceInsertIdentities', [identitiesToAdd]);
+
+ console.log(`Tried to upload ${identitiesToAdd.length} identities`
+ + ` and found ${identitiesToRemove.length} identities for potential removal.`
+ + ` Now there are ${(await helper.getApi().query.identity.identityOf.keys()).length}.`);
+
+ for (const [key, value] of subsOnRelay) {
+ const encodedKey = encodeAddress(key, ss58Format);
+ const sub = paraSubs.find(i => i[0] === encodedKey);
+ if (sub) {
+ // only update if the sub-identity info does not exist or is changed
+ if (JSON.stringify(value) === JSON.stringify(constructSubInfo(sub[0], sub[1], supersOfSubs)[1])) {
+ continue;
+ }
+ }
+ subsToUpdate.push([key, value]);
+ }
+
+ if (subsToUpdate.length != 0)
+ await helper.getSudo().executeExtrinsic(superuser, 'api.tx.identity.forceSetSubs', [subsToUpdate]);
+
+ console.log(`Also tried to update ${subsToUpdate.length} identities with their sub-identities.`
+ + ` Now there are ${(await helper.getApi().query.identity.subsOf.keys()).length} identities with subs.`);
} catch (error) {
console.error(error);
throw Error('Error during setting identities');