difftreelog
merge develop into /test/playground-migration
in: master
154 files changed
.docker/Dockerfile-acala.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-acala.j2
@@ -0,0 +1,41 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+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 ACALA =====
+FROM rust-builder as builder-acala-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git && \
+ cd Acala && \
+ make init && \
+ make build-release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-acala
+
+COPY --from=builder-acala-bin /unique_parachain/Acala/target/production/acala /unique_parachain/Acala/target/production/acala
.docker/Dockerfile-chain-devdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev
+++ b/.docker/Dockerfile-chain-dev
@@ -1,17 +1,19 @@
FROM ubuntu:20.04
+ARG RUST_TOOLCHAIN=
+ARG FEATURE=
+
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
-
-RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
-
+ENV FEATURE=$FEATURE
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n"
-ARG RUST_TOOLCHAIN=
-ARG FEATURE=
+RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install $RUST_TOOLCHAIN && \
@@ -24,5 +26,6 @@
WORKDIR /dev_chain
RUN cargo build --release
+RUN echo "$FEATURE"
CMD cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
.docker/Dockerfile-cumulus.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-cumulus.j2
@@ -0,0 +1,40 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+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 CUMULUS =====
+FROM rust-builder as builder-cumulus-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git && \
+ cd cumulus && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-cumulus
+
+COPY --from=builder-cumulus-bin /unique_parachain/cumulus/target/release/polkadot-parachain /unique_parachain/cumulus/target/release/polkadot-parachain
.docker/Dockerfile-moonbeam.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-moonbeam.j2
@@ -0,0 +1,41 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+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 MOONBEAM =====
+FROM rust-builder as builder-moonbeam-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git && \
+ cd moonbeam && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-moonbeam
+
+COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam
\ No newline at end of file
.docker/Dockerfile-polkadot.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-polkadot.j2
@@ -0,0 +1,40 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+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 POLKADOT =====
+FROM rust-builder as builder-polkadot-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \
+ cd polkadot && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-polkadot
+
+COPY --from=builder-polkadot-bin /unique_parachain/polkadot/target/release/polkadot /unique_parachain/polkadot/target/release/polkadot
.docker/Dockerfile-try-runtimediffbeforeafterboth--- a/.docker/Dockerfile-try-runtime
+++ b/.docker/Dockerfile-try-runtime
@@ -47,4 +47,4 @@
cargo build --features=$FEATURE --release
-CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
+CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
.docker/Dockerfile-xcm.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-xcm.j2
@@ -0,0 +1,85 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+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
+
+WORKDIR /unique_parachain
+
+COPY ./xcm-config/launch-config-xcm-{{ NETWORK }}.json ./launch-config-xcm-{{ NETWORK }}.json
+COPY ./xcm-config/5validators.jsonnet ./5validators.jsonnet
+COPY ./xcm-config/minBondFix.jsonnet ./minBondFix.jsonnet
+
+RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \
+ cd unique-chain && \
+ cargo build --features={{ FEATURE }} --$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/launch-config-xcm-{{ NETWORK }}.json /polkadot-launch/
+COPY --from=builder-unique /unique_parachain/5validators.jsonnet /polkadot-launch/5validators.jsonnet
+COPY --from=builder-unique /unique_parachain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet
+
+COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/
+
+COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
+COPY --from=uniquenetwork/builder-moonbeam:{{ MOONBEAM_BUILD_BRANCH }} /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/
+COPY --from=uniquenetwork/builder-cumulus:{{ CUMULUS_BUILD_BRANCH }} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus
+COPY --from=uniquenetwork/builder-acala:{{ ACALA_BUILD_BRANCH }} /unique_parachain/Acala/target/production/acala /acala/target/release/
+COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/
+
+EXPOSE 9844
+EXPOSE 9933
+EXPOSE 9944
+EXPOSE 9946
+EXPOSE 9947
+EXPOSE 9948
+
+CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ cd /polkadot-launch && \
+ yarn start launch-config-xcm-{{ NETWORK }}.json
+
.docker/docker-compose.tmp-dev.j2diffbeforeafterboth--- a/.docker/docker-compose.tmp-dev.j2
+++ b/.docker/docker-compose.tmp-dev.j2
@@ -18,4 +18,4 @@
options:
max-size: "1m"
max-file: "3"
- command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
+ command: cargo run --release --features={{ FEATURE }} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
.docker/docker-compose.tmp-xcm-tests.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/docker-compose.tmp-xcm-tests.j2
@@ -0,0 +1,25 @@
+version: "3.5"
+
+services:
+ xcm_nodes:
+ image: uniquenetwork/xcm-{{ NETWORK }}-testnet-local:latest
+ container_name: xcm-{{ NETWORK }}-testnet-local
+ expose:
+ - 9844
+ - 9933
+ - 9944
+ - 9946
+ - 9947
+ - 9948
+ ports:
+ - 127.0.0.1:9844:9844
+ - 127.0.0.1:9933:9933
+ - 127.0.0.1:9944:9944
+ - 127.0.0.1:9946:9946
+ - 127.0.0.1:9947:9947
+ - 127.0.0.1:9948:9948
+ logging:
+ options:
+ max-size: "1m"
+ max-file: "3"
+
.docker/xcm-config/5validators.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/5validators.jsonnet
@@ -0,0 +1,50 @@
+
+function(spec)
+ spec {
+ genesis+: {
+ runtime+: {
+ staking+: {
+ validatorCount: 5,
+ invulnerables: [
+ '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY',
+ '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc',
+ '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT',
+ '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8',
+ '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n',
+ ],
+ stakers: [
+ [
+ '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY',
+ '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc',
+ '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT',
+ '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8',
+ '5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n',
+ '5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw',
+ 100000000000000,
+ 'Validator',
+ ],
+ ],
+ },
+ },
+ },
+ }
.docker/xcm-config/launch-config-xcm-opal.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-opal.json
@@ -0,0 +1,134 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2095",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "westmint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2095,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-quartz.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-quartz.json
@@ -0,0 +1,199 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2095",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "karura-dev",
+ "balance": "1000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": 2023,
+ "balance": "1000000000000000000000",
+ "chain": "moonriver-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "minBondFix.jsonnet"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemine-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2095,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2095,
+ "recipient": 2023,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2023,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2095,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-unique-rococo.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-unique-rococo.json
@@ -0,0 +1,207 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "rococo-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2037",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "acala-dev",
+ "balance": "1000000000000000000000",
+ "chainInitializer": [
+ "chainql",
+ "-e",
+ "(import '${spec}') {id+: '-local'}"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": "2004",
+ "balance": "1000000000000000000000",
+ "chain": "moonbeam-local",
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2037,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 2004,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2004,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-unique.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-unique.json
@@ -0,0 +1,199 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2037",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "acala-dev",
+ "balance": "1000000000000000000000",
+ "chainInitializer": [
+ "chainql",
+ "-e",
+ "(import '${spec}') {id+: '-local'}"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": "2004",
+ "balance": "1000000000000000000000",
+ "chain": "moonbeam-local",
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2037,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 2004,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2004,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/minBondFix.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/minBondFix.jsonnet
@@ -0,0 +1,10 @@
+function(spec)
+spec {
+ genesis+: {
+ runtime+: {
+ parachainStaking+: {
+ candidates: std.map(function(candidate) [candidate[0], candidate[1] * 1000], super.candidates)
+ },
+ },
+ },
+}
.envdiffbeforeafterboth--- a/.env
+++ b/.env
@@ -12,3 +12,16 @@
OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443
QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443
UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443
+
+POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec
+
+KARURA_BUILD_BRANCH=2.9.1
+ACALA_BUILD_BRANCH=2.9.2
+
+MOONRIVER_BUILD_BRANCH=runtime-1701
+MOONBEAM_BUILD_BRANCH=runtime-1701
+
+STATEMINE_BUILD_BRANCH=parachains-v9270
+STATEMINT_BUILD_BRANCH=release-parachains-v9230
+WESTMINT_BUILD_BRANCH=parachains-v9270
+
.github/workflows/dev-build-tests_v2.ymldiffbeforeafterboth--- a/.github/workflows/dev-build-tests_v2.yml
+++ b/.github/workflows/dev-build-tests_v2.yml
@@ -71,8 +71,8 @@
run: |
yarn install
yarn add mochawesome
+ node scripts/readyness.js
echo "Ready to start tests"
- node scripts/readyness.js
yarn polkadot-types
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
env:
@@ -95,3 +95,10 @@
- name: Stop running containers
if: always() # run this step always
run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker builder prune -f -a
+ docker system prune -f
+ docker image prune -f -a
\ No newline at end of file
.github/workflows/market-test_v2.ymldiffbeforeafterboth--- a/.github/workflows/market-test_v2.yml
+++ b/.github/workflows/market-test_v2.yml
@@ -45,7 +45,7 @@
repository: 'UniqueNetwork/market-e2e-tests'
ssh-key: ${{ secrets.GH_PAT }}
path: 'qa-tests'
- ref: 'ci_test_v2'
+ ref: 'master'
- name: Read .env file
uses: xom9ikk/dotenv@v1.0.2
@@ -142,7 +142,6 @@
with:
path: qa-tests/
-
- name: local-market:start
run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build
@@ -175,7 +174,6 @@
- name: Stop running containers
if: always() # run this step always
run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes
-# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/node-only-update_v2.ymldiffbeforeafterboth--- a/.github/workflows/node-only-update_v2.yml
+++ b/.github/workflows/node-only-update_v2.yml
@@ -10,7 +10,7 @@
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
- execution-marix:
+ nodes-execution-matrix:
name: execution matrix
@@ -42,8 +42,8 @@
- forkless-update-nodata:
- needs: execution-marix
+ nodes-only-update:
+ needs: nodes-execution-matrix
# The type of runner that the job will run on
runs-on: [self-hosted-ci,large]
@@ -57,7 +57,7 @@
strategy:
matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+ include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}}
steps:
@@ -156,12 +156,18 @@
exit 0
shell: bash
+ - name: Checkout at '${{ matrix.mainnet_branch }}' branch
+ uses: actions/checkout@master
+ with:
+ ref: ${{ matrix.mainnet_branch }} #Checking out head commit
+ path: ${{ matrix.mainnet_branch }}
+
+
- name: Run tests before Node Parachain upgrade
- working-directory: tests
+ working-directory: ${{ matrix.mainnet_branch }}/tests
run: |
yarn install
yarn add mochawesome
- node scripts/readyness.js
echo "Ready to start tests"
yarn polkadot-types
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
@@ -174,7 +180,7 @@
if: success() || failure() # run this step even if previous step failed
with:
name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
- path: tests/mochawesome-report/test-*.json # Path to test results
+ path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results
reporter: mochawesome-json
fail-on-error: 'false'
@@ -263,8 +269,9 @@
- name: Remove builder cache
if: always() # run this step always
run: |
- docker builder prune -f
+ docker builder prune -f -a
docker system prune -f
+ docker image prune -f -a
- name: Clean Workspace
if: always()
.github/workflows/try-runtime_v2.ymldiffbeforeafterboth--- a/.github/workflows/try-runtime_v2.yml
+++ b/.github/workflows/try-runtime_v2.yml
@@ -1,7 +1,6 @@
on:
workflow_call:
-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
try-runtime:
.github/workflows/xcm-testnet-build.ymldiffbeforeafterboth--- a/.github/workflows/xcm-testnet-build.yml
+++ /dev/null
@@ -1,151 +0,0 @@
-name: xcm-testnet-build
-
-# Controls when the action will run.
-on:
- workflow_call:
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-#Define Workflow variables
-env:
- REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
- runs-on: [XL]
- 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@v1.0.2
-
- - name: Create Execution matrix
- uses: fabiocaccamo/create-matrix-action@v2
- id: create_matrix
- with:
- matrix: |
- network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}
- network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}
- network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}
-
- xcm-build:
-
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [XL]
-
- timeout-minutes: 600
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
- steps:
- - name: Skip if pull request is in Draft
- if: github.event.pull_request.draft == true
- run: exit 1
-
- - name: Clean Workspace
- uses: AutoModality/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@v1.0.2
-
- - name: Generate ENV related extend Dockerfile file
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-xcm.j2
- output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- NETWORK=${{ matrix.network }}
- POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
- POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
- FEATURE=${{ matrix.features }}
- RUNTIME=${{ matrix.runtime }}
- BRANCH=${{ github.head_ref }}
- ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
- MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
- CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
-
- - name: Show build Dockerfile
- run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
-
- - name: Show launch-config-xcm-${{ matrix.network }} configuration
- run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
-
- - name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@2
- id: branchname
- with:
- source: ${{ github.head_ref }}
- find: '/'
- replace: '-'
-
- - name: Log in to Docker Hub
- uses: docker/login-action@v2.0.0
- with:
- username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
-
- - name: Pull acala docker image
- run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
-
- - name: Pull moonbeam docker image
- run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
-
- - name: Pull cumulus docker image
- run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
-
- - name: Pull polkadot docker image
- run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
-
- - name: Pull chainql docker image
- run: docker pull uniquenetwork/builder-chainql:latest
-
- - name: Build the stack
- run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .
-
- - name: Push docker image version
- run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
-
- - name: Push docker image latest
- run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker builder prune -f
- docker system prune -f
-
-
-
.github/workflows/xcm-tests_v2.ymldiffbeforeafterboth--- a/.github/workflows/xcm-tests_v2.yml
+++ /dev/null
@@ -1,175 +0,0 @@
-name: xcm-tests
-
-# Controls when the action will run.
-on:
- # Allows you to run this workflow manually from the Actions tab
- workflow_call:
-
-#Define Workflow variables
-env:
- REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
-# needs: [xcm-testnet-build]
-
- runs-on: XL
- 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@v1.0.2
-
- - name: Create Execution matrix
- uses: fabiocaccamo/create-matrix-action@v2
- id: create_matrix
- with:
- matrix: |
- network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}
- network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}
- network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}
-
- xcm-tests:
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [XL]
-
- timeout-minutes: 600
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
-
- steps:
- - name: Skip if pull request is in Draft
- if: github.event.pull_request.draft == true
- run: exit 1
-
- - name: Clean Workspace
- uses: AutoModality/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@v1.0.2
-
- - name: Generate ENV related extend file for docker-compose
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/docker-compose.tmp-xcm-tests.j2
- output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
- variables: |
- NETWORK=${{ matrix.network }}
-
- - name: Show build configuration
- run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
-
- - uses: actions/setup-node@v3
- with:
- node-version: 16
-
- - name: Build the stack
- run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ 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 xcm tests
- if: success()
- run: |
- counter=160
- function check_container_status {
- docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
- }
- function do_docker_logs {
- docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
- }
- function is_started {
- if [ "$(check_container_status)" == "true" ]; then
- echo "Container: xcm-${{ 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 xcm-${{ 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
-
- - name: Run XCM tests
- working-directory: tests
- run: |
- yarn install
- yarn add mochawesome
- node scripts/readyness.js
- echo "Ready to start tests"
- NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
-
- - name: XCM Test Report
- uses: phoenix-actions/test-reporting@v8
- id: test-report
- if: success() || failure() # run this step even if previous step failed
- with:
- name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created
- path: tests/mochawesome-report/test-*.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.xcm-tests.${{ matrix.network }}.yml" down
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker system prune -a -f
-
.github/workflows/xcm.ymldiffbeforeafterboth--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -1,19 +1,400 @@
-name: Nesting XCM
+name: xcm-testnet-build
+# Controls when the action will run.
on:
workflow_call:
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+#Define Workflow variables
+env:
+ REPO_URL: ${{ github.server_url }}/${{ github.repository }}
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
- xcm-testnet-build:
- name: testnet build
- uses: ./.github/workflows/xcm-testnet-build.yml
- secrets: inherit
+ prepare-execution-marix:
+
+ name: Prepare execution matrix
+
+ runs-on: [XL]
+ 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@v1.0.2
+
+ - name: Create Execution matrix
+ uses: fabiocaccamo/create-matrix-action@v2
+ id: create_matrix
+ with:
+ matrix: |
+ network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, runtest {testXcmOpal}
+ network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, runtest {testXcmQuartz}
+ network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, runtest {testXcmUnique}
+
+ xcm-build:
+
+ needs: prepare-execution-marix
+ # The type of runner that the job will run on
+ runs-on: [XL]
+
+ timeout-minutes: 600
+
+ name: ${{ matrix.network }}
+
+ continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
+
+ strategy:
+ matrix:
+ include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+
+ steps:
+ - name: Skip if pull request is in Draft
+ if: github.event.pull_request.draft == true
+ run: exit 1
+
+ - name: Clean Workspace
+ uses: AutoModality/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@v1.0.2
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@v2.0.0
+ with:
+ username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+
+ - name: Install jq
+ run: sudo apt install jq -y
+
+ # Check POLKADOT version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for POLKADOT
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-polkadot.j2
+ output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+
+ - name: Check if the dockerhub repository contains the needed version POLKADOT
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+ # Get TAGS from DOCKERHUB POLKADOT repository
+ POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "POLKADOT TAGS:"
+ echo $POLKADOT_TAGS
+ # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
+ if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed POLKADOT version";
+ docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+ else
+ echo "Repository has not needed POLKADOT version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} .
+ echo "Push needed POLKADOT version to the repository";
+ docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+ fi
+ shell: bash
+
+ # Check ACALA version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for ACALA
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-acala.j2
+ output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+
+ - name: Check if the dockerhub repository contains the needed ACALA version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "ACALA TAGS:"
+ echo $ACALA_TAGS
+ # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
+ if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed ACALA version";
+ docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
+ else
+ echo "Repository has not needed ACALA version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
+ echo "Push needed ACALA version to the repository";
+ docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
+ fi
+ shell: bash
+
+ # Check MOONBEAM version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for MOONBEAM
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-moonbeam.j2
+ output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+
+ - name: Check if the dockerhub repository contains the needed MOONBEAM version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "MOONBEAM TAGS:"
+ echo $MOONBEAM_TAGS
+ # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS
+ if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed MOONBEAM version";
+ docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+ else
+ echo "Repository has not needed MOONBEAM version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .
+ echo "Push needed MOONBEAM version to the repository";
+ docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+ fi
+ shell: bash
+
+
+ # Check CUMULUS version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for CUMULUS
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-cumulus.j2
+ output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+ - name: Check if the dockerhub repository contains the needed CUMULUS version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "CUMULUS TAGS:"
+ echo $CUMULUS_TAGS
+ # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS
+ if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed CUMULUS version";
+ docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+ else
+ echo "Repository has not needed CUMULUS version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .
+ echo "Push needed CUMULUS version to the repository";
+ docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+ fi
+ shell: bash
+
+
+ # Build main image for XCM
+ - name: Generate ENV related extend Dockerfile file
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-xcm.j2
+ output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ NETWORK=${{ matrix.network }}
+ POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+ POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
+ FEATURE=${{ matrix.features }}
+ RUNTIME=${{ matrix.runtime }}
+ BRANCH=${{ github.head_ref }}
+ ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+ MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+ CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+ - name: Show build Dockerfile
+ run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+
+ - name: Show launch-config-xcm-${{ matrix.network }} configuration
+ run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
+
+ - name: Run find-and-replace to remove slashes from branch name
+ uses: mad9000/actions-find-and-replace-string@2
+ id: branchname
+ with:
+ source: ${{ github.head_ref }}
+ find: '/'
+ replace: '-'
+
+ - name: Pull chainql docker image
+ run: docker pull uniquenetwork/builder-chainql:latest
+
+ - name: Build the stack
+ run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .
+
+ - name: Push docker image version
+ run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
+
+ - name: Push docker image latest
+ run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker builder prune -f
+ docker system prune -f
+
xcm-tests:
- name: tests
- needs: [ xcm-testnet-build ]
- uses: ./.github/workflows/xcm-tests_v2.yml
+ needs: [prepare-execution-marix, xcm-build]
+ # The type of runner that the job will run on
+ runs-on: [XL]
+
+ timeout-minutes: 600
+
+ name: ${{ matrix.network }}
+
+ continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
+
+ strategy:
+ matrix:
+ include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+
+ steps:
+ - name: Skip if pull request is in Draft
+ if: github.event.pull_request.draft == true
+ run: exit 1
+
+ - name: Clean Workspace
+ uses: AutoModality/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@v1.0.2
+
+ - name: Generate ENV related extend file for docker-compose
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/docker-compose.tmp-xcm-tests.j2
+ output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+ variables: |
+ NETWORK=${{ matrix.network }}
+ - name: Show build configuration
+ run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Build the stack
+ run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ 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 xcm tests
+ if: success()
+ run: |
+ counter=160
+ function check_container_status {
+ docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
+ }
+ function do_docker_logs {
+ docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
+ }
+ function is_started {
+ if [ "$(check_container_status)" == "true" ]; then
+ echo "Container: xcm-${{ 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 xcm-${{ 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
+
+ - name: Run XCM tests
+ working-directory: tests
+ run: |
+ yarn install
+ yarn add mochawesome
+ node scripts/readyness.js
+ echo "Ready to start tests"
+ yarn polkadot-types
+ NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
+ env:
+ RPC_URL: http://127.0.0.1:9933/
+
+ - name: XCM Test Report
+ uses: phoenix-actions/test-reporting@v8
+ id: test-report
+ if: success() || failure() # run this step even if previous step failed
+ with:
+ name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created
+ path: tests/mochawesome-report/test-*.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.xcm-tests.${{ matrix.network }}.yml" down
+
+ - name: Clean Workspace
+ if: always()
+ uses: AutoModality/action-clean@v1.1.0
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker system prune -a -f
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -697,6 +697,26 @@
]
[[package]]
+name = "bondrewd"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d1660fac8d3acced44dac64453fafedf5aab2de196b932c727e63e4ae42d1cc"
+dependencies = [
+ "bondrewd-derive",
+]
+
+[[package]]
+name = "bondrewd-derive"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "723da0dee1eef38edc021b0793f892bdc024500c6a5b0727a2efe16f0e0a6977"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "bounded-vec"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4586,6 +4606,16 @@
]
[[package]]
+name = "logtest"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb3e43a8657c1d64516dcc9db8ca03826a4aceaf89d5ce1b37b59f6ff0e43026"
+dependencies = [
+ "lazy_static",
+ "log",
+]
+
+[[package]]
name = "lru"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5163,8 +5193,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -5177,6 +5212,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -5282,6 +5318,53 @@
]
[[package]]
+name = "orml-tokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "orml-traits"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "impl-trait-for-tuples",
+ "num-traits",
+ "orml-utilities",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+]
+
+[[package]]
+name = "orml-utilities"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
name = "orml-vesting"
version = "0.4.1-dev"
source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
@@ -5297,6 +5380,41 @@
]
[[package]]
+name = "orml-xcm-support"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
+name = "orml-xtokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "cumulus-primitives-core",
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "orml-xcm-support",
+ "pallet-xcm",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
name = "os_str_bytes"
version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5791,6 +5909,34 @@
]
[[package]]
+name = "pallet-foreign-assets"
+version = "0.1.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "hex",
+ "log",
+ "orml-tokens",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-fungible",
+ "pallet-timestamp",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "serde_json",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+ "xcm",
+ "xcm-builder",
+ "xcm-executor",
+]
+
+[[package]]
name = "pallet-fungible"
version = "0.1.5"
dependencies = [
@@ -6475,7 +6621,7 @@
[[package]]
name = "pallet-unique"
-version = "0.1.4"
+version = "0.2.0"
dependencies = [
"ethereum",
"evm-coder",
@@ -8397,8 +8543,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -8411,6 +8562,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -12134,7 +12286,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
"digest 0.10.3",
"rand 0.8.5",
"static_assertions",
@@ -12391,8 +12543,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -12405,6 +12562,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -12497,6 +12655,7 @@
name = "up-data-structs"
version = "0.2.2"
dependencies = [
+ "bondrewd",
"derivative",
"frame-support",
"frame-system",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,9 +6,12 @@
'client/*',
'primitives/*',
'crates/*',
+ 'runtime/opal',
+ 'runtime/quartz',
+ 'runtime/unique',
'runtime/tests',
]
-exclude = ["runtime/unique", "runtime/quartz"]
+default-members = ['node/*', 'runtime/opal']
[profile.release]
panic = 'unwind'
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -128,9 +128,13 @@
bench-rmrk-equip:
make _bench PALLET=proxy-rmrk-equip
+.PHONY: bench-foreign-assets
+bench-foreign-assets:
+ make _bench PALLET=foreign-assets
+
.PHONY: bench-app-promotion
bench-app-promotion:
make _bench PALLET=app-promotion PALLET_DIR=app-promotion
.PHONY: bench
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip bench-foreign-assets
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -195,7 +195,7 @@
xtokens -> transfer
currencyId:
- ForeingAsset
+ ForeignAsset
<TOKEN_ID>
amount:
crates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -42,6 +42,7 @@
pascal_call_name: Ident,
snake_call_name: Ident,
via: Option<(Type, Ident)>,
+ condition: Option<Expr>,
}
impl Is {
fn expand_call_def(&self, gen_ref: &proc_macro2::TokenStream) -> proc_macro2::TokenStream {
@@ -64,8 +65,13 @@
generics: &proc_macro2::TokenStream,
) -> proc_macro2::TokenStream {
let pascal_call_name = &self.pascal_call_name;
+ let condition = self.condition.as_ref().map(|condition| {
+ quote! {
+ (#condition) &&
+ }
+ });
quote! {
- <#pascal_call_name #generics>::supports_interface(interface_id)
+ #condition <#pascal_call_name #generics>::supports_interface(this, interface_id)
}
}
@@ -93,8 +99,13 @@
.as_ref()
.map(|(_, i)| quote! {.#i()})
.unwrap_or_default();
+ let condition = self.condition.as_ref().map(|condition| {
+ quote! {
+ if ({let this = &self; (#condition)})
+ }
+ });
quote! {
- #call_name::#name(call) => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg {
+ #call_name::#name(call) #condition => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg {
call,
caller: c.caller,
value: c.value,
@@ -138,17 +149,50 @@
}
let name = input.parse::<Ident>()?;
let lookahead = input.lookahead1();
- let via = if lookahead.peek(syn::token::Paren) {
+
+ let mut condition: Option<Expr> = None;
+ let mut via: Option<(Type, Ident)> = None;
+
+ if lookahead.peek(syn::token::Paren) {
let contents;
parenthesized!(contents in input);
- let method = contents.parse::<Ident>()?;
- contents.parse::<Token![,]>()?;
- let ty = contents.parse::<Type>()?;
- Some((ty, method))
- } else if lookahead.peek(Token![,]) {
- None
- } else if input.is_empty() {
- None
+ let input = contents;
+
+ while !input.is_empty() {
+ let lookahead = input.lookahead1();
+ if lookahead.peek(Token![if]) {
+ input.parse::<Token![if]>()?;
+ let contents;
+ parenthesized!(contents in input);
+ let contents = contents.parse::<Expr>()?;
+
+ if condition.replace(contents).is_some() {
+ return Err(syn::Error::new(input.span(), "condition is already set"));
+ }
+ } else if lookahead.peek(kw::via) {
+ input.parse::<kw::via>()?;
+ let contents;
+ parenthesized!(contents in input);
+
+ let method = contents.parse::<Ident>()?;
+ contents.parse::<kw::returns>()?;
+ let ty = contents.parse::<Type>()?;
+
+ if via.replace((ty, method)).is_some() {
+ return Err(syn::Error::new(input.span(), "via is already set"));
+ }
+ } else {
+ return Err(lookahead.error());
+ }
+
+ if input.peek(Token![,]) {
+ input.parse::<Token![,]>()?;
+ } else if !input.is_empty() {
+ return Err(syn::Error::new(input.span(), "expected end"));
+ }
+ }
+ } else if lookahead.peek(Token![,]) || input.is_empty() {
+ // Pass
} else {
return Err(lookahead.error());
};
@@ -157,6 +201,7 @@
snake_call_name: pascal_ident_to_snake_call(&name),
name,
via,
+ condition,
});
if input.peek(Token![,]) {
input.parse::<Token![,]>()?;
@@ -495,6 +540,7 @@
syn::custom_keyword!(weight);
syn::custom_keyword!(via);
+ syn::custom_keyword!(returns);
syn::custom_keyword!(name);
syn::custom_keyword!(is);
syn::custom_keyword!(inline_is);
@@ -996,16 +1042,6 @@
#(#inline_interface_id)*
u32::to_be_bytes(interface_id)
}
- /// Is this contract implements specified ERC165 selector
- pub fn supports_interface(interface_id: ::evm_coder::types::bytes4) -> bool {
- interface_id != u32::to_be_bytes(0xffffff) && (
- interface_id == ::evm_coder::ERC165Call::INTERFACE_ID ||
- interface_id == Self::interface_id()
- #(
- || #supports_interface
- )*
- )
- }
/// Generate solidity definitions for methods described in this interface
pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) {
use evm_coder::solidity::*;
@@ -1024,7 +1060,7 @@
)*),
};
- let mut out = string::new();
+ let mut out = ::evm_coder::types::string::new();
if #solidity_name.starts_with("Inline") {
out.push_str("/// @dev inlined interface\n");
}
@@ -1062,6 +1098,20 @@
return Ok(None);
}
}
+ impl #generics #call_name #gen_ref
+ #gen_where
+ {
+ /// Is this contract implements specified ERC165 selector
+ pub fn supports_interface(this: &#name, interface_id: ::evm_coder::types::bytes4) -> bool {
+ interface_id != u32::to_be_bytes(0xffffff) && (
+ interface_id == ::evm_coder::ERC165Call::INTERFACE_ID ||
+ interface_id == Self::interface_id()
+ #(
+ || #supports_interface
+ )*
+ )
+ }
+ }
impl #generics ::evm_coder::Weighted for #call_name #gen_ref
#gen_where
{
@@ -1091,7 +1141,7 @@
)*
#call_name::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {interface_id}, _) => {
let mut writer = ::evm_coder::abi::AbiWriter::default();
- writer.bool(&<#call_name #gen_ref>::supports_interface(interface_id));
+ writer.bool(&<#call_name #gen_ref>::supports_interface(self, interface_id));
return Ok(writer.into());
}
_ => {},
@@ -1101,7 +1151,7 @@
#(
#call_variants_this,
)*
- _ => unreachable!()
+ _ => Err(::evm_coder::execution::Error::from("method is not available").into()),
}
}
}
crates/evm-coder/src/abi.rsdiffbeforeafterboth--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -313,7 +313,7 @@
/// Finish writer, concatenating all internal buffers
pub fn finish(mut self) -> Vec<u8> {
for (static_offset, part) in self.dynamic_part {
- let part_offset = self.static_part.len() - self.had_call.then(|| 4).unwrap_or(0);
+ let part_offset = self.static_part.len() - if self.had_call { 4 } else { 0 };
let encoded_dynamic_offset = usize::to_be_bytes(part_offset);
self.static_part[static_offset + ABI_ALIGNMENT - encoded_dynamic_offset.len()
crates/evm-coder/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -74,10 +74,10 @@
/// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))]
/// impl Contract {
/// /// Multiply two numbers
-/// /// @param a First number
-/// /// @param b Second number
-/// /// @return uint32 Product of two passed numbers
-/// /// @dev This function returns error in case of overflow
+/// /// @param a First number
+/// /// @param b Second number
+/// /// @return uint32 Product of two passed numbers
+/// /// @dev This function returns error in case of overflow
/// #[weight(200 + a + b)]
/// #[solidity_interface(rename_selector = "mul")]
/// fn mul(&mut self, a: uint32, b: uint32) -> Result<uint32> {
crates/evm-coder/tests/conditional_is.rsdiffbeforeafterboth--- /dev/null
+++ b/crates/evm-coder/tests/conditional_is.rs
@@ -0,0 +1,44 @@
+use evm_coder::{types::*, solidity_interface, execution::Result, Call};
+
+pub struct Contract(bool);
+
+#[solidity_interface(name = A)]
+impl Contract {
+ fn method_a() -> Result<void> {
+ Ok(())
+ }
+}
+
+#[solidity_interface(name = B)]
+impl Contract {
+ fn method_b() -> Result<void> {
+ Ok(())
+ }
+}
+
+#[solidity_interface(name = Contract, is(
+ A(if(this.0)),
+ B(if(!this.0)),
+))]
+impl Contract {}
+
+#[test]
+fn conditional_erc165() {
+ assert!(ContractCall::supports_interface(
+ &Contract(true),
+ ACall::METHOD_A
+ ));
+ assert!(!ContractCall::supports_interface(
+ &Contract(false),
+ ACall::METHOD_A
+ ));
+
+ assert!(ContractCall::supports_interface(
+ &Contract(false),
+ BCall::METHOD_B
+ ));
+ assert!(!ContractCall::supports_interface(
+ &Contract(true),
+ BCall::METHOD_B
+ ));
+}
crates/evm-coder/tests/generics.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/generics.rs
+++ b/crates/evm-coder/tests/generics.rs
@@ -17,7 +17,7 @@
use std::marker::PhantomData;
use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*};
-struct Generic<T>(PhantomData<T>);
+pub struct Generic<T>(PhantomData<T>);
#[solidity_interface(name = GenericIs)]
impl<T> Generic<T> {
crates/evm-coder/tests/random.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/random.rs
+++ b/crates/evm-coder/tests/random.rs
@@ -18,7 +18,7 @@
use evm_coder::{ToLog, execution::Result, solidity_interface, types::*, solidity, weight};
-struct Impls;
+pub struct Impls;
#[solidity_interface(name = OurInterface)]
impl Impls {
crates/evm-coder/tests/solidity_generation.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/solidity_generation.rs
+++ b/crates/evm-coder/tests/solidity_generation.rs
@@ -16,7 +16,7 @@
use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*};
-struct ERC20;
+pub struct ERC20;
#[solidity_interface(name = ERC20)]
impl ERC20 {
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -302,7 +302,7 @@
[dependencies]
futures = '0.3.17'
-log = '0.4.14'
+log = '0.4.16'
flexi_logger = "0.22.5"
parking_lot = '0.12.1'
clap = "3.1.2"
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -65,6 +65,14 @@
Unknown(String),
}
+#[cfg(not(feature = "unique-runtime"))]
+/// PARA_ID for Opal/Quartz
+const PARA_ID: u32 = 2095;
+
+#[cfg(feature = "unique-runtime")]
+/// PARA_ID for Unique
+const PARA_ID: u32 = 2037;
+
pub trait RuntimeIdentification {
fn runtime_id(&self) -> RuntimeId;
}
@@ -167,6 +175,7 @@
.collect(),
},
treasury: Default::default(),
+ tokens: TokensConfig { balances: vec![] },
sudo: SudoConfig {
key: Some($root_key),
},
@@ -235,7 +244,7 @@
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
- 1000
+ PARA_ID
)
},
// Bootnodes
@@ -250,7 +259,7 @@
// Extensions
Extensions {
relay_chain: "rococo-dev".into(),
- para_id: 1000,
+ para_id: PARA_ID,
},
)
}
@@ -303,7 +312,7 @@
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
- 1000
+ PARA_ID
)
},
// Bootnodes
@@ -318,7 +327,7 @@
// Extensions
Extensions {
relay_chain: "westend-local".into(),
- para_id: 1000,
+ para_id: PARA_ID,
},
)
}
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -66,8 +66,8 @@
pallet-common ={ default-features = false, path = "../common" }
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" }
-[dev-dependencies]
-pallet-evm-migration ={ default-features = false, path = "../evm-migration" }
+# [dev-dependencies]
################################################################################
pallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/benchmarking.rs
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -20,11 +20,10 @@
use crate::Pallet as PromototionPallet;
use sp_runtime::traits::Bounded;
-use sp_std::vec;
use frame_benchmarking::{benchmarks, account};
use frame_support::traits::OnInitialize;
-use frame_system::{Origin, RawOrigin};
+use frame_system::RawOrigin;
use pallet_unique::benchmarking::create_nft_collection;
use pallet_evm_migration::Pallet as EvmMigrationPallet;
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -594,14 +594,14 @@
last_id,
*income_acc.borrow(),
ExistenceRequirement::KeepAlive,
- )
- .and_then(|_| {
- Self::add_lock_balance(last_id, *income_acc.borrow())?;
- <TotalStaked<T>>::try_mutate(|staked| {
- staked
- .checked_add(&*income_acc.borrow())
- .ok_or(ArithmeticError::Overflow.into())
- })
+ )?;
+
+ Self::add_lock_balance(last_id, *income_acc.borrow())?;
+ <TotalStaked<T>>::try_mutate(|staked| -> DispatchResult {
+ *staked = staked
+ .checked_add(&*income_acc.borrow())
+ .ok_or(ArithmeticError::Overflow)?;
+ Ok(())
})?;
Self::deposit_event(Event::StakingRecalculation(
pallets/common/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/common/src/benchmarking.rs
+++ b/pallets/common/src/benchmarking.rs
@@ -19,8 +19,8 @@
use pallet_evm::account::CrossAccountId;
use frame_benchmarking::{benchmarks, account};
use up_data_structs::{
- CollectionMode, CreateCollectionData, CollectionId, Property, PropertyKey, PropertyValue,
- CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH,
+ CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey,
+ PropertyValue, CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH,
MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM,
};
use frame_support::{
@@ -116,7 +116,7 @@
create_collection_raw(
owner,
CollectionMode::NFT,
- |owner, data| <Pallet<T>>::init_collection(owner, data, true),
+ |owner, data| <Pallet<T>>::init_collection(owner, data, CollectionFlags::default()),
|h| h,
)
}
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -194,7 +194,7 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_collection_sponsor(&self) -> Result<(address, uint256)> {
+ fn collection_sponsor(&self) -> Result<(address, uint256)> {
let sponsor = match self.collection.sponsorship.sponsor() {
Some(sponsor) => sponsor,
None => return Ok(Default::default()),
@@ -406,9 +406,9 @@
true => {
let mut bv = OwnerRestrictedSet::new();
for i in collections {
- bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or(Error::Revert(
- "Can't convert address into collection id".into(),
- ))?)
+ bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| {
+ Error::Revert("Can't convert address into collection id".into())
+ })?)
.map_err(|_| "too many collections")?;
}
let mut nesting = permissions.nesting().clone();
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -70,6 +70,7 @@
COLLECTION_NUMBER_LIMIT,
Collection,
RpcCollection,
+ CollectionFlags,
CollectionId,
CreateItemData,
MAX_TOKEN_PREFIX_LENGTH,
@@ -252,9 +253,9 @@
}
/// Checks that the collection was created with, and must be operated upon through **Unique API**.
- /// Now check only the `external_collection` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error.
+ /// Now check only the `external` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error.
pub fn check_is_internal(&self) -> DispatchResult {
- if self.external_collection {
+ if self.flags.external {
return Err(<Error<T>>::CollectionIsExternal)?;
}
@@ -262,9 +263,9 @@
}
/// Checks that the collection was created with, and must be operated upon through an **assimilated API**.
- /// Now check only the `external_collection` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error.
+ /// Now check only the `external` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error.
pub fn check_is_external(&self) -> DispatchResult {
- if !self.external_collection {
+ if !self.flags.external {
return Err(<Error<T>>::CollectionIsInternal)?;
}
@@ -792,7 +793,7 @@
sponsorship,
limits,
permissions,
- external_collection,
+ flags,
} = <CollectionById<T>>::get(collection)?;
let token_property_permissions = <CollectionPropertyPermissions<T>>::get(collection)
@@ -822,7 +823,8 @@
permissions,
token_property_permissions,
properties,
- read_only: external_collection,
+ read_only: flags.external,
+ foreign: flags.foreign,
})
}
}
@@ -861,11 +863,11 @@
///
/// * `owner` - The owner of the collection.
/// * `data` - Description of the created collection.
- /// * `is_external` - Marks that collection managet by not "Unique network".
+ /// * `flags` - Extra flags to store.
pub fn init_collection(
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
- is_external: bool,
+ flags: CollectionFlags,
) -> Result<CollectionId, DispatchError> {
{
ensure!(
@@ -909,7 +911,7 @@
Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions)
})
.unwrap_or_else(|| Ok(CollectionPermissions::default()))?,
- external_collection: is_external,
+ flags,
};
let mut collection_properties = up_data_structs::CollectionProperties::get();
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -169,7 +169,7 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
+ fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
let sponsor =
Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
@@ -220,7 +220,7 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
+ fn sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
self.recorder().consume_sload()?;
Ok(<SponsoringRateLimit<T>>::get(contract_address)
@@ -273,7 +273,7 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
+ fn sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
self.recorder().consume_sload()?;
Ok(get_sponsoring_fee_limit::<T>(contract_address))
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -24,15 +20,12 @@
/// @dev inlined interface
contract ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -43,11 +36,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- public
- view
- returns (address)
- {
+ function contractOwner(address contractAddress) public view returns (address) {
require(false, stub_error);
contractAddress;
dummy;
@@ -105,13 +94,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- public
- view
- returns (Tuple0 memory)
- {
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) public view returns (Tuple0 memory) {
require(false, stub_error);
contractAddress;
dummy;
@@ -137,11 +122,7 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- public
- view
- returns (bool)
- {
+ function hasPendingSponsor(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -150,11 +131,7 @@
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function sponsoringEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -173,13 +150,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- public
- view
- returns (uint32)
- {
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) public view returns (uint32) {
require(false, stub_error);
contractAddress;
dummy;
@@ -194,9 +167,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- public
- {
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public {
require(false, stub_error);
contractAddress;
rateLimit;
@@ -211,9 +182,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- public
- {
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public {
require(false, stub_error);
contractAddress;
feeLimit;
@@ -224,13 +193,9 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- public
- view
- returns (uint256)
- {
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) public view returns (uint256) {
require(false, stub_error);
contractAddress;
dummy;
@@ -244,11 +209,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- public
- view
- returns (bool)
- {
+ function allowed(address contractAddress, address user) public view returns (bool) {
require(false, stub_error);
contractAddress;
user;
@@ -284,11 +245,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function allowlistEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
pallets/foreign-assets/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/Cargo.toml
@@ -0,0 +1,53 @@
+[package]
+name = "pallet-foreign-assets"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies]
+log = { version = "0.4.16", default-features = false }
+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.27", default-features = false }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", 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.27", default-features = false }
+pallet-common = { default-features = false, path = '../common' }
+pallet-fungible = { default-features = false, path = '../fungible' }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+#orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false }
+orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+
+[dev-dependencies]
+serde_json = "1.0.68"
+hex = { version = "0.4" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+
+[features]
+default = ["std"]
+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",
+ "pallet-balances/std",
+ "pallet-fungible/std",
+ "orml-tokens/std"
+]
+try-runtime = ["frame-support/try-runtime"]
+runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
\ No newline at end of file
pallets/foreign-assets/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/benchmarking.rs
@@ -0,0 +1,68 @@
+// 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/>.
+
+#![allow(missing_docs)]
+
+use super::{Config, Pallet, Call};
+use frame_benchmarking::{benchmarks, account};
+use frame_system::RawOrigin;
+use crate::AssetMetadata;
+use xcm::opaque::latest::Junction::Parachain;
+use xcm::VersionedMultiLocation;
+use frame_support::{
+ traits::{Currency},
+};
+use sp_std::boxed::Box;
+
+benchmarks! {
+ register_foreign_asset {
+ let owner: T::AccountId = account("user", 0, 1);
+ let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(1000).into());
+ let metadata: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name".into(),
+ symbol: "symbol".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let mut balance: <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance =
+ 4_000_000_000u32.into();
+ balance = balance * balance;
+ <T as Config>::Currency::make_free_balance_be(&owner,
+ balance);
+ }: _(RawOrigin::Root, owner, Box::new(location), Box::new(metadata))
+
+ update_foreign_asset {
+ let owner: T::AccountId = account("user", 0, 1);
+ let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(2000).into());
+ let metadata: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name".into(),
+ symbol: "symbol".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let metadata2: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name2".into(),
+ symbol: "symbol2".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let mut balance: <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance =
+ 4_000_000_000u32.into();
+ balance = balance * balance;
+ <T as Config>::Currency::make_free_balance_be(&owner, balance);
+ Pallet::<T>::register_foreign_asset(RawOrigin::Root.into(), owner, Box::new(location.clone()), Box::new(metadata))?;
+ }: _(RawOrigin::Root, 0, Box::new(location), Box::new(metadata2))
+}
pallets/foreign-assets/src/impl_fungibles.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/impl_fungibles.rs
@@ -0,0 +1,454 @@
+// 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/>.
+
+//! Implementations for fungibles trait.
+
+use super::*;
+use frame_system::Config as SystemConfig;
+
+use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence};
+use pallet_common::CollectionHandle;
+use pallet_fungible::FungibleHandle;
+use pallet_common::CommonCollectionOperations;
+use up_data_structs::budget::Value;
+use sp_runtime::traits::{CheckedAdd, CheckedSub};
+
+impl<T: Config> fungibles::Inspect<<T as SystemConfig>::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+{
+ type AssetId = AssetIds;
+ type Balance = BalanceOf<T>;
+
+ fn total_issuance(asset: Self::AssetId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible total_issuance");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::total_issuance()
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::total_issuance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => return Zero::zero(),
+ };
+ let collection_handle = match <CollectionHandle<T>>::try_get(target_collection_id) {
+ Ok(v) => v,
+ Err(_) => return Zero::zero(),
+ };
+ let collection = FungibleHandle::cast(collection_handle);
+ Self::Balance::try_from(collection.total_supply()).unwrap_or(Zero::zero())
+ }
+ }
+ }
+
+ fn minimum_balance(asset: Self::AssetId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible minimum_balance");
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::minimum_balance()
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::minimum_balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ AssetMetadatas::<T>::get(AssetIds::ForeignAssetId(fid))
+ .map(|x| x.minimal_balance)
+ .unwrap_or_else(Zero::zero)
+ }
+ }
+ }
+
+ fn balance(asset: Self::AssetId, who: &<T as SystemConfig>::AccountId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible balance");
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::balance(who).into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => return Zero::zero(),
+ };
+ let collection_handle = match <CollectionHandle<T>>::try_get(target_collection_id) {
+ Ok(v) => v,
+ Err(_) => return Zero::zero(),
+ };
+ let collection = FungibleHandle::cast(collection_handle);
+ Self::Balance::try_from(
+ collection.balance(T::CrossAccountId::from_sub(who.clone()), TokenId(0)),
+ )
+ .unwrap_or(Zero::zero())
+ }
+ }
+ }
+
+ fn reducible_balance(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ keep_alive: bool,
+ ) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible reducible_balance");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::reducible_balance(
+ who, keep_alive,
+ )
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::reducible_balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ keep_alive,
+ )
+ .into()
+ }
+ _ => Self::balance(asset, who),
+ }
+ }
+
+ fn can_deposit(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ mint: bool,
+ ) -> DepositConsequence {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_deposit");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::can_deposit(
+ who,
+ amount.into(),
+ mint,
+ )
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::can_deposit(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ mint,
+ )
+ }
+ _ => {
+ if amount.is_zero() {
+ return DepositConsequence::Success;
+ }
+
+ let extential_deposit_value = T::ExistentialDeposit::get();
+ let ed_value: u128 = match extential_deposit_value.try_into() {
+ Ok(val) => val,
+ Err(_) => return DepositConsequence::CannotCreate,
+ };
+ let extential_deposit: Self::Balance = match ed_value.try_into() {
+ Ok(val) => val,
+ Err(_) => return DepositConsequence::CannotCreate,
+ };
+
+ let new_total_balance = match Self::balance(asset, who).checked_add(&amount) {
+ Some(x) => x,
+ None => return DepositConsequence::Overflow,
+ };
+
+ if new_total_balance < extential_deposit {
+ return DepositConsequence::BelowMinimum;
+ }
+
+ DepositConsequence::Success
+ }
+ }
+ }
+
+ fn can_withdraw(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> WithdrawConsequence<Self::Balance> {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_withdraw");
+ let value: u128 = match amount.try_into() {
+ Ok(val) => val,
+ Err(_) => return WithdrawConsequence::UnknownAsset,
+ };
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ let this_amount: <T as pallet_balances::Config>::Balance = match value.try_into() {
+ Ok(val) => val,
+ Err(_) => {
+ return WithdrawConsequence::UnknownAsset;
+ }
+ };
+ match <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::can_withdraw(
+ who,
+ this_amount,
+ ) {
+ WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds,
+ WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie,
+ WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset,
+ WithdrawConsequence::Underflow => WithdrawConsequence::Underflow,
+ WithdrawConsequence::Overflow => WithdrawConsequence::Overflow,
+ WithdrawConsequence::Frozen => WithdrawConsequence::Frozen,
+ WithdrawConsequence::Success => WithdrawConsequence::Success,
+ _ => WithdrawConsequence::NoFunds,
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ let parent_amount: <T as orml_tokens::Config>::Balance = match value.try_into() {
+ Ok(val) => val,
+ Err(_) => {
+ return WithdrawConsequence::UnknownAsset;
+ }
+ };
+ match <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::can_withdraw(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ parent_amount,
+ ) {
+ WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds,
+ WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie,
+ WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset,
+ WithdrawConsequence::Underflow => WithdrawConsequence::Underflow,
+ WithdrawConsequence::Overflow => WithdrawConsequence::Overflow,
+ WithdrawConsequence::Frozen => WithdrawConsequence::Frozen,
+ WithdrawConsequence::Success => WithdrawConsequence::Success,
+ _ => WithdrawConsequence::NoFunds,
+ }
+ }
+ _ => match Self::balance(asset, who).checked_sub(&amount) {
+ Some(_) => WithdrawConsequence::Success,
+ None => WithdrawConsequence::NoFunds,
+ },
+ }
+ }
+}
+
+impl<T: Config> fungibles::Mutate<<T as SystemConfig>::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+ u128: From<BalanceOf<T>>,
+{
+ fn mint_into(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> DispatchResult {
+ //Self::do_mint(asset, who, amount, None)
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible mint_into {:?}", asset);
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Mutate<T::AccountId>>::mint_into(
+ who,
+ amount.into(),
+ )
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Mutate<T::AccountId>>::mint_into(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+ let account = T::CrossAccountId::from_sub(who.clone());
+
+ let amount_data: pallet_fungible::CreateItemData<T> =
+ (account.clone(), amount.into());
+
+ pallet_fungible::Pallet::<T>::create_item_foreign(
+ &collection,
+ &account,
+ amount_data,
+ &Value::new(0),
+ )?;
+
+ Ok(())
+ }
+ }
+ }
+
+ fn burn_from(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = DebitFlags { keep_alive: false, best_effort: false };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible burn_from");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ match <pallet_balances::Pallet<T> as fungible::Mutate<T::AccountId>>::burn_from(
+ who,
+ amount.into(),
+ ) {
+ Ok(v) => Ok(v.into()),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ match <orml_tokens::Pallet<T> as fungibles::Mutate<T::AccountId>>::burn_from(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ ) {
+ Ok(v) => Ok(v.into()),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+ pallet_fungible::Pallet::<T>::burn_foreign(
+ &collection,
+ &T::CrossAccountId::from_sub(who.clone()),
+ amount.into(),
+ )?;
+
+ Ok(amount)
+ }
+ }
+ }
+
+ fn slash(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = DebitFlags { keep_alive: false, best_effort: true };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible slash");
+ Ok(Self::burn_from(asset, who, amount)?)
+ }
+}
+
+impl<T: Config> fungibles::Transfer<T::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+ u128: From<BalanceOf<T>>,
+{
+ fn transfer(
+ asset: Self::AssetId,
+ source: &<T as SystemConfig>::AccountId,
+ dest: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ keep_alive: bool,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = TransferFlags { keep_alive, best_effort: false, burn_dust: false };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible transfer");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ match <pallet_balances::Pallet<T> as fungible::Transfer<T::AccountId>>::transfer(
+ source,
+ dest,
+ amount.into(),
+ keep_alive,
+ ) {
+ Ok(_) => Ok(amount),
+ Err(_) => Err(DispatchError::Other(
+ "Bad amount to relay chain value conversion",
+ )),
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ match <orml_tokens::Pallet<T> as fungibles::Transfer<T::AccountId>>::transfer(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ source,
+ dest,
+ amount.into(),
+ keep_alive,
+ ) {
+ Ok(_) => Ok(amount),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+
+ pallet_fungible::Pallet::<T>::transfer(
+ &collection,
+ &T::CrossAccountId::from_sub(source.clone()),
+ &T::CrossAccountId::from_sub(dest.clone()),
+ amount.into(),
+ &Value::new(0),
+ )?;
+
+ Ok(amount)
+ }
+ }
+ }
+}
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/lib.rs
@@ -0,0 +1,498 @@
+// 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/>.
+
+//! # Foreign assets
+//!
+//! - [`Config`]
+//! - [`Call`]
+//! - [`Pallet`]
+//!
+//! ## Overview
+//!
+//! The foreign assests pallet provides functions for:
+//!
+//! - Local and foreign assets management. The foreign assets can be updated without runtime upgrade.
+//! - Bounds between asset and target collection for cross chain transfer and inner transfers.
+//!
+//! ## Overview
+//!
+//! Under construction
+
+#![cfg_attr(not(feature = "std"), no_std)]
+#![allow(clippy::unused_unit)]
+
+use frame_support::{
+ dispatch::DispatchResult,
+ ensure,
+ pallet_prelude::*,
+ traits::{fungible, fungibles, Currency, EnsureOrigin},
+ RuntimeDebug,
+};
+use frame_system::pallet_prelude::*;
+use up_data_structs::{CollectionMode};
+use pallet_fungible::{Pallet as PalletFungible};
+use scale_info::{TypeInfo};
+use sp_runtime::{
+ traits::{One, Zero},
+ ArithmeticError,
+};
+use sp_std::{boxed::Box, vec::Vec};
+use up_data_structs::{CollectionId, TokenId, CreateCollectionData};
+
+// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the
+// MultiLocation in the future.
+use xcm::opaque::latest::prelude::XcmError;
+use xcm::{v1::MultiLocation, VersionedMultiLocation};
+use xcm_executor::{traits::WeightTrader, Assets};
+
+use pallet_common::erc::CrossAccountId;
+
+#[cfg(feature = "std")]
+use serde::{Deserialize, Serialize};
+
+// TODO: Move to primitives
+// Id of native currency.
+// 0 - QTZ\UNQ
+// 1 - KSM\DOT
+#[derive(
+ Clone,
+ Copy,
+ Eq,
+ PartialEq,
+ PartialOrd,
+ Ord,
+ MaxEncodedLen,
+ RuntimeDebug,
+ Encode,
+ Decode,
+ TypeInfo,
+)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub enum NativeCurrency {
+ Here = 0,
+ Parent = 1,
+}
+
+#[derive(
+ Clone,
+ Copy,
+ Eq,
+ PartialEq,
+ PartialOrd,
+ Ord,
+ MaxEncodedLen,
+ RuntimeDebug,
+ Encode,
+ Decode,
+ TypeInfo,
+)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub enum AssetIds {
+ ForeignAssetId(ForeignAssetId),
+ NativeAssetId(NativeCurrency),
+}
+
+pub trait TryAsForeign<T, F> {
+ fn try_as_foreign(asset: T) -> Option<F>;
+}
+
+impl TryAsForeign<AssetIds, ForeignAssetId> for AssetIds {
+ fn try_as_foreign(asset: AssetIds) -> Option<ForeignAssetId> {
+ match asset {
+ AssetIds::ForeignAssetId(id) => Some(id),
+ _ => None,
+ }
+ }
+}
+
+pub type ForeignAssetId = u32;
+pub type CurrencyId = AssetIds;
+
+mod impl_fungibles;
+pub mod weights;
+
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
+
+pub use module::*;
+pub use weights::WeightInfo;
+
+/// Type alias for currency balance.
+pub type BalanceOf<T> =
+ <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
+
+/// A mapping between ForeignAssetId and AssetMetadata.
+pub trait AssetIdMapping<ForeignAssetId, MultiLocation, AssetMetadata> {
+ /// Returns the AssetMetadata associated with a given ForeignAssetId.
+ fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option<AssetMetadata>;
+ /// Returns the MultiLocation associated with a given ForeignAssetId.
+ fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option<MultiLocation>;
+ /// Returns the CurrencyId associated with a given MultiLocation.
+ fn get_currency_id(multi_location: MultiLocation) -> Option<CurrencyId>;
+}
+
+pub struct XcmForeignAssetIdMapping<T>(sp_std::marker::PhantomData<T>);
+
+impl<T: Config> AssetIdMapping<ForeignAssetId, MultiLocation, AssetMetadata<BalanceOf<T>>>
+ for XcmForeignAssetIdMapping<T>
+{
+ fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option<AssetMetadata<BalanceOf<T>>> {
+ log::trace!(target: "fassets::asset_metadatas", "call");
+ Pallet::<T>::asset_metadatas(AssetIds::ForeignAssetId(foreign_asset_id))
+ }
+
+ fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option<MultiLocation> {
+ log::trace!(target: "fassets::get_multi_location", "call");
+ Pallet::<T>::foreign_asset_locations(foreign_asset_id)
+ }
+
+ fn get_currency_id(multi_location: MultiLocation) -> Option<CurrencyId> {
+ log::trace!(target: "fassets::get_currency_id", "call");
+ Some(AssetIds::ForeignAssetId(
+ Pallet::<T>::location_to_currency_ids(multi_location).unwrap_or(0),
+ ))
+ }
+}
+
+#[frame_support::pallet]
+pub mod module {
+ use super::*;
+
+ #[pallet::config]
+ pub trait Config:
+ frame_system::Config
+ + pallet_common::Config
+ + pallet_fungible::Config
+ + orml_tokens::Config
+ + pallet_balances::Config
+ {
+ /// The overarching event type.
+ type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
+
+ /// Currency type for withdraw and balance storage.
+ type Currency: Currency<Self::AccountId>;
+
+ /// Required origin for registering asset.
+ type RegisterOrigin: EnsureOrigin<Self::Origin>;
+
+ /// Weight information for the extrinsics in this module.
+ type WeightInfo: WeightInfo;
+ }
+
+ #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)]
+ pub struct AssetMetadata<Balance> {
+ pub name: Vec<u8>,
+ pub symbol: Vec<u8>,
+ pub decimals: u8,
+ pub minimal_balance: Balance,
+ }
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /// The given location could not be used (e.g. because it cannot be expressed in the
+ /// desired version of XCM).
+ BadLocation,
+ /// MultiLocation existed
+ MultiLocationExisted,
+ /// AssetId not exists
+ AssetIdNotExists,
+ /// AssetId exists
+ AssetIdExisted,
+ }
+
+ #[pallet::event]
+ #[pallet::generate_deposit(fn deposit_event)]
+ pub enum Event<T: Config> {
+ /// The foreign asset registered.
+ ForeignAssetRegistered {
+ asset_id: ForeignAssetId,
+ asset_address: MultiLocation,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The foreign asset updated.
+ ForeignAssetUpdated {
+ asset_id: ForeignAssetId,
+ asset_address: MultiLocation,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The asset registered.
+ AssetRegistered {
+ asset_id: AssetIds,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The asset updated.
+ AssetUpdated {
+ asset_id: AssetIds,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ }
+
+ /// Next available Foreign AssetId ID.
+ ///
+ /// NextForeignAssetId: ForeignAssetId
+ #[pallet::storage]
+ #[pallet::getter(fn next_foreign_asset_id)]
+ pub type NextForeignAssetId<T: Config> = StorageValue<_, ForeignAssetId, ValueQuery>;
+ /// The storages for MultiLocations.
+ ///
+ /// ForeignAssetLocations: map ForeignAssetId => Option<MultiLocation>
+ #[pallet::storage]
+ #[pallet::getter(fn foreign_asset_locations)]
+ pub type ForeignAssetLocations<T: Config> =
+ StorageMap<_, Twox64Concat, ForeignAssetId, MultiLocation, OptionQuery>;
+
+ /// The storages for CurrencyIds.
+ ///
+ /// LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>
+ #[pallet::storage]
+ #[pallet::getter(fn location_to_currency_ids)]
+ pub type LocationToCurrencyIds<T: Config> =
+ StorageMap<_, Twox64Concat, MultiLocation, ForeignAssetId, OptionQuery>;
+
+ /// The storages for AssetMetadatas.
+ ///
+ /// AssetMetadatas: map AssetIds => Option<AssetMetadata>
+ #[pallet::storage]
+ #[pallet::getter(fn asset_metadatas)]
+ pub type AssetMetadatas<T: Config> =
+ StorageMap<_, Twox64Concat, AssetIds, AssetMetadata<BalanceOf<T>>, OptionQuery>;
+
+ /// The storages for assets to fungible collection binding
+ ///
+ #[pallet::storage]
+ #[pallet::getter(fn asset_binding)]
+ pub type AssetBinding<T: Config> =
+ StorageMap<_, Twox64Concat, ForeignAssetId, CollectionId, OptionQuery>;
+
+ #[pallet::pallet]
+ #[pallet::without_storage_info]
+ pub struct Pallet<T>(_);
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T> {
+ #[pallet::weight(<T as Config>::WeightInfo::register_foreign_asset())]
+ pub fn register_foreign_asset(
+ origin: OriginFor<T>,
+ owner: T::AccountId,
+ location: Box<VersionedMultiLocation>,
+ metadata: Box<AssetMetadata<BalanceOf<T>>>,
+ ) -> DispatchResult {
+ T::RegisterOrigin::ensure_origin(origin.clone())?;
+
+ let location: MultiLocation = (*location)
+ .try_into()
+ .map_err(|()| Error::<T>::BadLocation)?;
+
+ let md = metadata.clone();
+ let name: Vec<u16> = md.name.into_iter().map(|x| x as u16).collect::<Vec<u16>>();
+ let mut description: Vec<u16> = "Foreign assets collection for "
+ .encode_utf16()
+ .collect::<Vec<u16>>();
+ description.append(&mut name.clone());
+
+ let data: CreateCollectionData<T::AccountId> = CreateCollectionData {
+ name: name.try_into().unwrap(),
+ description: description.try_into().unwrap(),
+ mode: CollectionMode::Fungible(md.decimals),
+ ..Default::default()
+ };
+
+ let bounded_collection_id = <PalletFungible<T>>::init_foreign_collection(
+ CrossAccountId::from_sub(owner),
+ data,
+ )?;
+ let foreign_asset_id =
+ Self::do_register_foreign_asset(&location, &metadata, bounded_collection_id)?;
+
+ Self::deposit_event(Event::<T>::ForeignAssetRegistered {
+ asset_id: foreign_asset_id,
+ asset_address: location,
+ metadata: *metadata,
+ });
+ Ok(())
+ }
+
+ #[pallet::weight(<T as Config>::WeightInfo::update_foreign_asset())]
+ pub fn update_foreign_asset(
+ origin: OriginFor<T>,
+ foreign_asset_id: ForeignAssetId,
+ location: Box<VersionedMultiLocation>,
+ metadata: Box<AssetMetadata<BalanceOf<T>>>,
+ ) -> DispatchResult {
+ T::RegisterOrigin::ensure_origin(origin)?;
+
+ let location: MultiLocation = (*location)
+ .try_into()
+ .map_err(|()| Error::<T>::BadLocation)?;
+ Self::do_update_foreign_asset(foreign_asset_id, &location, &metadata)?;
+
+ Self::deposit_event(Event::<T>::ForeignAssetUpdated {
+ asset_id: foreign_asset_id,
+ asset_address: location,
+ metadata: *metadata,
+ });
+ Ok(())
+ }
+ }
+}
+
+impl<T: Config> Pallet<T> {
+ fn get_next_foreign_asset_id() -> Result<ForeignAssetId, DispatchError> {
+ NextForeignAssetId::<T>::try_mutate(|current| -> Result<ForeignAssetId, DispatchError> {
+ let id = *current;
+ *current = current
+ .checked_add(One::one())
+ .ok_or(ArithmeticError::Overflow)?;
+ Ok(id)
+ })
+ }
+
+ fn do_register_foreign_asset(
+ location: &MultiLocation,
+ metadata: &AssetMetadata<BalanceOf<T>>,
+ bounded_collection_id: CollectionId,
+ ) -> Result<ForeignAssetId, DispatchError> {
+ let foreign_asset_id = Self::get_next_foreign_asset_id()?;
+ LocationToCurrencyIds::<T>::try_mutate(location, |maybe_currency_ids| -> DispatchResult {
+ ensure!(
+ maybe_currency_ids.is_none(),
+ Error::<T>::MultiLocationExisted
+ );
+ *maybe_currency_ids = Some(foreign_asset_id);
+ // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id));
+
+ ForeignAssetLocations::<T>::try_mutate(
+ foreign_asset_id,
+ |maybe_location| -> DispatchResult {
+ ensure!(maybe_location.is_none(), Error::<T>::MultiLocationExisted);
+ *maybe_location = Some(location.clone());
+
+ AssetMetadatas::<T>::try_mutate(
+ AssetIds::ForeignAssetId(foreign_asset_id),
+ |maybe_asset_metadatas| -> DispatchResult {
+ ensure!(maybe_asset_metadatas.is_none(), Error::<T>::AssetIdExisted);
+ *maybe_asset_metadatas = Some(metadata.clone());
+ Ok(())
+ },
+ )
+ },
+ )?;
+
+ AssetBinding::<T>::try_mutate(foreign_asset_id, |collection_id| -> DispatchResult {
+ *collection_id = Some(bounded_collection_id);
+ Ok(())
+ })
+ })?;
+
+ Ok(foreign_asset_id)
+ }
+
+ fn do_update_foreign_asset(
+ foreign_asset_id: ForeignAssetId,
+ location: &MultiLocation,
+ metadata: &AssetMetadata<BalanceOf<T>>,
+ ) -> DispatchResult {
+ ForeignAssetLocations::<T>::try_mutate(
+ foreign_asset_id,
+ |maybe_multi_locations| -> DispatchResult {
+ let old_multi_locations = maybe_multi_locations
+ .as_mut()
+ .ok_or(Error::<T>::AssetIdNotExists)?;
+
+ AssetMetadatas::<T>::try_mutate(
+ AssetIds::ForeignAssetId(foreign_asset_id),
+ |maybe_asset_metadatas| -> DispatchResult {
+ ensure!(
+ maybe_asset_metadatas.is_some(),
+ Error::<T>::AssetIdNotExists
+ );
+
+ // modify location
+ if location != old_multi_locations {
+ LocationToCurrencyIds::<T>::remove(old_multi_locations.clone());
+ LocationToCurrencyIds::<T>::try_mutate(
+ location,
+ |maybe_currency_ids| -> DispatchResult {
+ ensure!(
+ maybe_currency_ids.is_none(),
+ Error::<T>::MultiLocationExisted
+ );
+ // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id));
+ *maybe_currency_ids = Some(foreign_asset_id);
+ Ok(())
+ },
+ )?;
+ }
+ *maybe_asset_metadatas = Some(metadata.clone());
+ *old_multi_locations = location.clone();
+ Ok(())
+ },
+ )
+ },
+ )
+ }
+}
+
+pub use frame_support::{
+ traits::{
+ fungibles::{Balanced, CreditOf},
+ tokens::currency::Currency as CurrencyT,
+ OnUnbalanced as OnUnbalancedT,
+ },
+ weights::{WeightToFeePolynomial, WeightToFee},
+};
+
+pub struct FreeForAll<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+>(
+ Weight,
+ Currency::Balance,
+ PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
+);
+
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > WeightTrader for FreeForAll<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn new() -> Self {
+ Self(0, Zero::zero(), PhantomData)
+ }
+
+ fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
+ log::trace!(target: "fassets::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment);
+ Ok(payment)
+ }
+}
+impl<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced> Drop
+ for FreeForAll<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+where
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+{
+ fn drop(&mut self) {
+ OnUnbalanced::on_unbalanced(Currency::issue(self.1));
+ }
+}
pallets/foreign-assets/src/weights.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/weights.rs
@@ -0,0 +1,94 @@
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
+
+//! Autogenerated weights for pallet_foreign_assets
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2022-09-16, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
+
+// Executed Command:
+// target/release/unique-collator
+// benchmark
+// pallet
+// --pallet
+// pallet-foreign-assets
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
+// --steps=50
+// --repeat=80
+// --heap-pages=4096
+// --output=./pallets/foreign-assets/src/weights.rs
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+#![allow(clippy::unnecessary_cast)]
+
+use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use sp_std::marker::PhantomData;
+
+/// Weight functions needed for pallet_foreign_assets.
+pub trait WeightInfo {
+ fn register_foreign_asset() -> Weight;
+ fn update_foreign_asset() -> Weight;
+}
+
+/// Weights for pallet_foreign_assets using the Substrate node and recommended hardware.
+pub struct SubstrateWeight<T>(PhantomData<T>);
+impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: ForeignAssets NextForeignAssetId (r:1 w:1)
+ // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1)
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ // Storage: ForeignAssets AssetBinding (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ fn register_foreign_asset() -> Weight {
+ (52_161_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(9 as Weight))
+ .saturating_add(T::DbWeight::get().writes(11 as Weight))
+ }
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ fn update_foreign_asset() -> Weight {
+ (19_111_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
+
+// For backwards compatibility and tests
+impl WeightInfo for () {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: ForeignAssets NextForeignAssetId (r:1 w:1)
+ // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1)
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ // Storage: ForeignAssets AssetBinding (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ fn register_foreign_asset() -> Weight {
+ (52_161_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(9 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(11 as Weight))
+ }
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ fn update_foreign_asset() -> Weight {
+ (19_111_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(2 as Weight))
+ }
+}
pallets/fungible/src/erc.rsdiffbeforeafterboth--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -199,7 +199,7 @@
ERC20,
ERC20Mintable,
ERC20UniqueExtensions,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
)
)]
impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
pallets/fungible/src/lib.rsdiffbeforeafterboth--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -83,8 +83,8 @@
use frame_support::{ensure};
use pallet_evm::account::CrossAccountId;
use up_data_structs::{
- AccessMode, CollectionId, TokenId, CreateCollectionData, mapping::TokenAddressMapping,
- budget::Budget,
+ AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData,
+ mapping::TokenAddressMapping, budget::Budget,
};
use pallet_common::{
Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
@@ -212,9 +212,25 @@
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, false)
+ <PalletCommon<T>>::init_collection(owner, data, CollectionFlags::default())
}
+ /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
+ pub fn init_foreign_collection(
+ owner: T::CrossAccountId,
+ data: CreateCollectionData<T::AccountId>,
+ ) -> Result<CollectionId, DispatchError> {
+ let id = <PalletCommon<T>>::init_collection(
+ owner,
+ data,
+ CollectionFlags {
+ foreign: true,
+ ..Default::default()
+ },
+ )?;
+ Ok(id)
+ }
+
/// Destroys a collection.
pub fn destroy_collection(
collection: FungibleHandle<T>,
@@ -257,6 +273,9 @@
.checked_sub(amount)
.ok_or(<CommonError<T>>::TokenValueTooLow)?;
+ // Foreign collection check
+ ensure!(!collection.flags.foreign, <CommonError<T>>::NoPermission);
+
if collection.permissions.access() == AccessMode::AllowList {
collection.check_allowlist(owner)?;
}
@@ -288,6 +307,46 @@
Ok(())
}
+ /// Burns the specified amount of the token.
+ pub fn burn_foreign(
+ collection: &FungibleHandle<T>,
+ owner: &T::CrossAccountId,
+ amount: u128,
+ ) -> DispatchResult {
+ let total_supply = <TotalSupply<T>>::get(collection.id)
+ .checked_sub(amount)
+ .ok_or(<CommonError<T>>::TokenValueTooLow)?;
+
+ let balance = <Balance<T>>::get((collection.id, owner))
+ .checked_sub(amount)
+ .ok_or(<CommonError<T>>::TokenValueTooLow)?;
+ // =========
+
+ if balance == 0 {
+ <Balance<T>>::remove((collection.id, owner));
+ <PalletStructure<T>>::unnest_if_nested(owner, collection.id, TokenId::default());
+ } else {
+ <Balance<T>>::insert((collection.id, owner), balance);
+ }
+ <TotalSupply<T>>::insert(collection.id, total_supply);
+
+ <PalletEvm<T>>::deposit_log(
+ ERC20Events::Transfer {
+ from: *owner.as_eth(),
+ to: H160::default(),
+ value: amount.into(),
+ }
+ .to_log(collection_id_to_address(collection.id)),
+ );
+ <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(
+ collection.id,
+ TokenId::default(),
+ owner.clone(),
+ amount,
+ ));
+ Ok(())
+ }
+
/// Transfers the specified amount of tokens. Will check that
/// the transfer is allowed for the token.
///
@@ -366,25 +425,14 @@
}
/// Minting tokens for multiple IDs.
- /// See [`create_item`][`Pallet::create_item`] for more details.
- pub fn create_multiple_items(
+ /// It is a utility function used in [`create_multiple_items`][`Pallet::create_multiple_items`]
+ /// and [`create_multiple_items_foreign`][`Pallet::create_multiple_items_foreign`]
+ pub fn create_multiple_items_common(
collection: &FungibleHandle<T>,
sender: &T::CrossAccountId,
data: BTreeMap<T::CrossAccountId, u128>,
nesting_budget: &dyn Budget,
) -> DispatchResult {
- if !collection.is_owner_or_admin(sender) {
- ensure!(
- collection.permissions.mint_mode(),
- <CommonError<T>>::PublicMintingNotAllowed
- );
- collection.check_allowlist(sender)?;
-
- for (owner, _) in data.iter() {
- collection.check_allowlist(owner)?;
- }
- }
-
let total_supply = data
.iter()
.map(|(_, v)| *v)
@@ -442,6 +490,43 @@
Ok(())
}
+ /// Minting tokens for multiple IDs.
+ /// See [`create_item`][`Pallet::create_item`] for more details.
+ pub fn create_multiple_items(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: BTreeMap<T::CrossAccountId, u128>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ // Foreign collection check
+ ensure!(!collection.flags.foreign, <CommonError<T>>::NoPermission);
+
+ if !collection.is_owner_or_admin(sender) {
+ ensure!(
+ collection.permissions.mint_mode(),
+ <CommonError<T>>::PublicMintingNotAllowed
+ );
+ collection.check_allowlist(sender)?;
+
+ for (owner, _) in data.iter() {
+ collection.check_allowlist(owner)?;
+ }
+ }
+
+ Self::create_multiple_items_common(collection, sender, data, nesting_budget)
+ }
+
+ /// Minting tokens for multiple IDs.
+ /// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details.
+ pub fn create_multiple_items_foreign(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: BTreeMap<T::CrossAccountId, u128>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ Self::create_multiple_items_common(collection, sender, data, nesting_budget)
+ }
+
fn set_allowance_unchecked(
collection: &FungibleHandle<T>,
owner: &T::CrossAccountId,
@@ -615,6 +700,24 @@
)
}
+ /// Creates fungible token.
+ ///
+ /// - `data`: Contains user who will become the owners of the tokens and amount
+ /// of tokens he will receive.
+ pub fn create_item_foreign(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: CreateItemData<T>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ Self::create_multiple_items_foreign(
+ collection,
+ sender,
+ [(data.0, data.1)].into_iter().collect(),
+ nesting_budget,
+ )
+ }
+
/// Returns 10 tokens owners in no particular order
///
/// There is no direct way to get token holders in ascending order,
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -22,7 +18,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -30,9 +26,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -58,11 +52,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -95,6 +85,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -124,9 +115,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple6 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple6 memory) {
require(false, stub_error);
dummy;
return Tuple6(0x0000000000000000000000000000000000000000, 0);
@@ -234,9 +225,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -353,9 +342,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -450,11 +439,7 @@
/// @dev inlined interface
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev the ERC-165 identifier for this interface is 0x942e8b22
@@ -537,11 +522,7 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- public
- view
- returns (uint256)
- {
+ function allowance(address owner, address spender) public view returns (uint256) {
require(false, stub_error);
owner;
spender;
@@ -550,11 +531,4 @@
}
}
-contract UniqueFungible is
- Dummy,
- ERC165,
- ERC20,
- ERC20Mintable,
- ERC20UniqueExtensions,
- Collection
-{}
+contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -736,7 +736,7 @@
ERC721UniqueExtensions,
ERC721Mintable,
ERC721Burnable,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
TokenProperties,
)
)]
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -100,10 +100,10 @@
weights::{PostDispatchInfo, Pays},
};
use up_data_structs::{
- AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
- mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission, PropertyKey,
- PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty, TokenChild,
- AuxPropertyValue,
+ AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData,
+ CreateNftExData, mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission,
+ PropertyKey, PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty,
+ TokenChild, AuxPropertyValue,
};
use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use pallet_common::{
@@ -408,7 +408,14 @@
data: CreateCollectionData<T::AccountId>,
is_external: bool,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, is_external)
+ <PalletCommon<T>>::init_collection(
+ owner,
+ data,
+ CollectionFlags {
+ external: is_external,
+ ..Default::default()
+ },
+ )
}
/// Destroy NFT collection
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -605,10 +590,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -623,10 +605,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -661,11 +640,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -728,21 +703,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -870,11 +833,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -785,7 +785,7 @@
ERC721UniqueExtensions,
ERC721Mintable,
ERC721Burnable,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
TokenProperties,
)
)]
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -112,10 +112,10 @@
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use up_data_structs::{
- AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec,
- CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH,
- MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission,
- PropertyScope, PropertyValue, TokenId, TrySetProperty,
+ AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionFlags,
+ CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping,
+ MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission,
+ PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty,
};
use frame_support::BoundedBTreeMap;
use derivative::Derivative;
@@ -375,7 +375,7 @@
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, false)
+ <PalletCommon<T>>::init_collection(owner, data, CollectionFlags::default())
}
/// Destroy RFT collection
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -607,10 +592,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -625,10 +607,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -675,11 +654,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -740,21 +715,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -880,11 +843,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -72,11 +68,7 @@
/// @dev inlined interface
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -188,11 +180,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- public
- view
- returns (uint256)
- {
+ function allowance(address owner, address spender) public view returns (uint256) {
require(false, stub_error);
owner;
spender;
@@ -201,10 +189,4 @@
}
}
-contract UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -25,7 +25,7 @@
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
-log = { version = "0.4.14", default-features = false }
+log = { version = "0.4.16", default-features = false }
[dev-dependencies]
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -27,6 +27,7 @@
struct-versioning = { path = "../../crates/struct-versioning" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
rmrk-traits = { default-features = false, path = "../rmrk-traits" }
+bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
[features]
default = ["std"]
primitives/data-structs/src/bondrewd_codec.rsdiffbeforeafterboth--- /dev/null
+++ b/primitives/data-structs/src/bondrewd_codec.rs
@@ -0,0 +1,31 @@
+//! Integration between bondrewd and parity scale codec
+//! Maybe we can move it to scale-codec itself in future?
+
+#[macro_export]
+macro_rules! bondrewd_codec {
+ ($T:ty) => {
+ impl Encode for $T {
+ fn encode_to<O: codec::Output + ?Sized>(&self, dest: &mut O) {
+ dest.write(&self.into_bytes())
+ }
+ }
+ impl codec::Decode for $T {
+ fn decode<I: codec::Input + ?Sized>(from: &mut I) -> Result<Self, codec::Error> {
+ let mut bytes = [0; Self::BYTE_SIZE];
+ from.read(&mut bytes)?;
+ Ok(Self::from_bytes(bytes))
+ }
+ }
+ impl MaxEncodedLen for $T {
+ fn max_encoded_len() -> usize {
+ Self::BYTE_SIZE
+ }
+ }
+ impl TypeInfo for $T {
+ type Identity = [u8; Self::BYTE_SIZE];
+ fn type_info() -> scale_info::Type {
+ <[u8; Self::BYTE_SIZE] as TypeInfo>::type_info()
+ }
+ }
+ };
+}
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -36,6 +36,7 @@
use sp_core::U256;
use sp_runtime::{ArithmeticError, sp_std::prelude::Vec, Permill};
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
+use bondrewd::Bitfields;
use frame_support::{BoundedVec, traits::ConstU32};
use derivative::Derivative;
use scale_info::TypeInfo;
@@ -54,6 +55,7 @@
FixedPart as RmrkFixedPart, SlotPart as RmrkSlotPart,
};
+mod bondrewd_codec;
mod bounded;
pub mod budget;
pub mod mapping;
@@ -357,6 +359,21 @@
pub type CollectionDescription = BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>;
pub type CollectionTokenPrefix = BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>;
+#[derive(Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
+#[bondrewd(enforce_bytes = 1)]
+pub struct CollectionFlags {
+ /// Tokens in foreign collections can be transferred, but not burnt
+ #[bondrewd(bits = "0..1")]
+ pub foreign: bool,
+ /// External collections can't be managed using `unique` api
+ #[bondrewd(bits = "7..8")]
+ pub external: bool,
+
+ #[bondrewd(reserve, bits = "1..7")]
+ pub reserved: u8,
+}
+bondrewd_codec!(CollectionFlags);
+
/// Base structure for represent collection.
///
/// Used to provide basic functionality for all types of collections.
@@ -404,9 +421,8 @@
#[version(2.., upper(Default::default()))]
pub permissions: CollectionPermissions,
- /// Marks that this collection is not "unique", and managed from external.
- #[version(2.., upper(false))]
- pub external_collection: bool,
+ #[version(2.., upper(Default::default()))]
+ pub flags: CollectionFlags,
#[version(..2)]
pub variable_on_chain_schema: BoundedVec<u8, ConstU32<VARIABLE_ON_CHAIN_SCHEMA_LIMIT>>,
@@ -454,6 +470,9 @@
/// Is collection read only.
pub read_only: bool,
+
+ /// Is collection is foreign.
+ pub foreign: bool,
}
/// Data used for create collection.
primitives/data-structs/src/migration.rsdiffbeforeafterboth--- a/primitives/data-structs/src/migration.rs
+++ b/primitives/data-structs/src/migration.rs
@@ -38,3 +38,26 @@
test_to_option(SponsoringRateLimit::SponsoringDisabled);
test_to_option(SponsoringRateLimit::Blocks(10));
}
+
+#[test]
+fn collection_flags_have_same_encoding_as_bool() {
+ use crate::CollectionFlags;
+ use codec::Encode;
+
+ assert_eq!(
+ true.encode(),
+ CollectionFlags {
+ external: true,
+ ..Default::default()
+ }
+ .encode()
+ );
+ assert_eq!(
+ false.encode(),
+ CollectionFlags {
+ external: false,
+ ..Default::default()
+ }
+ .encode()
+ );
+}
runtime/common/config/orml.rsdiffbeforeafterboth--- a/runtime/common/config/orml.rs
+++ b/runtime/common/config/orml.rs
@@ -14,19 +14,87 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-use frame_support::parameter_types;
+use frame_support::{
+ parameter_types,
+ traits::{Contains, Everything},
+ weights::Weight,
+};
use frame_system::EnsureSigned;
-use crate::{Runtime, Event, RelayChainBlockNumberProvider};
+use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};
+use sp_runtime::traits::Convert;
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId};
+use xcm_builder::LocationInverter;
+use xcm_executor::XcmExecutor;
+use sp_std::{vec, vec::Vec};
+use pallet_foreign_assets::{CurrencyId, NativeCurrency};
+use crate::{
+ Runtime, Event, RelayChainBlockNumberProvider,
+ runtime_common::config::{
+ xcm::{
+ SelfLocation, Weigher, XcmConfig, Ancestry,
+ xcm_assets::{CurrencyIdConvert},
+ },
+ pallets::TreasuryAccountId,
+ substrate::{MaxLocks, MaxReserves},
+ },
+};
+
use up_common::{
types::{AccountId, Balance},
constants::*,
};
+// Signed version of balance
+pub type Amount = i128;
+
parameter_types! {
pub const MinVestedTransfer: Balance = 10 * UNIQUE;
pub const MaxVestingSchedules: u32 = 28;
+
+ pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this
+ pub const MaxAssetsForTransfer: usize = 2;
+}
+
+parameter_type_with_key! {
+ pub ParachainMinFee: |_location: MultiLocation| -> Option<u128> {
+ Some(100_000_000_000)
+ };
+}
+
+parameter_type_with_key! {
+ pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance {
+ match currency_id {
+ CurrencyId::NativeAssetId(symbol) => match symbol {
+ NativeCurrency::Here => 0,
+ NativeCurrency::Parent=> 0,
+ },
+ _ => 100_000
+ }
+ };
+}
+
+pub fn get_all_module_accounts() -> Vec<AccountId> {
+ vec![TreasuryAccountId::get()]
}
+pub struct DustRemovalWhitelist;
+impl Contains<AccountId> for DustRemovalWhitelist {
+ fn contains(a: &AccountId) -> bool {
+ get_all_module_accounts().contains(a)
+ }
+}
+
+pub struct AccountIdToMultiLocation;
+impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
+ fn convert(account: AccountId) -> MultiLocation {
+ X1(AccountId32 {
+ network: NetworkId::Any,
+ id: account.into(),
+ })
+ .into()
+ }
+}
+
impl orml_vesting::Config for Runtime {
type Event = Event;
type Currency = pallet_balances::Pallet<Runtime>;
@@ -36,3 +104,38 @@
type MaxVestingSchedules = MaxVestingSchedules;
type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
}
+
+impl orml_tokens::Config for Runtime {
+ type Event = Event;
+ type Balance = Balance;
+ type Amount = Amount;
+ type CurrencyId = CurrencyId;
+ type WeightInfo = ();
+ type ExistentialDeposits = ExistentialDeposits;
+ type OnDust = orml_tokens::TransferDust<Runtime, TreasuryAccountId>;
+ type MaxLocks = MaxLocks;
+ type MaxReserves = MaxReserves;
+ // TODO: Add all module accounts
+ type DustRemovalWhitelist = DustRemovalWhitelist;
+ /// The id type for named reserves.
+ type ReserveIdentifier = ();
+ type OnNewTokenAccount = ();
+ type OnKilledTokenAccount = ();
+}
+
+impl orml_xtokens::Config for Runtime {
+ type Event = Event;
+ type Balance = Balance;
+ type CurrencyId = CurrencyId;
+ type CurrencyIdConvert = CurrencyIdConvert;
+ type AccountIdToMultiLocation = AccountIdToMultiLocation;
+ type SelfLocation = SelfLocation;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type Weigher = Weigher;
+ type BaseXcmWeight = BaseXcmWeight;
+ type LocationInverter = LocationInverter<Ancestry>;
+ type MaxAssetsForTransfer = MaxAssetsForTransfer;
+ type MinXcmFee = ParachainMinFee;
+ type MultiLocationsFilter = Everything;
+ type ReserveProvider = AbsoluteReserveProvider;
+}
runtime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/pallets/foreign_asset.rs
@@ -0,0 +1,9 @@
+use crate::{Runtime, Event, Balances};
+use up_common::types::AccountId;
+
+impl pallet_foreign_assets::Config for Runtime {
+ type Event = Event;
+ type Currency = Balances;
+ type RegisterOrigin = frame_system::EnsureRoot<AccountId>;
+ type WeightInfo = pallet_foreign_assets::weights::SubstrateWeight<Self>;
+}
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,6 +40,9 @@
#[cfg(feature = "scheduler")]
pub mod scheduler;
+#[cfg(feature = "foreign-assets")]
+pub mod foreign_asset;
+
#[cfg(feature = "app-promotion")]
pub mod app_promotion;
runtime/common/config/xcm.rsdiffbeforeafterboth--- a/runtime/common/config/xcm.rs
+++ /dev/null
@@ -1,302 +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/>.
-
-use frame_support::{
- traits::{
- tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything,
- },
- weights::{Weight, WeightToFeePolynomial, WeightToFee},
- parameter_types, match_types,
-};
-use frame_system::EnsureRoot;
-use sp_runtime::{
- traits::{Saturating, CheckedConversion, Zero},
- SaturatedConversion,
-};
-use pallet_xcm::XcmPassthrough;
-use polkadot_parachain::primitives::Sibling;
-use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};
-use xcm::latest::{
- AssetId::{Concrete},
- Fungibility::Fungible as XcmFungible,
- MultiAsset, Error as XcmError,
-};
-use xcm_executor::traits::{MatchesFungible, WeightTrader};
-use xcm_builder::{
- AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
- FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative,
- SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
- SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset,
-};
-use xcm_executor::{Config, XcmExecutor, Assets};
-use sp_std::marker::PhantomData;
-use crate::{
- Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue,
-};
-use up_common::{
- types::{AccountId, Balance},
- constants::*,
-};
-
-parameter_types! {
- pub const RelayLocation: MultiLocation = MultiLocation::parent();
- pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
- pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
- pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
-}
-
-/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
-/// when determining ownership of accounts for asset transacting and when attempting to use XCM
-/// `Transact` in order to determine the dispatch Origin.
-pub type LocationToAccountId = (
- // The parent (Relay-chain) origin converts to the default `AccountId`.
- ParentIsPreset<AccountId>,
- // Sibling parachain origins convert to AccountId via the `ParaId::into`.
- SiblingParachainConvertsVia<Sibling, AccountId>,
- // Straight up local `AccountId32` origins just alias directly to `AccountId`.
- AccountId32Aliases<RelayNetwork, AccountId>,
-);
-
-pub struct OnlySelfCurrency;
-impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {
- fn matches_fungible(a: &MultiAsset) -> Option<B> {
- match (&a.id, &a.fun) {
- (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount),
- _ => None,
- }
- }
-}
-
-/// Means for transacting assets on this chain.
-pub type LocalAssetTransactor = CurrencyAdapter<
- // Use this currency:
- Balances,
- // Use this currency when it is a fungible asset matching the given location or name:
- OnlySelfCurrency,
- // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
- LocationToAccountId,
- // Our chain's account ID type (we can't get away without mentioning it explicitly):
- AccountId,
- // We don't track any teleports.
- (),
->;
-
-/// No local origins on this chain are allowed to dispatch XCM sends/executions.
-pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);
-
-/// The means for routing XCM messages which are not for local execution into the right message
-/// queues.
-pub type XcmRouter = (
- // Two routers - use UMP to communicate with the relay chain:
- cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
- // ..and XCMP to communicate with the sibling chains.
- XcmpQueue,
-);
-
-/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
-/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
-/// biases the kind of local `Origin` it will become.
-pub type XcmOriginToTransactDispatchOrigin = (
- // Sovereign account converter; this attempts to derive an `AccountId` from the origin location
- // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
- // foreign chains who want to have a local sovereign account on this chain which they control.
- SovereignSignedViaLocation<LocationToAccountId, Origin>,
- // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
- // recognised.
- RelayChainAsNative<RelayOrigin, Origin>,
- // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
- // recognised.
- SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,
- // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
- // transaction from the Root origin.
- ParentAsSuperuser<Origin>,
- // Native signed account converter; this just converts an `AccountId32` origin into a normal
- // `Origin::Signed` origin of the same 32-byte value.
- SignedAccountId32AsNative<RelayNetwork, Origin>,
- // Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
- XcmPassthrough<Origin>,
-);
-
-parameter_types! {
- // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.
- pub UnitWeightCost: Weight = 1_000_000;
- // 1200 UNIQUEs buy 1 second of weight.
- pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE);
- pub const MaxInstructions: u32 = 100;
-}
-
-match_types! {
- pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
- MultiLocation { parents: 1, interior: Here } |
- MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
- };
-}
-
-pub type Barrier = (
- TakeWeightCredit,
- AllowTopLevelPaidExecutionFrom<Everything>,
- // ^^^ Parent & its unit plurality gets free execution
-);
-
-pub struct UsingOnlySelfCurrencyComponents<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
->(
- Weight,
- Currency::Balance,
- PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
-);
-impl<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
- > WeightTrader
- for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
-{
- fn new() -> Self {
- Self(0, Zero::zero(), PhantomData)
- }
-
- fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
- let amount = WeightToFee::weight_to_fee(&weight);
- let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;
-
- // location to this parachain through relay chain
- let option1: xcm::v1::AssetId = Concrete(MultiLocation {
- parents: 1,
- interior: X1(Parachain(ParachainInfo::parachain_id().into())),
- });
- // direct location
- let option2: xcm::v1::AssetId = Concrete(MultiLocation {
- parents: 0,
- interior: Here,
- });
-
- let required = if payment.fungible.contains_key(&option1) {
- (option1, u128_amount).into()
- } else if payment.fungible.contains_key(&option2) {
- (option2, u128_amount).into()
- } else {
- (Concrete(MultiLocation::default()), u128_amount).into()
- };
-
- let unused = payment
- .checked_sub(required)
- .map_err(|_| XcmError::TooExpensive)?;
- self.0 = self.0.saturating_add(weight);
- self.1 = self.1.saturating_add(amount);
- Ok(unused)
- }
-
- fn refund_weight(&mut self, weight: Weight) -> Option<MultiAsset> {
- let weight = weight.min(self.0);
- let amount = WeightToFee::weight_to_fee(&weight);
- self.0 -= weight;
- self.1 = self.1.saturating_sub(amount);
- let amount: u128 = amount.saturated_into();
- if amount > 0 {
- Some((AssetId::get(), amount).into())
- } else {
- None
- }
- }
-}
-impl<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
- > Drop
- for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
-{
- fn drop(&mut self) {
- OnUnbalanced::on_unbalanced(Currency::issue(self.1));
- }
-}
-
-pub struct XcmConfig<T>(PhantomData<T>);
-impl<T> Config for XcmConfig<T>
-where
- T: pallet_configuration::Config,
-{
- type Call = Call;
- type XcmSender = XcmRouter;
- // How to withdraw and deposit an asset.
- type AssetTransactor = LocalAssetTransactor;
- type OriginConverter = XcmOriginToTransactDispatchOrigin;
- type IsReserve = NativeAsset;
- type IsTeleporter = (); // Teleportation is disabled
- type LocationInverter = LocationInverter<Ancestry>;
- type Barrier = Barrier;
- type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
- type Trader = UsingOnlySelfCurrencyComponents<
- pallet_configuration::WeightToFee<T, Balance>,
- RelayLocation,
- AccountId,
- Balances,
- (),
- >;
- type ResponseHandler = (); // Don't handle responses for now.
- type SubscriptionService = PolkadotXcm;
-
- type AssetTrap = PolkadotXcm;
- type AssetClaims = PolkadotXcm;
-}
-
-impl pallet_xcm::Config for Runtime {
- type Event = Event;
- type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
- type XcmRouter = XcmRouter;
- type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
- type XcmExecuteFilter = Everything;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type XcmTeleportFilter = Everything;
- type XcmReserveTransferFilter = Everything;
- type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
- type LocationInverter = LocationInverter<Ancestry>;
- type Origin = Origin;
- type Call = Call;
- const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
- type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
-}
-
-impl cumulus_pallet_xcm::Config for Runtime {
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
-}
-
-impl cumulus_pallet_xcmp_queue::Config for Runtime {
- type WeightInfo = ();
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type ChannelInfo = ParachainSystem;
- type VersionWrapper = ();
- type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
- type ControllerOrigin = EnsureRoot<AccountId>;
- type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
-}
-
-impl cumulus_pallet_dmp_queue::Config for Runtime {
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
-}
runtime/common/config/xcm/foreignassets.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/foreignassets.rs
@@ -0,0 +1,198 @@
+// 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/>.
+
+use frame_support::{
+ traits::{Contains, Get, fungibles},
+ parameter_types,
+};
+use sp_runtime::traits::{Zero, Convert};
+use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
+use xcm::latest::MultiAsset;
+use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};
+use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation};
+use pallet_foreign_assets::{
+ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeign,
+ ForeignAssetId, CurrencyId,
+};
+use sp_std::{borrow::Borrow, marker::PhantomData};
+use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeignAssets};
+
+use super::{LocationToAccountId, RelayLocation};
+
+use up_common::types::{AccountId, Balance};
+
+parameter_types! {
+ pub CheckingAccount: AccountId = PolkadotXcm::check_account();
+}
+
+/// Allow checking in assets that have issuance > 0.
+pub struct NonZeroIssuance<AccountId, ForeignAssets>(PhantomData<(AccountId, ForeignAssets)>);
+
+impl<AccountId, ForeignAssets> Contains<<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId>
+ for NonZeroIssuance<AccountId, ForeignAssets>
+where
+ ForeignAssets: fungibles::Inspect<AccountId>,
+{
+ fn contains(id: &<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId) -> bool {
+ !ForeignAssets::total_issuance(*id).is_zero()
+ }
+}
+
+pub struct AsInnerId<AssetId, ConvertAssetId>(PhantomData<(AssetId, ConvertAssetId)>);
+impl<AssetId: Clone + PartialEq, ConvertAssetId: ConvertXcm<AssetId, AssetId>>
+ ConvertXcm<MultiLocation, AssetId> for AsInnerId<AssetId, ConvertAssetId>
+where
+ AssetId: Borrow<AssetId>,
+ AssetId: TryAsForeign<AssetId, ForeignAssetId>,
+ AssetIds: Borrow<AssetId>,
+{
+ fn convert_ref(id: impl Borrow<MultiLocation>) -> Result<AssetId, ()> {
+ let id = id.borrow();
+
+ log::trace!(
+ target: "xcm::AsInnerId::Convert",
+ "AsInnerId {:?}",
+ id
+ );
+
+ let parent = MultiLocation::parent();
+ let here = MultiLocation::here();
+ let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
+
+ if *id == parent {
+ return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent));
+ }
+
+ if *id == here || *id == self_location {
+ return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here));
+ }
+
+ match XcmForeignAssetIdMapping::<Runtime>::get_currency_id(id.clone()) {
+ Some(AssetIds::ForeignAssetId(foreign_asset_id)) => {
+ ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id))
+ }
+ _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)),
+ }
+ }
+
+ fn reverse_ref(what: impl Borrow<AssetId>) -> Result<MultiLocation, ()> {
+ log::trace!(
+ target: "xcm::AsInnerId::Reverse",
+ "AsInnerId",
+ );
+
+ let asset_id = what.borrow();
+
+ let parent_id =
+ ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap();
+ let here_id =
+ ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap();
+
+ if asset_id.clone() == parent_id {
+ return Ok(MultiLocation::parent());
+ }
+
+ if asset_id.clone() == here_id {
+ return Ok(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ ));
+ }
+
+ match <AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(asset_id.clone()) {
+ Some(fid) => match XcmForeignAssetIdMapping::<Runtime>::get_multi_location(fid) {
+ Some(location) => Ok(location),
+ None => Err(()),
+ },
+ None => Err(()),
+ }
+ }
+}
+
+/// Means for transacting assets besides the native currency on this chain.
+pub type FungiblesTransactor = FungiblesAdapter<
+ // Use this fungibles implementation:
+ ForeignAssets,
+ // Use this currency when it is a fungible asset matching the given location or name:
+ ConvertedConcreteAssetId<AssetIds, Balance, AsInnerId<AssetIds, JustTry>, JustTry>,
+ // Convert an XCM MultiLocation into a local account id:
+ LocationToAccountId,
+ // Our chain's account ID type (we can't get away without mentioning it explicitly):
+ AccountId,
+ // We only want to allow teleports of known assets. We use non-zero issuance as an indication
+ // that this asset is known.
+ NonZeroIssuance<AccountId, ForeignAssets>,
+ // The account to use for tracking teleports.
+ CheckingAccount,
+>;
+
+/// Means for transacting assets on this chain.
+pub type AssetTransactors = FungiblesTransactor;
+
+pub struct AllAsset;
+impl FilterAssetLocation for AllAsset {
+ fn filter_asset_location(_asset: &MultiAsset, _origin: &MultiLocation) -> bool {
+ true
+ }
+}
+
+pub type IsReserve = AllAsset;
+
+pub type Trader<T> = FreeForAll<
+ pallet_configuration::WeightToFee<T, Balance>,
+ RelayLocation,
+ AccountId,
+ Balances,
+ (),
+>;
+
+pub struct CurrencyIdConvert;
+impl Convert<AssetIds, Option<MultiLocation>> for CurrencyIdConvert {
+ fn convert(id: AssetIds) -> Option<MultiLocation> {
+ match id {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ )),
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()),
+ AssetIds::ForeignAssetId(foreign_asset_id) => {
+ XcmForeignAssetIdMapping::<Runtime>::get_multi_location(foreign_asset_id)
+ }
+ }
+ }
+}
+
+impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
+ fn convert(location: MultiLocation) -> Option<CurrencyId> {
+ if location == MultiLocation::here()
+ || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())))
+ {
+ return Some(AssetIds::NativeAssetId(NativeCurrency::Here));
+ }
+
+ if location == MultiLocation::parent() {
+ return Some(AssetIds::NativeAssetId(NativeCurrency::Parent));
+ }
+
+ if let Some(currency_id) =
+ XcmForeignAssetIdMapping::<Runtime>::get_currency_id(location.clone())
+ {
+ return Some(currency_id);
+ }
+
+ None
+ }
+}
runtime/common/config/xcm/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/mod.rs
@@ -0,0 +1,268 @@
+// 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/>.
+
+use frame_support::{
+ traits::{Everything, Get},
+ weights::Weight,
+ parameter_types,
+};
+use frame_system::EnsureRoot;
+use pallet_xcm::XcmPassthrough;
+use polkadot_parachain::primitives::Sibling;
+use xcm::v1::{Junction::*, MultiLocation, NetworkId};
+use xcm::latest::prelude::*;
+use xcm_builder::{
+ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
+ RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
+ SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, ParentIsPreset,
+};
+use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute};
+use sp_std::{marker::PhantomData, vec::Vec};
+use crate::{
+ Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue,
+ xcm_barrier::Barrier,
+};
+
+use up_common::types::AccountId;
+
+#[cfg(feature = "foreign-assets")]
+pub mod foreignassets;
+
+#[cfg(not(feature = "foreign-assets"))]
+pub mod nativeassets;
+
+#[cfg(feature = "foreign-assets")]
+pub use foreignassets as xcm_assets;
+
+#[cfg(not(feature = "foreign-assets"))]
+pub use nativeassets as xcm_assets;
+
+use xcm_assets::{AssetTransactors, IsReserve, Trader};
+
+parameter_types! {
+ pub const RelayLocation: MultiLocation = MultiLocation::parent();
+ pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
+ pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
+ pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
+ pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
+
+ // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.
+ pub UnitWeightCost: Weight = 1_000_000;
+ pub const MaxInstructions: u32 = 100;
+}
+
+/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
+/// when determining ownership of accounts for asset transacting and when attempting to use XCM
+/// `Transact` in order to determine the dispatch Origin.
+pub type LocationToAccountId = (
+ // The parent (Relay-chain) origin converts to the default `AccountId`.
+ ParentIsPreset<AccountId>,
+ // Sibling parachain origins convert to AccountId via the `ParaId::into`.
+ SiblingParachainConvertsVia<Sibling, AccountId>,
+ // Straight up local `AccountId32` origins just alias directly to `AccountId`.
+ AccountId32Aliases<RelayNetwork, AccountId>,
+);
+
+/// No local origins on this chain are allowed to dispatch XCM sends/executions.
+pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);
+
+/// The means for routing XCM messages which are not for local execution into the right message
+/// queues.
+pub type XcmRouter = (
+ // Two routers - use UMP to communicate with the relay chain:
+ cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
+ // ..and XCMP to communicate with the sibling chains.
+ XcmpQueue,
+);
+
+/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
+/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
+/// biases the kind of local `Origin` it will become.
+pub type XcmOriginToTransactDispatchOrigin = (
+ // Sovereign account converter; this attempts to derive an `AccountId` from the origin location
+ // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
+ // foreign chains who want to have a local sovereign account on this chain which they control.
+ SovereignSignedViaLocation<LocationToAccountId, Origin>,
+ // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
+ // recognised.
+ RelayChainAsNative<RelayOrigin, Origin>,
+ // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
+ // recognised.
+ SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,
+ // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
+ // transaction from the Root origin.
+ ParentAsSuperuser<Origin>,
+ // Native signed account converter; this just converts an `AccountId32` origin into a normal
+ // `Origin::Signed` origin of the same 32-byte value.
+ SignedAccountId32AsNative<RelayNetwork, Origin>,
+ // Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
+ XcmPassthrough<Origin>,
+);
+
+pub trait TryPass {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()>;
+}
+
+#[impl_trait_for_tuples::impl_for_tuples(30)]
+impl TryPass for Tuple {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ for_tuples!( #(
+ Tuple::try_pass(origin, message)?;
+ )* );
+
+ Ok(())
+ }
+}
+
+pub struct DenyTransact;
+impl TryPass for DenyTransact {
+ fn try_pass<Call>(_origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ let transact_inst = message
+ .0
+ .iter()
+ .find(|inst| matches![inst, Instruction::Transact { .. }]);
+
+ if transact_inst.is_some() {
+ log::warn!(
+ target: "xcm::barrier",
+ "transact XCM rejected"
+ );
+
+ Err(())
+ } else {
+ Ok(())
+ }
+ }
+}
+
+/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else.
+/// If it passes the Deny, and matches one of the Allow cases then it is let through.
+pub struct DenyThenTry<Deny, Allow>(PhantomData<Deny>, PhantomData<Allow>)
+where
+ Deny: TryPass,
+ Allow: ShouldExecute;
+
+impl<Deny, Allow> ShouldExecute for DenyThenTry<Deny, Allow>
+where
+ Deny: TryPass,
+ Allow: ShouldExecute,
+{
+ fn should_execute<Call>(
+ origin: &MultiLocation,
+ message: &mut Xcm<Call>,
+ max_weight: Weight,
+ weight_credit: &mut Weight,
+ ) -> Result<(), ()> {
+ Deny::try_pass(origin, message)?;
+ Allow::should_execute(origin, message, max_weight, weight_credit)
+ }
+}
+
+// Allow xcm exchange only with locations in list
+pub struct DenyExchangeWithUnknownLocation<T>(PhantomData<T>);
+impl<T: Get<Vec<MultiLocation>>> TryPass for DenyExchangeWithUnknownLocation<T> {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ let allowed_locations = T::get();
+
+ // Check if deposit or transfer belongs to allowed parachains
+ let mut allowed = allowed_locations.contains(origin);
+
+ message.0.iter().for_each(|inst| match inst {
+ DepositReserveAsset { dest: dst, .. } => {
+ allowed |= allowed_locations.contains(dst);
+ }
+ TransferReserveAsset { dest: dst, .. } => {
+ allowed |= allowed_locations.contains(dst);
+ }
+ _ => {}
+ });
+
+ if allowed {
+ return Ok(());
+ }
+
+ log::warn!(
+ target: "xcm::barrier",
+ "Unexpected deposit or transfer location"
+ );
+ // Deny
+ Err(())
+ }
+}
+
+pub type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
+
+pub struct XcmConfig<T>(PhantomData<T>);
+impl<T> Config for XcmConfig<T>
+where
+ T: pallet_configuration::Config,
+{
+ type Call = Call;
+ type XcmSender = XcmRouter;
+ // How to withdraw and deposit an asset.
+ type AssetTransactor = AssetTransactors;
+ type OriginConverter = XcmOriginToTransactDispatchOrigin;
+ type IsReserve = IsReserve;
+ type IsTeleporter = (); // Teleportation is disabled
+ type LocationInverter = LocationInverter<Ancestry>;
+ type Barrier = Barrier;
+ type Weigher = Weigher;
+ type Trader = Trader<T>;
+ type ResponseHandler = (); // Don't handle responses for now.
+ type SubscriptionService = PolkadotXcm;
+
+ type AssetTrap = PolkadotXcm;
+ type AssetClaims = PolkadotXcm;
+}
+
+impl pallet_xcm::Config for Runtime {
+ type Event = Event;
+ type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
+ type XcmRouter = XcmRouter;
+ type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
+ type XcmExecuteFilter = Everything;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type XcmTeleportFilter = Everything;
+ type XcmReserveTransferFilter = Everything;
+ type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
+ type LocationInverter = LocationInverter<Ancestry>;
+ type Origin = Origin;
+ type Call = Call;
+ const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
+ type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
+}
+
+impl cumulus_pallet_xcm::Config for Runtime {
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+}
+
+impl cumulus_pallet_xcmp_queue::Config for Runtime {
+ type WeightInfo = ();
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type ChannelInfo = ParachainSystem;
+ type VersionWrapper = ();
+ type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
+ type ControllerOrigin = EnsureRoot<AccountId>;
+ type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
+}
+
+impl cumulus_pallet_dmp_queue::Config for Runtime {
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
+}
runtime/common/config/xcm/nativeassets.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/nativeassets.rs
@@ -0,0 +1,143 @@
+// 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/>.
+
+use frame_support::{
+ traits::{tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get},
+ weights::{Weight, WeightToFeePolynomial},
+};
+use sp_runtime::traits::{CheckedConversion, Zero, Convert};
+use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
+use xcm::latest::{
+ AssetId::{Concrete},
+ Fungibility::Fungible as XcmFungible,
+ MultiAsset, Error as XcmError,
+};
+use xcm_builder::{CurrencyAdapter, NativeAsset};
+use xcm_executor::{
+ Assets,
+ traits::{MatchesFungible, WeightTrader},
+};
+use pallet_foreign_assets::{AssetIds, NativeCurrency};
+use sp_std::marker::PhantomData;
+use crate::{Balances, ParachainInfo};
+use super::{LocationToAccountId, RelayLocation};
+
+use up_common::types::{AccountId, Balance};
+
+pub struct OnlySelfCurrency;
+impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {
+ fn matches_fungible(a: &MultiAsset) -> Option<B> {
+ let paraid = Parachain(ParachainInfo::parachain_id().into());
+ match (&a.id, &a.fun) {
+ (
+ Concrete(MultiLocation {
+ parents: 1,
+ interior: X1(loc),
+ }),
+ XcmFungible(ref amount),
+ ) if paraid == *loc => CheckedConversion::checked_from(*amount),
+ (
+ Concrete(MultiLocation {
+ parents: 0,
+ interior: Here,
+ }),
+ XcmFungible(ref amount),
+ ) => CheckedConversion::checked_from(*amount),
+ _ => None,
+ }
+ }
+}
+
+/// Means for transacting assets on this chain.
+pub type LocalAssetTransactor = CurrencyAdapter<
+ // Use this currency:
+ Balances,
+ // Use this currency when it is a fungible asset matching the given location or name:
+ OnlySelfCurrency,
+ // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
+ LocationToAccountId,
+ // Our chain's account ID type (we can't get away without mentioning it explicitly):
+ AccountId,
+ // We don't track any teleports.
+ (),
+>;
+
+pub type AssetTransactors = LocalAssetTransactor;
+
+pub type IsReserve = NativeAsset;
+
+pub struct UsingOnlySelfCurrencyComponents<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+>(
+ Weight,
+ Currency::Balance,
+ PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
+);
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > WeightTrader
+ for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn new() -> Self {
+ Self(0, Zero::zero(), PhantomData)
+ }
+
+ fn buy_weight(&mut self, _weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
+ Ok(payment)
+ }
+}
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > Drop
+ for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn drop(&mut self) {
+ OnUnbalanced::on_unbalanced(Currency::issue(self.1));
+ }
+}
+
+pub type Trader<T> = UsingOnlySelfCurrencyComponents<
+ pallet_configuration::WeightToFee<T, Balance>,
+ RelayLocation,
+ AccountId,
+ Balances,
+ (),
+>;
+
+pub struct CurrencyIdConvert;
+impl Convert<AssetIds, Option<MultiLocation>> for CurrencyIdConvert {
+ fn convert(id: AssetIds) -> Option<MultiLocation> {
+ match id {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ )),
+ _ => None,
+ }
+ }
+}
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -42,7 +42,9 @@
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
- // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
+
+ XTokens: orml_xtokens = 38,
+ Tokens: orml_tokens = 39,
// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
// XCM helpers.
@@ -65,7 +67,7 @@
Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
Fungible: pallet_fungible::{Pallet, Storage} = 67,
- #[runtimes(opal)]
+ #[runtimes(opal, quartz)]
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
@@ -80,6 +82,9 @@
#[runtimes(opal)]
AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
+ #[runtimes(opal)]
+ ForeignAssets: pallet_foreign_assets::{Pallet, Call, Storage, Event<T>} = 80,
+
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
runtime/common/mod.rsdiffbeforeafterboth--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -24,6 +24,9 @@
pub mod sponsoring;
pub mod weights;
+#[cfg(test)]
+pub mod tests;
+
use sp_core::H160;
use frame_support::traits::{Currency, OnUnbalanced, Imbalance};
use sp_runtime::{
@@ -79,7 +82,7 @@
pub type SignedExtra = (
frame_system::CheckSpecVersion<Runtime>,
- // system::CheckTxVersion<Runtime>,
+ frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -688,6 +688,10 @@
#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);
+ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
+ list_benchmark!(list, extra, pallet_foreign_assets, ForeignAssets);
+
+
// list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
let storage_info = AllPalletsReversedWithSystemFirst::storage_info();
@@ -744,6 +748,9 @@
#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);
+ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
+ add_benchmark!(params, batches, pallet_foreign_assets, ForeignAssets);
+
// add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
runtime/common/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/tests/mod.rs
@@ -0,0 +1,46 @@
+// 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/>.
+
+use sp_runtime::BuildStorage;
+use sp_core::{Public, Pair};
+use sp_std::vec;
+use up_common::types::AuraId;
+use crate::{GenesisConfig, ParachainInfoConfig, AuraConfig};
+
+pub mod xcm;
+
+fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
+ TPublic::Pair::from_string(&format!("//{}", seed), None)
+ .expect("static values are valid; qed")
+ .public()
+}
+
+fn new_test_ext(para_id: u32) -> sp_io::TestExternalities {
+ let cfg = GenesisConfig {
+ aura: AuraConfig {
+ authorities: vec![
+ get_from_seed::<AuraId>("Alice"),
+ get_from_seed::<AuraId>("Bob"),
+ ],
+ },
+ parachain_info: ParachainInfoConfig {
+ parachain_id: para_id.into(),
+ },
+ ..GenesisConfig::default()
+ };
+
+ cfg.build_storage().unwrap().into()
+}
runtime/common/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/tests/xcm.rs
@@ -0,0 +1,162 @@
+// 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/>.
+
+use xcm_executor::traits::ShouldExecute;
+use xcm::latest::prelude::*;
+use logtest::Logger;
+use crate::Call;
+use super::new_test_ext;
+
+fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) -> Result<(), String> {
+ for record in logger {
+ if record.target() == "xcm::barrier" && record.args() == expected_msg {
+ return Ok(());
+ }
+ }
+
+ Err(format!(
+ "the expected XCM barrier log `{}` is not found",
+ expected_msg
+ ))
+}
+
+/// WARNING: Uses log capturing
+/// See https://docs.rs/logtest/latest/logtest/index.html#constraints
+pub fn barrier_denies_transact<B: ShouldExecute>(logger: &mut Logger) {
+ let location = MultiLocation {
+ parents: 0,
+ interior: Junctions::Here,
+ };
+
+ // We will never decode this "call",
+ // so it is irrelevant what we are passing to the `transact` cmd.
+ let fake_encoded_call = vec![0u8];
+
+ let transact_inst = Transact {
+ origin_type: OriginKind::Superuser,
+ require_weight_at_most: 0,
+ call: fake_encoded_call.into(),
+ };
+
+ let mut xcm_program = Xcm::<Call>(vec![transact_inst]);
+
+ let max_weight = 100_000;
+ let mut weight_credit = 100_000_000;
+
+ let result = B::should_execute(&location, &mut xcm_program, max_weight, &mut weight_credit);
+
+ assert!(
+ result.is_err(),
+ "the barrier should disallow the XCM transact cmd"
+ );
+
+ catch_xcm_barrier_log(logger, "transact XCM rejected").unwrap();
+}
+
+fn xcm_execute<B: ShouldExecute>(
+ self_para_id: u32,
+ location: &MultiLocation,
+ xcm: &mut Xcm<Call>,
+) -> Result<(), ()> {
+ new_test_ext(self_para_id).execute_with(|| {
+ let max_weight = 100_000;
+ let mut weight_credit = 100_000_000;
+
+ B::should_execute(&location, xcm, max_weight, &mut weight_credit)
+ })
+}
+
+fn make_multiassets(location: &MultiLocation) -> MultiAssets {
+ let id = AssetId::Concrete(location.clone());
+ let fun = Fungibility::Fungible(42);
+ let multiasset = MultiAsset { id, fun };
+
+ multiasset.into()
+}
+
+fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm<Call> {
+ let assets = make_multiassets(location);
+ let inst = TransferReserveAsset {
+ assets,
+ dest: location.clone(),
+ xcm: Xcm(vec![]),
+ };
+
+ Xcm::<Call>(vec![inst])
+}
+
+fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm<Call> {
+ let assets = make_multiassets(location);
+ let inst = DepositReserveAsset {
+ assets: assets.into(),
+ max_assets: 42,
+ dest: location.clone(),
+ xcm: Xcm(vec![]),
+ };
+
+ Xcm::<Call>(vec![inst])
+}
+
+fn expect_transfer_location_denied<B: ShouldExecute>(
+ logger: &mut Logger,
+ self_para_id: u32,
+ location: &MultiLocation,
+ xcm: &mut Xcm<Call>,
+) -> Result<(), String> {
+ let result = xcm_execute::<B>(self_para_id, location, xcm);
+
+ if result.is_ok() {
+ return Err("the barrier should deny the unknown location".into());
+ }
+
+ catch_xcm_barrier_log(logger, "Unexpected deposit or transfer location")
+}
+
+/// WARNING: Uses log capturing
+/// See https://docs.rs/logtest/latest/logtest/index.html#constraints
+pub fn barrier_denies_transfer_from_unknown_location<B>(
+ logger: &mut Logger,
+ self_para_id: u32,
+) -> Result<(), String>
+where
+ B: ShouldExecute,
+{
+ const UNKNOWN_PARACHAIN_ID: u32 = 4057;
+
+ let unknown_location = MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(UNKNOWN_PARACHAIN_ID)),
+ };
+
+ let mut transfer_reserve_asset = make_transfer_reserve_asset(&unknown_location);
+ let mut deposit_reserve_asset = make_deposit_reserve_asset(&unknown_location);
+
+ expect_transfer_location_denied::<B>(
+ logger,
+ self_para_id,
+ &unknown_location,
+ &mut transfer_reserve_asset,
+ )?;
+
+ expect_transfer_location_denied::<B>(
+ logger,
+ self_para_id,
+ &unknown_location,
+ &mut deposit_reserve_asset,
+ )?;
+
+ Ok(())
+}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -35,6 +35,7 @@
'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',
@@ -123,13 +124,18 @@
'up-sponsorship/std',
"orml-vesting/std",
+ "orml-tokens/std",
+ "orml-xtokens/std",
+ "orml-traits/std",
+ "pallet-foreign-assets/std"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets']
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
app-promotion = []
################################################################################
@@ -403,6 +409,24 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
################################################################################
# local dependencies
@@ -442,7 +466,19 @@
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
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.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "opal";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/opal/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// 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/>.
+
+use logtest::Logger;
+use super::xcm::opal_xcm_tests;
+
+#[test]
+fn opal_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ opal_xcm_tests(&mut logger);
+}
runtime/opal/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// 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/>.
+
+mod logcapture;
+mod xcm;
runtime/opal/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// 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/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const OPAL_PARA_ID: u32 = 2095; // Same as Quartz
+
+pub fn opal_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, OPAL_PARA_ID)
+ .expect_err("opal runtime allows any location");
+}
runtime/opal/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/xcm_barrier.rs
@@ -0,0 +1,48 @@
+// 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/>.
+
+use frame_support::{weights::Weight, traits::Everything};
+use xcm::{latest::Xcm, v1::MultiLocation};
+use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
+use xcm_executor::traits::ShouldExecute;
+
+use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};
+
+/// Execution barrier that just takes `max_weight` from `weight_credit`.
+///
+/// Useful to allow XCM execution by local chain users via extrinsics.
+/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset
+/// out of the local chain to another one.
+pub struct AllowAllDebug;
+impl ShouldExecute for AllowAllDebug {
+ fn should_execute<Call>(
+ _origin: &MultiLocation,
+ _message: &mut Xcm<Call>,
+ _max_weight: Weight,
+ _weight_credit: &mut Weight,
+ ) -> Result<(), ()> {
+ Ok(())
+ }
+}
+
+pub type Barrier = DenyThenTry<
+ DenyTransact,
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ AllowAllDebug,
+ ),
+>;
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -36,6 +36,7 @@
'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-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -116,15 +117,23 @@
'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"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-quartz-runtime = []
+quartz-runtime = ['refungible']
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
################################################################################
# Substrate Dependencies
@@ -397,6 +406,25 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+
################################################################################
# RMRK dependencies
@@ -443,7 +471,19 @@
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
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.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "quartz";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/quartz/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// 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/>.
+
+use logtest::Logger;
+use super::xcm::quartz_xcm_tests;
+
+#[test]
+fn quartz_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ quartz_xcm_tests(&mut logger);
+}
runtime/quartz/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// 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/>.
+
+mod logcapture;
+mod xcm;
runtime/quartz/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// 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/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const QUARTZ_PARA_ID: u32 = 2095;
+
+pub fn quartz_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, QUARTZ_PARA_ID)
+ .expect("quartz runtime denies an unknown location");
+}
runtime/quartz/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/xcm_barrier.rs
@@ -0,0 +1,83 @@
+// 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/>.
+
+use frame_support::{
+ match_types, parameter_types,
+ traits::{Get, Everything},
+};
+use sp_std::{vec, vec::Vec};
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm_builder::{
+ AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom,
+};
+
+use crate::{
+ ParachainInfo, PolkadotXcm,
+ runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},
+};
+
+match_types! {
+ pub type ParentOrSiblings: impl Contains<MultiLocation> = {
+ MultiLocation { parents: 1, interior: Here } |
+ MultiLocation { parents: 1, interior: X1(_) }
+ };
+}
+
+parameter_types! {
+ pub QuartzAllowedLocations: Vec<MultiLocation> = vec![
+ // Self location
+ MultiLocation {
+ parents: 0,
+ interior: Here,
+ },
+ // Parent location
+ MultiLocation {
+ parents: 1,
+ interior: Here,
+ },
+ // Karura/Acala location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2000)),
+ },
+ // Moonriver location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2023)),
+ },
+ // Self parachain address
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(ParachainInfo::get().into())),
+ },
+ ];
+}
+
+pub type Barrier = DenyThenTry<
+ (
+ DenyTransact,
+ DenyExchangeWithUnknownLocation<QuartzAllowedLocations>,
+ ),
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ // Expected responses are OK.
+ AllowKnownQueryResponses<PolkadotXcm>,
+ // Subscriptions for version tracking are OK.
+ AllowSubscriptionsFrom<ParentOrSiblings>,
+ ),
+>;
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -36,6 +36,7 @@
'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-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -117,8 +118,15 @@
'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"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
unique-runtime = []
@@ -126,6 +134,7 @@
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
################################################################################
# Substrate Dependencies
@@ -398,6 +407,23 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
################################################################################
# local dependencies
@@ -437,7 +463,19 @@
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
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.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "unique";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/unique/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// 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/>.
+
+use logtest::Logger;
+use super::xcm::unique_xcm_tests;
+
+#[test]
+fn unique_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ unique_xcm_tests(&mut logger);
+}
runtime/unique/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// 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/>.
+
+mod logcapture;
+mod xcm;
runtime/unique/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// 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/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const UNIQUE_PARA_ID: u32 = 2037;
+
+pub fn unique_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, UNIQUE_PARA_ID)
+ .expect("unique runtime denies an unknown location");
+}
runtime/unique/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/xcm_barrier.rs
@@ -0,0 +1,83 @@
+// 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/>.
+
+use frame_support::{
+ match_types, parameter_types,
+ traits::{Get, Everything},
+};
+use sp_std::{vec, vec::Vec};
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm_builder::{
+ AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom,
+};
+
+use crate::{
+ ParachainInfo, PolkadotXcm,
+ runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},
+};
+
+match_types! {
+ pub type ParentOrSiblings: impl Contains<MultiLocation> = {
+ MultiLocation { parents: 1, interior: Here } |
+ MultiLocation { parents: 1, interior: X1(_) }
+ };
+}
+
+parameter_types! {
+ pub UniqueAllowedLocations: Vec<MultiLocation> = vec![
+ // Self location
+ MultiLocation {
+ parents: 0,
+ interior: Here,
+ },
+ // Parent location
+ MultiLocation {
+ parents: 1,
+ interior: Here,
+ },
+ // Karura/Acala location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2000)),
+ },
+ // Moonbeam location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2004)),
+ },
+ // Self parachain address
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(ParachainInfo::get().into())),
+ },
+ ];
+}
+
+pub type Barrier = DenyThenTry<
+ (
+ DenyTransact,
+ DenyExchangeWithUnknownLocation<UniqueAllowedLocations>,
+ ),
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ // Expected responses are OK.
+ AllowKnownQueryResponses<PolkadotXcm>,
+ // Subscriptions for version tracking are OK.
+ AllowSubscriptionsFrom<ParentOrSiblings>,
+ ),
+>;
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -49,7 +49,6 @@
"testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",
"testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts",
"testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts",
- "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts",
"testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts",
"testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts",
"testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts",
@@ -65,8 +64,7 @@
"testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",
"testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",
"testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts",
- "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",
- "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts",
+ "testSetPermissions": "mocha --timeout 9999999 -r ts-node/register ./**/setPermissions.test.ts",
"testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",
"testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts",
"testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts",
@@ -78,7 +76,12 @@
"testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",
"testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts",
"testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts",
- "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts",
+ "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts",
+ "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts",
+ "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts",
+ "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000",
+ "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000",
+ "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.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",
"testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
tests/scripts/readyness.jsdiffbeforeafterboth--- a/tests/scripts/readyness.js
+++ b/tests/scripts/readyness.js
@@ -1,7 +1,7 @@
const { ApiPromise, WsProvider } = require('@polkadot/api');
const connect = async () => {
- const wsEndpoint = 'ws://127.0.0.1:9944'
+ const wsEndpoint = 'ws://127.0.0.1:9944';
const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});
await api.isReadyOrError;
@@ -12,10 +12,10 @@
}
const sleep = time => {
- return new Promise(resolve => {
- setTimeout(() => resolve(), time);
- });
-}
+ return new Promise(resolve => {
+ setTimeout(() => resolve(), time);
+ });
+};
const main = async () => {
while(true) {
tests/src/addToAllowList.test.tsdiffbeforeafterboth--- a/tests/src/addToAllowList.test.ts
+++ /dev/null
@@ -1,135 +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 chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import {
- addToAllowListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- destroyCollectionExpectSuccess,
- enablePublicMintingExpectSuccess,
- enableAllowListExpectSuccess,
- normalizeAccountId,
- addCollectionAdminExpectSuccess,
- addToAllowListExpectFail,
- getCreatedCollectionCount,
-} from './util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let alice: IKeyringPair;
-let bob: IKeyringPair;
-let charlie: IKeyringPair;
-
-describe('Integration Test ext. addToAllowList()', () => {
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- });
-
- it('Allowlisted minting: list restrictions', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
- await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address);
- });
-});
-
-describe('Negative Integration Test ext. addToAllowList()', () => {
-
- it('Allow list an address in the collection that does not exist', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- // tslint:disable-next-line: no-bitwise
- const collectionId = await getCreatedCollectionCount(api) + 1;
- const bob = privateKeyWrapper('//Bob');
-
- const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address));
- await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
- });
- });
-
- it('Allow list an address in the collection that was destroyed', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- const alice = privateKeyWrapper('//Alice');
- const bob = privateKeyWrapper('//Bob');
- // tslint:disable-next-line: no-bitwise
- const collectionId = await createCollectionExpectSuccess();
- await destroyCollectionExpectSuccess(collectionId);
- const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address));
- await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
- });
- });
-
- it('Allow list an address in the collection that does not have allow list access enabled', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- const alice = privateKeyWrapper('//Alice');
- const ferdie = privateKeyWrapper('//Ferdie');
- const collectionId = await createCollectionExpectSuccess();
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
- const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(ferdie.address), 'NFT');
- await expect(submitTransactionExpectFailAsync(ferdie, tx)).to.be.rejected;
- });
- });
-
-});
-
-describe('Integration Test ext. addToAllowList() with collection admin permissions:', () => {
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- charlie = privateKeyWrapper('//Charlie');
- });
- });
-
- it('Negative. Add to the allow list by regular user', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectFail(bob, collectionId, charlie.address);
- });
-
- it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await addToAllowListExpectSuccess(bob, collectionId, charlie.address);
- });
-
- it('Allowlisted minting: list restrictions', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await addToAllowListExpectSuccess(bob, collectionId, charlie.address);
-
- // allowed only for collection owner
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
-
- await createItemExpectSuccess(charlie, collectionId, 'NFT', charlie.address);
- });
-});
tests/src/addToContractAllowList.test.tsdiffbeforeafterboth--- a/tests/src/addToContractAllowList.test.ts
+++ b/tests/src/addToContractAllowList.test.ts
@@ -27,6 +27,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
+// todo:playgrounds skipped ~ postponed
describe.skip('Integration Test addToContractAllowList', () => {
it('Add an address to a contract allow list', async () => {
tests/src/allowLists.test.tsdiffbeforeafterboth--- a/tests/src/allowLists.test.ts
+++ b/tests/src/allowLists.test.ts
@@ -16,6 +16,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {usingPlaygrounds, expect, itSub} from './util/playgrounds';
+import {ICollectionPermissions} from './util/playgrounds/types';
describe('Integration Test ext. Allow list tests', () => {
let alice: IKeyringPair;
@@ -25,287 +26,335 @@
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
const donor = privateKey('//Alice');
- [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
});
});
- itSub('Owner can add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: bob.address});
- });
+ describe('Positive', async () => {
+ itSub('Owner can add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ // allow list does not need to be enabled to add someone in advance
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: bob.address});
+ });
- itSub('Admin can add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
+ itSub('Admin can add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
- await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: charlie.address});
- });
+ // allow list does not need to be enabled to add someone in advance
+ await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: charlie.address});
+ });
- itSub('Non-privileged user cannot add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.NoPermission/);
+ itSub('If address is already added to allow list, nothing happens', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: bob.address});
+ });
});
- itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => {
- const collectionId = (1<<32) - 1;
- const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
- });
+ describe('Negative', async () => {
+ itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => {
+ const collectionId = (1<<32) - 1;
+ await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
- itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.collection.burn(alice, collectionId);
- const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.collection.burn(alice, collectionId);
+ await expect(helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('Non-privileged user cannot add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
});
+});
- itSub('If address is already added to allow list, nothing happens', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: bob.address});
+describe('Integration Test ext. Remove from Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+ let charlie: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
+ });
});
- itSub('Owner can remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ describe('Positive', async () => {
+ itSub('Owner can remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
+ const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.not.deep.contains({Substrate: bob.address});
- });
+ expect(allowList).to.not.deep.contain({Substrate: bob.address});
+ });
- itSub('Admin can remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address});
+ itSub('Admin can remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.not.deep.contain({Substrate: bob.address});
+ });
- expect(allowList).to.be.not.deep.contains({Substrate: bob.address});
- });
+ itSub('If address is already removed from allow list, nothing happens', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowListBefore = await helper.nft.getAllowList(collectionId);
+ expect(allowListBefore).to.not.deep.contain({Substrate: bob.address});
- itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(removeTx()).to.be.rejectedWith(/common\.NoPermission/);
- const allowList = await helper.nft.getAllowList(collectionId);
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- expect(allowList).to.be.deep.contains({Substrate: charlie.address});
+ const allowListAfter = await helper.nft.getAllowList(collectionId);
+ expect(allowListAfter).to.not.deep.contain({Substrate: bob.address});
+ });
});
- itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => {
- const collectionId = (1<<32) - 1;
- const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ describe('Negative', async () => {
+ itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await expect(helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: charlie.address});
+ });
+
+ itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => {
+ const collectionId = (1<<32) - 1;
+ await expect(helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.burn(alice, collectionId);
+
+ await expect(helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
});
+});
- itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.burn(alice, collectionId);
- const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+describe('Integration Test ext. Transfer if included in Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+ let charlie: IKeyringPair;
- await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
+ });
});
- itSub('If address is already removed from allow list, nothing happens', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- const allowListBefore = await helper.nft.getAllowList(collectionId);
- expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address});
+ describe('Positive', async () => {
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const allowListAfter = await helper.nft.getAllowList(collectionId);
- expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address});
- });
+ await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
});
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ describe('Negative', async () => {
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
+
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
- itSub('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if itSub owned them before enabling AllowList mode)', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId);
- await expect(burnTx()).to.be.rejectedWith(/common\.NoPermission/);
- });
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- itSub('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address});
- await expect(approveTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await expect(helper.nft.burnToken(bob, collectionId, tokenId))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
+ itSub('If Public Access mode is set to AllowList, token transfers can\'t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await expect(helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
});
+});
- itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+describe('Integration Test ext. Mint if included in Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
- await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);
+ });
});
- itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ const permissionSet: ICollectionPermissions[] = [
+ {access: 'Normal', mintMode: false},
+ {access: 'Normal', mintMode: true},
+ {access: 'AllowList', mintMode: false},
+ {access: 'AllowList', mintMode: true},
+ ];
- await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
- });
+ const testPermissionSuite = async (permissions: ICollectionPermissions) => {
+ const allowlistedMintingShouldFail = !permissions.mintMode!;
- itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const appropriateRejectionMessage = permissions.mintMode! ? /common\.AddressNotInAllowlist/ : /common\.PublicMintingNotAllowed/;
- await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
- });
+ const allowlistedMintingTest = () => itSub(
+ `With the condtions above, tokens can${allowlistedMintingShouldFail ? '\'t' : ''} be created by allow-listed addresses`,
+ async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await collection.addToAllowList(alice, {Substrate: bob.address});
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- const token = await helper.nft.getToken(collectionId, tokenId);
- expect(token).to.be.not.null;
- });
+ if (allowlistedMintingShouldFail)
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.rejectedWith(appropriateRejectionMessage);
+ else
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
+ },
+ );
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const token = await helper.nft.getToken(collectionId, tokenId);
- expect(token).to.be.not.null;
- });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/);
- });
+ describe(`Public Access Mode = ${permissions.access}, Mint Mode = ${permissions.mintMode}`, async () => {
+ describe('Positive', async () => {
+ itSub('With the condtions above, tokens can be created by owner', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await expect(collection.mintToken(alice, {Substrate: alice.address})).to.not.be.rejected;
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/);
- });
+ itSub('With the condtions above, tokens can be created by admin', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await collection.addAdmin(alice, {Substrate: bob.address});
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(alice.address);
- });
+ if (!allowlistedMintingShouldFail) allowlistedMintingTest();
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(bob.address);
- });
+ describe('Negative', async () => {
+ itSub('With the condtions above, tokens can\'t be created by non-priviliged non-allow-listed address', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await collection.setPermissions(alice, permissions);
+ await expect(collection.mintToken(bob, {Substrate: bob.address}))
+ .to.be.rejectedWith(appropriateRejectionMessage);
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ if (allowlistedMintingShouldFail) allowlistedMintingTest();
+ });
+ });
+ };
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(bob.address);
- });
+ for (const permissions of permissionSet) {
+ testPermissionSuite(permissions);
+ }
});
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -20,17 +20,12 @@
getModuleNames,
Pallets,
} from './util/helpers';
-
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import {usingPlaygrounds} from './util/playgrounds';
-
+import {itSub, usingPlaygrounds} from './util/playgrounds';
import {encodeAddress} from '@polkadot/util-crypto';
import {stringToU8a} from '@polkadot/util';
-import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers';
+import {SponsoringMode} from './eth/util/helpers';
import {DevUniqueHelper} from './util/playgrounds/unique.dev';
-chai.use(chaiAsPromised);
-const expect = chai.expect;
+import {itEth, expect} from './eth/util/playgrounds';
let alice: IKeyringPair;
let palletAdmin: IKeyringPair;
@@ -38,723 +33,651 @@
const palletAddress = calculatePalleteAddress('appstake');
let accounts: IKeyringPair[] = [];
const LOCKING_PERIOD = 20n; // 20 blocks of relay
-const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain
+const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain
const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n);
-const beforeEach = async (context: Mocha.Context) => {
- await usingPlaygrounds(async (helper, privateKey) => {
- if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) context.skip();
- alice = privateKey('//Alice');
- palletAdmin = privateKey('//Charlie'); // TODO use custom address
- await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
- nominal = helper.balance.getOneTokenNominal();
- await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
- await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
- accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
- });
-};
-
-describe('app-promotions.stake extrinsic', () => {
+describe('App promotion', () => {
before(async function () {
- await beforeEach(this);
+ await usingPlaygrounds(async (helper, privateKey) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
+ alice = privateKey('//Alice');
+ palletAdmin = privateKey('//Charlie'); // TODO use custom address
+ await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
+ nominal = helper.balance.getOneTokenNominal();
+ await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
+ await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
+ accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
+ });
});
- it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => {
- await usingPlaygrounds(async (helper) => {
+ describe('stake extrinsic', () => {
+ itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
-
+
// Minimum stake amount is 100:
- await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected;
await helper.staking.stake(staker, 100n * nominal);
-
+
// Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n...
// ...so he can not transfer 900
expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n});
- await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected;
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
// it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo?
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased
-
+
await helper.staking.stake(staker, 200n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal);
- expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]);
+ const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal);
+ expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal);
});
- });
-
- it('should allow to create maximum 10 stakes for account', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should allow to create maximum 10 stakes for account', async ({helper}) => {
const [staker] = await helper.arrange.createAccounts([2000n], alice);
for (let i = 0; i < 10; i++) {
await helper.staking.stake(staker, 100n * nominal);
}
-
+
// can have 10 stakes
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal);
expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10);
-
- await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected;
-
+
+ await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission');
+
// After unstake can stake again
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal);
});
- });
+
+ itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => {
+ const staker = accounts.pop()!;
- it('should reject transaction if stake amount is more than total free balance minus frozen', async () => {
- await usingPlaygrounds(async helper => {
- const staker = accounts.pop()!;
-
// Can't stake full balance because Alice needs to pay some fee
- await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected;
await helper.staking.stake(staker, 500n * nominal);
-
+
// Can't stake 500 tkn because Alice has Less than 500 transferable;
- await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);
});
- });
-
- it('for different accounts in one block is possible', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('for different accounts in one block is possible', async ({helper}) => {
const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal));
- await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled;
-
+ await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled;
+
const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address})));
expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]);
});
});
-});
-
-describe('unstake balance extrinsic', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => {
- await usingPlaygrounds(async helper => {
+
+ describe('unstake extrinsic', () => {
+ itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
await helper.staking.stake(staker, 900n * nominal);
await helper.staking.unstake(staker);
-
+
// Right after unstake balance is reserved
// Staker can not transfer
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n});
- await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected;
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance');
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);
});
- });
-
- it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
- const unstakedInBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
-
+ const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+
// Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n
- await helper.wait.forParachainBlockNumber(unstakedInBlock);
+ await helper.wait.forParachainBlockNumber(pendingUnstake.block);
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n});
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
-
+
// staker can transfer:
await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n);
});
- });
-
- it('should successfully unstake multiple stakes', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should successfully unstake multiple stakes', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
await helper.staking.stake(staker, 300n * nominal);
-
+
// staked: [100, 200, 300]; unstaked: 0
- let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
- let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
- let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
- expect(pendingUnstake).to.be.deep.equal(0n);
- expect(unstakedPerBlock).to.be.deep.equal([]);
- expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal, 300n * nominal]);
-
+ let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+ let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalPendingUnstake).to.be.deep.equal(0n);
+ expect(pendingUnstake).to.be.deep.equal([]);
+ expect(stakes[0].amount).to.equal(100n * nominal);
+ expect(stakes[1].amount).to.equal(200n * nominal);
+ expect(stakes[2].amount).to.equal(300n * nominal);
+
// Can unstake multiple stakes
await helper.staking.unstake(staker);
- const unstakingBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
- pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
- unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
- stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
- expect(pendingUnstake).to.be.equal(600n * nominal);
- expect(stakedPerBlock).to.be.deep.equal([]);
- expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]);
-
+ pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+ totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalPendingUnstake).to.be.equal(600n * nominal);
+ expect(stakes).to.be.deep.equal([]);
+ expect(pendingUnstake[0].amount).to.equal(600n * nominal);
+
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n});
- await helper.wait.forParachainBlockNumber(unstakingBlock);
+ await helper.wait.forParachainBlockNumber(pendingUnstake[0].block);
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});
expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
});
- });
-
- it('should not have any effects if no active stakes', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not have any effects if no active stakes', async ({helper}) => {
const staker = accounts.pop()!;
-
+
// unstake has no effect if no stakes at all
await helper.staking.unstake(staker);
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper
-
+
// TODO stake() unstake() waitUnstaked() unstake();
-
+
// can't unstake if there are only pendingUnstakes
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.unstake(staker);
-
+
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
});
- });
-
- it('should keep different unlocking block for each unlocking stake', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 120n * nominal);
await helper.staking.unstake(staker);
-
+
const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
expect(unstakingPerBlock).has.length(2);
- expect(unstakingPerBlock[0][1]).to.equal(100n * nominal);
- expect(unstakingPerBlock[1][1]).to.equal(120n * nominal);
+ expect(unstakingPerBlock[0].amount).to.equal(100n * nominal);
+ expect(unstakingPerBlock[1].amount).to.equal(120n * nominal);
});
- });
-
- it('should be possible for different accounts in one block', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should be possible for different accounts in one block', async ({helper}) => {
const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
await Promise.all(stakers.map(staker => helper.staking.unstake(staker)));
-
+
await Promise.all(stakers.map(async (staker) => {
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
}));
});
});
-});
-
-describe('Admin adress', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can be set by sudo only', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('admin adress', () => {
+ itSub('can be set by sudo only', async ({helper}) => {
const nonAdmin = accounts.pop()!;
// nonAdmin can not set admin not from himself nor as a sudo
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected;
-
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected;
+
// Alice can
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled;
});
- });
-
- it('can be any valid CrossAccountId', async () => {
- // We are not going to set an eth address as a sponsor,
- // but we do want to check, it doesn't break anything;
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be any valid CrossAccountId', async ({helper}) => {
+ // We are not going to set an eth address as a sponsor,
+ // but we do want to check, it doesn't break anything;
const account = accounts.pop()!;
const ethAccount = helper.address.substrateToEth(account.address);
// Alice sets Ethereum address as a sudo. Then Substrate address back...
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
-
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled;
+
// ...It doesn't break anything;
const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
});
- });
-
- it('can be reassigned', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be reassigned', async ({helper}) => {
const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
-
- await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled;
+ await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
+
+ await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled;
});
});
-});
-
-describe('App-promotion collection sponsoring', () => {
- before(async function () {
- await beforeEach(this);
- await usingPlaygrounds(async (helper) => {
- const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
- await helper.signTransaction(alice, tx);
+
+ describe('collection sponsoring', () => {
+ before(async function () {
+ await usingPlaygrounds(async (helper) => {
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
+ await helper.signTransaction(alice, tx);
+ });
});
- });
-
- it('should actually sponsor transactions', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should actually sponsor transactions', async ({helper}) => {
const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address});
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
-
+
await token.transfer(tokenSender, {Substrate: receiver.address});
expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address});
const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
-
+
// senders balance the same, transaction has sponsored
expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal);
expect (palletBalanceBefore > palletBalanceAfter).to.be.true;
});
- });
-
- it('can not be set by non admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can not be set by non admin', async ({helper}) => {
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
-
+
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled');
});
- });
-
- it('should set pallet address as confirmed admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should set pallet address as confirmed admin', async ({helper}) => {
const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!];
-
+
// Can set sponsoring for collection without sponsor
const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with unconfirmed sponsor
const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with confirmed sponsor
const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
- });
-
- it('can be overwritten by collection owner', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be overwritten by collection owner', async ({helper}) => {
const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
const collectionId = collection.collectionId;
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled;
-
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled;
+
// Collection limits still can be changed by the owner
expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true;
expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0);
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Collection sponsor can be changed too
expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address});
});
- });
-
- it('should not overwrite collection limits set by the owner earlier', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => {
const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0};
const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits});
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled;
expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits);
});
- });
-
- it('should reject transaction if collection doesn\'t exist', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => {
const collectionOwner = accounts.pop()!;
-
+
// collection has never existed
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected;
// collection has been burned
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
await collection.burn(collectionOwner);
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
});
});
-});
-
-describe('app-promotion stopSponsoringCollection', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can not be called by non-admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('stopSponsoringCollection', () => {
+ itSub('can not be called by non-admin', async ({helper}) => {
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
-
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled;
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
- });
-
- it('should set sponsoring as disabled', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should set sponsoring as disabled', async ({helper}) => {
const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address});
-
+
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId));
-
+
expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled');
-
+
// Transactions are not sponsored anymore:
const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address);
await token.transfer(collectionOwner, {Substrate: recepient.address});
const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address);
expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true);
});
- });
-
- it('should not affect collection which is not sponsored by pallete', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
await collection.confirmSponsorship(collectionOwner);
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
-
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
+
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address});
});
- });
-
- it('should reject transaction if collection does not exist', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should reject transaction if collection does not exist', async ({helper}) => {
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
+
await collection.burn(collectionOwner);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound');
+ await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound');
});
});
-});
-
-describe('app-promotion contract sponsoring', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ describe('contract sponsoring', () => {
+ itEth('should set palletes address as a sponsor', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
- });
-
- itWeb3('should overwrite sponsoring mode and existed sponsor', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
+
+ itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
// Contract is self sponsored
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
-
+
// set promotion sponsoring
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+
// new sponsor is pallet address
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
- });
-
- itWeb3('can be overwritten by contract owner', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
+
+ itEth('can be overwritten by contract owner', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
// contract sponsored by pallet
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+
// owner sets self sponsoring
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
- });
-
- itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('can not be set by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
// nonAdmin calls sponsorContract
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address))).to.be.rejected;
-
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
+
// contract still self-sponsored
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
-
- itWeb3('should be rejected for non-contract address', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
-
- });
- });
- });
-
- itWeb3('should actually sponsor transactions', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractHelper = contractHelpers(web3, contractOwner);
+
+ itEth('should actually sponsor transactions', async ({helper}) => {
+ // Contract caller
+ const caller = await helper.eth.createAccountWithBalance(alice, 1000n);
+ const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
+
+ // Deploy flipper
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ // Owner sets to sponsor every tx
await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner});
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
- await transferBalanceToEth(api, alice, flipper.options.address, 1000n);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+ await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n);
+
+ // Set promotion to the Flipper
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ // Caller calls Flipper
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
+ // The contracts and caller balances have not changed
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
-
expect(callerBalance).to.be.equal(1000n * nominal);
- expect(1000n * nominal > contractBalanceAfter).to.be.true;
+ expect(1000n * nominal === contractBalanceAfter).to.be.true;
+
+ // The pallet balance has decreased
+ const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
+ expect(palletBalanceAfter < palletBalanceBefore).to.be.true;
});
});
-});
-
-describe('app-promotion stopSponsoringContract', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- await transferBalanceToEth(api, alice, flipper.options.address);
- const contractHelper = contractHelpers(web3, contractOwner);
+
+ describe('stopSponsoringContract', () => {
+ itEth('should remove pallet address from contract sponsors', async ({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(alice, 1000n);
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+ await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true);
+
expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
disabled: null,
});
-
+
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
-
+
// caller payed for call
expect(1000n * nominal > callerBalance).to.be.true;
expect(contractBalanceAfter).to.be.equal(1000n * nominal);
});
- });
-
- itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('can not be called by non-admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]))
+ .to.be.rejectedWith(/appPromotion\.NoPermission/);
});
- });
-
- itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractHelper = contractHelpers(web3, contractOwner);
- await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
});
});
-});
-
-describe('app-promotion rewards', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can not be called by non admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('rewards', () => {
+ itSub('can not be called by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected;
+ await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission');
});
- });
-
- it('should credit 0.05% for staking period', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should increase total staked', async ({helper}) => {
const staker = accounts.pop()!;
-
+ const totalStakedBefore = await helper.staking.getTotalStaked();
+ await helper.staking.stake(staker, 100n * nominal);
+
+ // Wait for rewards and pay
+ const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block));
+ const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n);
+
+ const totalStakedAfter = await helper.staking.getTotalStaked();
+ expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout);
+ // staker can unstake
+ await helper.staking.unstake(staker);
+ expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n));
+ });
+
+ itSub('should credit 0.05% for staking period', async ({helper}) => {
+ const staker = accounts.pop()!;
+
await waitPromotionPeriodDoesntEnd(helper);
-
+
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
-
+
// wait rewards are available:
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
-
- const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]);
+ const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block));
+
+ const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout;
+ expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n));
+
+ const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n));
+ expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n));
});
- });
-
- it('shoud be paid for more than one period if payments was missed', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
// wait for two rewards are available:
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
+
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2);
- expect(stakedPerBlock[0][1]).to.be.equal(frozenBalanceShouldBe);
-
+ expect(stake.amount).to.be.equal(frozenBalanceShouldBe);
+
const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address);
-
+
expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe});
});
- });
-
- it('should not be credited for unstaked (reserved) balance', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => {
// staker unstakes before rewards has been payed
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
+ const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
await helper.staking.unstake(staker);
-
+
// so he did not receive any rewards
const totalBalanceBefore = await helper.balance.getSubstrate(staker.address);
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ await helper.admin.payoutStakers(palletAdmin, 100);
const totalBalanceAfter = await helper.balance.getSubstrate(staker.address);
-
+
expect(totalBalanceBefore).to.be.equal(totalBalanceAfter);
});
- });
-
- it('should bring compound interest', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should bring compound interest', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
-
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n)]);
-
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2)]);
+
+ let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block));
+
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n));
+
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2));
});
- });
-
- it.skip('can be paid 1000 rewards in a time', async () => {
- // all other stakes should be unstaked
- await usingPlaygrounds(async (helper) => {
+
+ itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => {
+ // all other stakes should be unstaked
const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice);
-
+
// stakers stakes 10 times each
for (let i = 0; i < 10; i++) {
await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
}
await helper.wait.newBlocks(40);
- const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ await helper.admin.payoutStakers(palletAdmin, 100);
});
- });
-
- it.skip('can handle 40.000 rewards', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub.skip('can handle 40.000 rewards', async ({helper}) => {
const [donor] = await helper.arrange.createAccounts([7_000_000n], alice);
const crowdStakes = async () => {
// each account in the crowd stakes 2 times
@@ -763,11 +686,11 @@
await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
//
};
-
+
for (let i = 0; i < 40; i++) {
await crowdStakes();
}
-
+
// TODO pay rewards for some period
});
});
tests/src/block-production.test.tsdiffbeforeafterboth--- a/tests/src/block-production.test.ts
+++ b/tests/src/block-production.test.ts
@@ -14,9 +14,8 @@
// 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 usingApi from './substrate/substrate-api';
-import {expect} from 'chai';
import {ApiPromise} from '@polkadot/api';
+import {expect, itSub} from './util/playgrounds';
const BLOCK_TIME_MS = 12000;
const TOLERANCE_MS = 3000;
@@ -37,10 +36,8 @@
}
describe('Block Production smoke test', () => {
- it('Node produces new blocks', async () => {
- await usingApi(async (api) => {
- const blocks: number[] | undefined = await getBlocks(api);
- expect(blocks[0]).to.be.lessThan(blocks[1]);
- });
+ itSub('Node produces new blocks', async ({helper}) => {
+ const blocks: number[] | undefined = await getBlocks(helper.api!);
+ expect(blocks[0]).to.be.lessThan(blocks[1]);
});
});
tests/src/connection.test.tsdiffbeforeafterboth--- a/tests/src/connection.test.ts
+++ b/tests/src/connection.test.ts
@@ -14,29 +14,19 @@
// 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 usingApi from './substrate/substrate-api';
-import {WsProvider} from '@polkadot/api';
-import * as chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-
-chai.use(chaiAsPromised);
-
-const expect = chai.expect;
+import {itSub, expect, usingPlaygrounds} from './util/playgrounds';
describe('Connection smoke test', () => {
- it('Connection can be established', async () => {
- await usingApi(async api => {
- const health = await api.rpc.system.health();
- expect(health).to.be.not.empty;
- });
+ itSub('Connection can be established', async ({helper}) => {
+ const health = (await helper.callRpc('api.rpc.system.health')).toJSON();
+ expect(health).to.be.not.empty;
});
it('Cannot connect to 255.255.255.255', async () => {
- const neverConnectProvider = new WsProvider('ws://255.255.255.255:9944');
await expect((async () => {
- await usingApi(async api => {
- await api.rpc.system.health();
- }, {provider: neverConnectProvider});
+ await usingPlaygrounds(async helper => {
+ await helper.callRpc('api.rpc.system.health');
+ }, 'ws://255.255.255.255:9944');
})()).to.be.eventually.rejected;
});
});
tests/src/contracts.test.tsdiffbeforeafterboth--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -47,6 +47,7 @@
const gasLimit = 9000n * 1000000n;
const marketContractAddress = '5CYN9j3YvRkqxewoxeSvRbhAym4465C57uMmX5j4yz99L5H6';
+// todo:playgrounds skipped ~ postponed
describe.skip('Contracts', () => {
it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/enableContractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/enableContractSponsoring.test.ts
+++ b/tests/src/enableContractSponsoring.test.ts
@@ -29,6 +29,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
+// todo:playgrounds skipped ~ postponed
describe.skip('Integration Test enableContractSponsoring', () => {
it('ensure tx fee is paid from endowment', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -15,15 +15,12 @@
/// @dev inlined interface
interface ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -34,10 +31,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- external
- view
- returns (address);
+ function contractOwner(address contractAddress) external view returns (address);
/// Set sponsor.
/// @param contractAddress Contract for which a sponsor is being established.
@@ -73,12 +67,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- external
- view
- returns (Tuple0 memory);
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) external view returns (Tuple0 memory);
/// Check tat contract has confirmed sponsor.
///
@@ -94,17 +85,11 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- external
- view
- returns (bool);
+ function hasPendingSponsor(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function sponsoringEnabled(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0xfde8a560,
/// or in textual repr: setSponsoringMode(address,uint8)
@@ -113,12 +98,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- external
- view
- returns (uint32);
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) external view returns (uint32);
/// Set contract sponsoring rate limit
/// @dev Sponsoring rate limit - is a minimum amount of blocks that should
@@ -128,8 +110,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- external;
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external;
/// Set contract sponsoring fee limit
/// @dev Sponsoring fee limit - is maximum fee that could be spent by
@@ -139,19 +120,15 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- external;
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external;
/// Get current contract sponsoring fee limit
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- external
- view
- returns (uint256);
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) external view returns (uint256);
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
@@ -160,10 +137,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- external
- view
- returns (bool);
+ function allowed(address contractAddress, address user) external view returns (bool);
/// Toggle user presence in contract allowlist
/// @param contractAddress Contract to change allowlist of
@@ -187,10 +161,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function allowlistEnabled(address contractAddress) external view returns (bool);
/// Toggle contract allowlist access
/// @param contractAddress Contract to change allowlist access of
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -13,7 +13,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -21,8 +21,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -39,10 +38,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -62,6 +58,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -81,9 +78,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple6 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple6 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -153,8 +150,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -227,7 +223,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -291,11 +287,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev the ERC-165 identifier for this interface is 0x942e8b22
@@ -338,17 +330,7 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueFungible is
- Dummy,
- ERC165,
- ERC20,
- ERC20Mintable,
- ERC20UniqueExtensions,
- Collection
-{}
+interface UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -399,9 +392,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -410,9 +401,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
}
/// @dev anonymous struct
@@ -436,10 +425,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count NFTs tracked by this contract
/// @return A count of valid NFTs tracked by this contract, where each one of
@@ -479,21 +465,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -577,10 +551,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueNFT is
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -401,9 +394,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -412,19 +403,14 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
/// Returns EVM address for refungible token
///
/// @param token ID of the token
/// @dev EVM selector for this function is: 0xab76fac6,
/// or in textual repr: tokenContractAddress(uint256)
- function tokenContractAddress(uint256 token)
- external
- view
- returns (address);
+ function tokenContractAddress(uint256 token) external view returns (address);
}
/// @dev anonymous struct
@@ -448,10 +434,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count RFTs tracked by this contract
/// @return A count of valid RFTs tracked by this contract, where each one of
@@ -489,21 +472,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -585,10 +556,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueRefungible is
tests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungibleToken.sol
+++ b/tests/src/eth/api/UniqueRefungibleToken.sol
@@ -44,11 +44,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -120,16 +116,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+interface UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -56,7 +56,7 @@
await submitTransactionAsync(sponsor, confirmTx);
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address);
});
@@ -77,7 +77,7 @@
await collectionEvm.methods.removeCollectionSponsor().send({from: owner});
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');
});
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -223,7 +223,7 @@
const helpers = contractHelpers(web3, owner);
await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(flipper.options.address);
expect(result[1]).to.be.eq('0');
@@ -237,7 +237,7 @@
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(sponsor);
expect(result[1]).to.be.eq('0');
@@ -482,7 +482,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
+ expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
});
});
@@ -551,7 +551,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
});
itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
@@ -559,7 +559,7 @@
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
});
itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
tests/src/eth/fungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -159,6 +159,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple6",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -183,23 +200,6 @@
"name": "deleteCollectionProperty",
"outputs": [],
"stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple6",
- "name": "",
- "type": "tuple"
- }
- ],
- "stateMutability": "view",
"type": "function"
},
{
@@ -453,7 +453,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -651,7 +651,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/reFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -660,7 +660,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -111,18 +111,8 @@
"type": "address"
}
],
- "name": "getSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple0",
- "name": "",
- "type": "tuple"
- }
- ],
+ "name": "hasPendingSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -134,8 +124,8 @@
"type": "address"
}
],
- "name": "getSponsoringFeeLimit",
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "name": "hasSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -147,9 +137,9 @@
"type": "address"
}
],
- "name": "getSponsoringRateLimit",
- "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
- "stateMutability": "view",
+ "name": "removeSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -160,9 +150,9 @@
"type": "address"
}
],
- "name": "hasPendingSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "selfSponsoredEnable",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -171,11 +161,12 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "address", "name": "sponsor", "type": "address" }
],
- "name": "hasSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "setSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -184,9 +175,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
],
- "name": "removeSponsor",
+ "name": "setSponsoringFeeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -197,9 +189,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint8", "name": "mode", "type": "uint8" }
],
- "name": "selfSponsoredEnable",
+ "name": "setSponsoringMode",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -211,9 +204,9 @@
"name": "contractAddress",
"type": "address"
},
- { "internalType": "address", "name": "sponsor", "type": "address" }
+ { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
],
- "name": "setSponsor",
+ "name": "setSponsoringRateLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -224,12 +217,21 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
+ }
+ ],
+ "name": "sponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple0",
+ "name": "",
+ "type": "tuple"
+ }
],
- "name": "setSponsoringFeeLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
},
{
@@ -238,12 +240,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint8", "name": "mode", "type": "uint8" }
+ }
],
- "name": "setSponsoringMode",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -252,12 +253,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+ }
],
- "name": "setSponsoringRateLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringFeeLimit",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -268,8 +268,8 @@
"type": "address"
}
],
- "name": "sponsoringEnabled",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "name": "sponsoringRateLimit",
+ "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
"stateMutability": "view",
"type": "function"
},
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -198,8 +198,24 @@
}
`);
}
-}
-
+
+ async deployFlipper(signer: string): Promise<Contract> {
+ return await this.helper.ethContract.deployByCode(signer, 'Flipper', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract Flipper {
+ bool value = false;
+ function flip() public {
+ value = !value;
+ }
+ function getValue() public view returns (bool) {
+ return value;
+ }
+ }
+ `);
+ }
+}
class EthAddressGroup extends EthGroupBase {
extractCollectionId(address: string): number {
tests/src/evmCoder.test.tsdiffbeforeafterboth--- a/tests/src/evmCoder.test.ts
+++ b/tests/src/evmCoder.test.ts
@@ -14,13 +14,11 @@
// 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 Web3 from 'web3';
-import {createEthAccountWithBalance, createNonfungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers';
+import {itEth, expect, usingEthPlaygrounds} from './eth/util/playgrounds';
import * as solc from 'solc';
-import chai from 'chai';
-const expect = chai.expect;
-
async function compileTestContract(collectionAddress: string, contractAddress: string) {
const input = {
language: 'Solidity',
@@ -79,22 +77,30 @@
};
}
-async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string) {
+async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string, gas: number) {
const compiled = await compileTestContract(collectionAddress, contractAddress);
const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, {
data: compiled.object,
from: owner,
- ...GAS_ARGS,
+ gas,
});
return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner});
}
describe('Evm Coder tests', () => {
- itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner);
- const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c');
- const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address);
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (_helper, privateKey) => {
+ donor = privateKey('//Alice');
+ });
+ });
+
+ itEth('Call non-existing function', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST');
+ const contract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c', helper.eth.DEFAULT_GAS);
+ const testContract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, contract.options.address, helper.eth.DEFAULT_GAS);
{
const result = await testContract.methods.test1().send();
expect(result.events.Result.returnValues).to.deep.equal({
tests/src/fungible.test.tsdiffbeforeafterboth--- a/tests/src/fungible.test.ts
+++ b/tests/src/fungible.test.ts
@@ -15,18 +15,18 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {IKeyringPair} from '@polkadot/types/types';
-import {U128_MAX} from './util/helpers';
import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-// todo:playgrounds get rid of globals
-let alice: IKeyringPair;
-let bob: IKeyringPair;
+const U128_MAX = (1n << 128n) - 1n;
describe('integration test: Fungible functionality:', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor);
});
});
@@ -82,7 +82,7 @@
expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n);
expect(await collection.getBalance(ethAcc)).to.be.equal(140n);
- await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected;
+ await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejectedWith(/common\.TokenValueTooLow/);
});
itSub('Tokens multiple creation', async ({helper}) => {
tests/src/inflation.test.tsdiffbeforeafterboth--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -14,42 +14,45 @@
// 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 chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
+import {IKeyringPair} from '@polkadot/types/types';
+import {expect, itSub, usingPlaygrounds} from './util/playgrounds';
+// todo:playgrounds requires sudo, look into on the later stage
describe('integration test: Inflation', () => {
- it('First year inflation is 10%', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
+ let superuser: IKeyringPair;
- // Make sure non-sudo can't start inflation
- const tx = api.tx.inflation.startInflation(1);
- const bob = privateKeyWrapper('//Bob');
- await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
+ before(async () => {
+ await usingPlaygrounds(async (_, privateKey) => {
+ superuser = privateKey('//Alice');
+ });
+ });
+
+ itSub('First year inflation is 10%', async ({helper}) => {
+ // Make sure non-sudo can't start inflation
+ const [bob] = await helper.arrange.createAccounts([10n], superuser);
- // Start inflation on relay block 1 (Alice is sudo)
- const alice = privateKeyWrapper('//Alice');
- const sudoTx = api.tx.sudo.sudo(tx as any);
- await submitTransactionAsync(alice, sudoTx);
+ await expect(helper.executeExtrinsic(bob, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/);
- const blockInterval = (api.consts.inflation.inflationBlockInterval).toBigInt();
- const totalIssuanceStart = (await api.query.inflation.startingYearTotalIssuance()).toBigInt();
- const blockInflation = (await api.query.inflation.blockInflation()).toBigInt();
+ // Make sure superuser can't start inflation without explicit sudo
+ await expect(helper.executeExtrinsic(superuser, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/);
- const YEAR = 5259600n; // 6-second block. Blocks in one year
- // const YEAR = 2629800n; // 12-second block. Blocks in one year
+ // Start inflation on relay block 1 (Alice is sudo)
+ const tx = helper.constructApiCall('api.tx.inflation.startInflation', [1]);
+ await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [tx])).to.not.be.rejected;
- const totalExpectedInflation = totalIssuanceStart / 10n;
- const totalActualInflation = blockInflation * YEAR / blockInterval;
+ const blockInterval = (helper.api!.consts.inflation.inflationBlockInterval as any).toBigInt();
+ const totalIssuanceStart = ((await helper.api!.query.inflation.startingYearTotalIssuance()) as any).toBigInt();
+ const blockInflation = (await helper.api!.query.inflation.blockInflation() as any).toBigInt();
- const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation
- const expectedInflation = totalExpectedInflation / totalActualInflation - 1n;
+ const YEAR = 5259600n; // 6-second block. Blocks in one year
+ // const YEAR = 2629800n; // 12-second block. Blocks in one year
+
+ const totalExpectedInflation = totalIssuanceStart / 10n;
+ const totalActualInflation = blockInflation * YEAR / blockInterval;
+
+ const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation
+ const expectedInflation = totalExpectedInflation / totalActualInflation - 1n;
- expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);
- });
+ expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);
});
-
});
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -9,7 +9,7 @@
import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime';
-import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
+import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
@@ -25,7 +25,7 @@
**/
nominal: u128 & AugmentedConst<ApiType>;
/**
- * The app's pallet id, used for deriving its sovereign account ID.
+ * The app's pallet id, used for deriving its sovereign account address.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
@@ -155,6 +155,17 @@
**/
[key: string]: Codec;
};
+ tokens: {
+ maxLocks: u32 & AugmentedConst<ApiType>;
+ /**
+ * The maximum number of named reserves that can exist on an account.
+ **/
+ maxReserves: u32 & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
transactionPayment: {
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
@@ -232,5 +243,22 @@
**/
[key: string]: Codec;
};
+ xTokens: {
+ /**
+ * Base XCM weight.
+ *
+ * The actually weight for an XCM message is `T::BaseXcmWeight +
+ * T::Weigher::weight(&msg)`.
+ **/
+ baseXcmWeight: u64 & AugmentedConst<ApiType>;
+ /**
+ * Self chain location.
+ **/
+ selfLocation: XcmV1MultiLocation & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
} // AugmentedConsts
} // declare module
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -303,6 +303,10 @@
**/
NoPermission: AugmentedError<ApiType>;
/**
+ * Number of methods that sponsored limit is defined for exceeds maximum.
+ **/
+ TooManyMethodsHaveSponsoredLimit: AugmentedError<ApiType>;
+ /**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
@@ -321,6 +325,29 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ foreignAssets: {
+ /**
+ * AssetId exists
+ **/
+ AssetIdExisted: AugmentedError<ApiType>;
+ /**
+ * AssetId not exists
+ **/
+ AssetIdNotExists: AugmentedError<ApiType>;
+ /**
+ * The given location could not be used (e.g. because it cannot be expressed in the
+ * desired version of XCM).
+ **/
+ BadLocation: AugmentedError<ApiType>;
+ /**
+ * MultiLocation existed
+ **/
+ MultiLocationExisted: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
fungible: {
/**
* Fungible token does not support nesting.
@@ -697,6 +724,41 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ tokens: {
+ /**
+ * Cannot convert Amount into Balance type
+ **/
+ AmountIntoBalanceFailed: AugmentedError<ApiType>;
+ /**
+ * The balance is too low
+ **/
+ BalanceTooLow: AugmentedError<ApiType>;
+ /**
+ * Beneficiary account must pre-exist
+ **/
+ DeadAccount: AugmentedError<ApiType>;
+ /**
+ * Value too low to create account due to existential deposit
+ **/
+ ExistentialDeposit: AugmentedError<ApiType>;
+ /**
+ * Transfer/payment would kill account
+ **/
+ KeepAlive: AugmentedError<ApiType>;
+ /**
+ * Failed because liquidity restrictions due to locking
+ **/
+ LiquidityRestrictions: AugmentedError<ApiType>;
+ /**
+ * Failed because the maximum locks was exceeded
+ **/
+ MaxLocksExceeded: AugmentedError<ApiType>;
+ TooManyReserves: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
@@ -802,5 +864,90 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ xTokens: {
+ /**
+ * Asset has no reserve location.
+ **/
+ AssetHasNoReserve: AugmentedError<ApiType>;
+ /**
+ * The specified index does not exist in a MultiAssets struct.
+ **/
+ AssetIndexNonExistent: AugmentedError<ApiType>;
+ /**
+ * The version of the `Versioned` value used is not able to be
+ * interpreted.
+ **/
+ BadVersion: AugmentedError<ApiType>;
+ /**
+ * Could not re-anchor the assets to declare the fees for the
+ * destination chain.
+ **/
+ CannotReanchor: AugmentedError<ApiType>;
+ /**
+ * The destination `MultiLocation` provided cannot be inverted.
+ **/
+ DestinationNotInvertible: AugmentedError<ApiType>;
+ /**
+ * We tried sending distinct asset and fee but they have different
+ * reserve chains.
+ **/
+ DistinctReserveForAssetAndFee: AugmentedError<ApiType>;
+ /**
+ * Fee is not enough.
+ **/
+ FeeNotEnough: AugmentedError<ApiType>;
+ /**
+ * Could not get ancestry of asset reserve location.
+ **/
+ InvalidAncestry: AugmentedError<ApiType>;
+ /**
+ * The MultiAsset is invalid.
+ **/
+ InvalidAsset: AugmentedError<ApiType>;
+ /**
+ * Invalid transfer destination.
+ **/
+ InvalidDest: AugmentedError<ApiType>;
+ /**
+ * MinXcmFee not registered for certain reserve location
+ **/
+ MinXcmFeeNotDefined: AugmentedError<ApiType>;
+ /**
+ * Not cross-chain transfer.
+ **/
+ NotCrossChainTransfer: AugmentedError<ApiType>;
+ /**
+ * Currency is not cross-chain transferable.
+ **/
+ NotCrossChainTransferableCurrency: AugmentedError<ApiType>;
+ /**
+ * Not supported MultiLocation
+ **/
+ NotSupportedMultiLocation: AugmentedError<ApiType>;
+ /**
+ * The number of assets to be sent is over the maximum.
+ **/
+ TooManyAssetsBeingSent: AugmentedError<ApiType>;
+ /**
+ * The message's weight could not be determined.
+ **/
+ UnweighableMessage: AugmentedError<ApiType>;
+ /**
+ * XCM execution failed.
+ **/
+ XcmExecutionFailed: AugmentedError<ApiType>;
+ /**
+ * The transfering asset amount is zero.
+ **/
+ ZeroAmount: AugmentedError<ApiType>;
+ /**
+ * The fee is zero.
+ **/
+ ZeroFee: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
} // AugmentedErrors
} // declare module
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -9,7 +9,7 @@
import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
+import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -20,14 +20,14 @@
* The admin was set
*
* # Arguments
- * * AccountId: ID of the admin
+ * * AccountId: account address of the admin
**/
SetAdmin: AugmentedEvent<ApiType, [AccountId32]>;
/**
* Staking was performed
*
* # Arguments
- * * AccountId: ID of the staker
+ * * AccountId: account of the staker
* * Balance : staking amount
**/
Stake: AugmentedEvent<ApiType, [AccountId32, u128]>;
@@ -35,7 +35,7 @@
* Staking recalculation was performed
*
* # Arguments
- * * AccountId: ID of the staker.
+ * * AccountId: account of the staker.
* * Balance : recalculation base
* * Balance : total income
**/
@@ -44,7 +44,7 @@
* Unstaking was performed
*
* # Arguments
- * * AccountId: ID of the staker
+ * * AccountId: account of the staker
* * Balance : unstaking amount
**/
Unstake: AugmentedEvent<ApiType, [AccountId32, u128]>;
@@ -264,6 +264,28 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ foreignAssets: {
+ /**
+ * The asset registered.
+ **/
+ AssetRegistered: AugmentedEvent<ApiType, [assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The asset updated.
+ **/
+ AssetUpdated: AugmentedEvent<ApiType, [assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The foreign asset registered.
+ **/
+ ForeignAssetRegistered: AugmentedEvent<ApiType, [assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The foreign asset updated.
+ **/
+ ForeignAssetUpdated: AugmentedEvent<ApiType, [assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
parachainSystem: {
/**
* Downward messages were processed using the given weight.
@@ -525,6 +547,66 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ tokens: {
+ /**
+ * A balance was set by root.
+ **/
+ BalanceSet: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, free: u128, reserved: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, free: u128, reserved: u128 }>;
+ /**
+ * Deposited some balance into an account
+ **/
+ Deposited: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * An account was removed whose balance was non-zero but below
+ * ExistentialDeposit, resulting in an outright loss.
+ **/
+ DustLost: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * An account was created with some free balance.
+ **/
+ Endowed: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some locked funds were unlocked
+ **/
+ LockRemoved: AugmentedEvent<ApiType, [lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32], { lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32 }>;
+ /**
+ * Some funds are locked
+ **/
+ LockSet: AugmentedEvent<ApiType, [lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some balance was reserved (moved from free to reserved).
+ **/
+ Reserved: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some reserved balance was repatriated (moved from reserved to
+ * another account).
+ **/
+ ReserveRepatriated: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128, status: FrameSupportTokensMiscBalanceStatus], { currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128, status: FrameSupportTokensMiscBalanceStatus }>;
+ /**
+ * Some balances were slashed (e.g. due to mis-behavior)
+ **/
+ Slashed: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, freeAmount: u128, reservedAmount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, freeAmount: u128, reservedAmount: u128 }>;
+ /**
+ * The total issuance of an currency has been set
+ **/
+ TotalIssuanceSet: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, amount: u128], { currencyId: PalletForeignAssetsAssetIds, amount: u128 }>;
+ /**
+ * Transfer succeeded.
+ **/
+ Transfer: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128 }>;
+ /**
+ * Some balance was unreserved (moved from reserved to free).
+ **/
+ Unreserved: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some balances were withdrawn (e.g. pay for transaction fee)
+ **/
+ Withdrawn: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
@@ -713,5 +795,15 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ xTokens: {
+ /**
+ * Transferred `MultiAsset` with fee.
+ **/
+ TransferredMultiAssets: AugmentedEvent<ApiType, [sender: AccountId32, assets: XcmV1MultiassetMultiAssets, fee: XcmV1MultiAsset, dest: XcmV1MultiLocation], { sender: AccountId32, assets: XcmV1MultiassetMultiAssets, fee: XcmV1MultiAsset, dest: XcmV1MultiLocation }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
} // AugmentedEvents
} // declare module
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -9,7 +9,7 @@
import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -18,21 +18,41 @@
declare module '@polkadot/api-base/types/storage' {
interface AugmentedQueries<ApiType extends ApiTypes> {
appPromotion: {
+ /**
+ * Stores the `admin` account. Some extrinsics can only be executed if they were signed by `admin`.
+ **/
admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Stores a key for record for which the next revenue recalculation would be performed.
* If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
**/
nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Stores amount of stakes for an `Account`.
+ *
+ * * **Key** - Staker account.
+ * * **Value** - Amount of stakes.
+ **/
pendingUnstake: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[AccountId32, u128]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
- * Amount of tokens staked by account in the blocknumber.
+ * Stores the amount of tokens staked by account in the blocknumber.
+ *
+ * * **Key1** - Staker account.
+ * * **Key2** - Relay block number when the stake was made.
+ * * **(Balance, BlockNumber)** - Balance of the stake.
+ * The number of the relay block in which we must perform the interest recalculation
**/
staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
- * Amount of stakes for an Account
+ * Stores amount of stakes for an `Account`.
+ *
+ * * **Key** - Staker account.
+ * * **Value** - Amount of stakes.
**/
stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ /**
+ * Stores the total staked amount.
+ **/
totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
@@ -245,13 +265,6 @@
**/
owner: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<H160>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
selfSponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
- /**
- * Storage for last sponsored block.
- *
- * * **Key1** - contract address.
- * * **Key2** - sponsored user address.
- * * **Value** - last sponsored block number.
- **/
sponsorBasket: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<Option<u32>>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;
/**
* Store for contract sponsorship state.
@@ -261,6 +274,14 @@
**/
sponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<UpDataStructsSponsorshipStateBasicCrossAccountIdRepr>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
/**
+ * Storage for last sponsored block.
+ *
+ * * **Key1** - contract address.
+ * * **Key2** - sponsored user address.
+ * * **Value** - last sponsored block number.
+ **/
+ sponsoringFeeLimit: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<BTreeMap<u32, U256>>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
* Store for sponsoring mode.
*
* ### Usage
@@ -289,6 +310,41 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
+ foreignAssets: {
+ /**
+ * The storages for assets to fungible collection binding
+ *
+ **/
+ assetBinding: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * The storages for AssetMetadatas.
+ *
+ * AssetMetadatas: map AssetIds => Option<AssetMetadata>
+ **/
+ assetMetadatas: AugmentedQuery<ApiType, (arg: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Option<PalletForeignAssetsModuleAssetMetadata>>, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [PalletForeignAssetsAssetIds]>;
+ /**
+ * The storages for MultiLocations.
+ *
+ * ForeignAssetLocations: map ForeignAssetId => Option<MultiLocation>
+ **/
+ foreignAssetLocations: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<XcmV1MultiLocation>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * The storages for CurrencyIds.
+ *
+ * LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>
+ **/
+ locationToCurrencyIds: AugmentedQuery<ApiType, (arg: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array) => Observable<Option<u32>>, [XcmV1MultiLocation]> & QueryableStorageEntry<ApiType, [XcmV1MultiLocation]>;
+ /**
+ * Next available Foreign AssetId ID.
+ *
+ * NextForeignAssetId: ForeignAssetId
+ **/
+ nextForeignAssetId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
fungible: {
/**
* Storage for assets delegated to a limited extent to other users.
@@ -744,6 +800,34 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
+ tokens: {
+ /**
+ * The balance of a token type under an account.
+ *
+ * NOTE: If the total is ever zero, decrease account ref account.
+ *
+ * NOTE: This is only used in the case that this module is used to store
+ * balances.
+ **/
+ accounts: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<OrmlTokensAccountData>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * Any liquidity locks of a token type under an account.
+ * NOTE: Should only be accessed when setting, changing and freeing a lock.
+ **/
+ locks: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Vec<OrmlTokensBalanceLock>>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * Named reserves on some account balances.
+ **/
+ reserves: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Vec<OrmlTokensReserveData>>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * The total issuance of a token type.
+ **/
+ totalIssuance: AugmentedQuery<ApiType, (arg: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<u128>, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [PalletForeignAssetsAssetIds]>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
transactionPayment: {
nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletTransactionPaymentReleases>, []> & QueryableStorageEntry<ApiType, []>;
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -9,7 +9,7 @@
import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
@@ -18,13 +18,101 @@
declare module '@polkadot/api-base/types/submittable' {
interface AugmentedSubmittables<ApiType extends ApiTypes> {
appPromotion: {
+ /**
+ * Recalculates interest for the specified number of stakers.
+ * If all stakers are not recalculated, the next call of the extrinsic
+ * will continue the recalculation, from those stakers for whom this
+ * was not perform in last call.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `stakers_number`: the number of stakers for which recalculation will be performed
+ **/
payoutStakers: AugmentedSubmittable<(stakersNumber: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u8>]>;
+ /**
+ * Sets an address as the the admin.
+ *
+ * # Permissions
+ *
+ * * Sudo
+ *
+ * # Arguments
+ *
+ * * `admin`: account of the new admin.
+ **/
setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Sets the pallet to be the sponsor for the collection.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `collection_id`: ID of the collection that will be sponsored by `pallet_id`
+ **/
sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Sets the pallet to be the sponsor for the contract.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `contract_id`: the contract address that will be sponsored by `pallet_id`
+ **/
sponsorContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Stakes the amount of native tokens.
+ * Sets `amount` to the locked state.
+ * The maximum number of stakes for a staker is 10.
+ *
+ * # Arguments
+ *
+ * * `amount`: in native tokens.
+ **/
stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
+ /**
+ * Removes the pallet as the sponsor for the collection.
+ * Returns [`NoPermission`][`Error::NoPermission`]
+ * if the pallet wasn't the sponsor.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `collection_id`: ID of the collection that is sponsored by `pallet_id`
+ **/
stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Removes the pallet as the sponsor for the contract.
+ * Returns [`NoPermission`][`Error::NoPermission`]
+ * if the pallet wasn't the sponsor.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `contract_id`: the contract address that is sponsored by `pallet_id`
+ **/
stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Unstakes all stakes.
+ * Moves the sum of all stakes to the `reserved` state.
+ * After the end of `PendingInterval` this sum becomes completely
+ * free for further use.
+ **/
unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Generic tx
@@ -216,6 +304,14 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ foreignAssets: {
+ registerForeignAsset: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>;
+ updateForeignAsset: AugmentedSubmittable<(foreignAssetId: u32 | AnyNumber | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
inflation: {
/**
* This method sets the inflation start date. Can be only called once.
@@ -905,6 +1001,87 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ tokens: {
+ /**
+ * Exactly as `transfer`, except the origin must be root and the source
+ * account may be specified.
+ *
+ * The dispatch origin for this call must be _Root_.
+ *
+ * - `source`: The sender of the transfer.
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Set the balances of a given account.
+ *
+ * This will alter `FreeBalance` and `ReservedBalance` in storage. it
+ * will also decrease the total issuance of the system
+ * (`TotalIssuance`). If the new free or reserved balance is below the
+ * existential deposit, it will reap the `AccountInfo`.
+ *
+ * The dispatch origin for this call is `root`.
+ **/
+ setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, newFree: Compact<u128> | AnyNumber | Uint8Array, newReserved: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>, Compact<u128>]>;
+ /**
+ * Transfer some liquid free balance to another account.
+ *
+ * `transfer` will set the `FreeBalance` of the sender and receiver.
+ * It will decrease the total issuance of the system by the
+ * `TransferFee`. If the sender's account is below the existential
+ * deposit as a result of the transfer, the account will be reaped.
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ transfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Transfer all remaining balance to the given account.
+ *
+ * NOTE: This function only attempts to transfer _transferable_
+ * balances. This means that any locked, reserved, or existential
+ * deposits (when `keep_alive` is `true`), will not be transferred by
+ * this function. To ensure that this function results in a killed
+ * account, you might need to prepare the account by removing any
+ * reference counters, storage deposits, etc...
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `keep_alive`: A boolean to determine if the `transfer_all`
+ * operation should send all of the funds the account has, causing
+ * the sender account to be killed (false), or transfer everything
+ * except at least the existential deposit, which will guarantee to
+ * keep the sender account alive (true).
+ **/
+ transferAll: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, bool]>;
+ /**
+ * Same as the [`transfer`] call, but with a check that the transfer
+ * will not kill the origin account.
+ *
+ * 99% of the time you want [`transfer`] instead.
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
treasury: {
/**
* Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
@@ -1565,5 +1742,125 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ xTokens: {
+ /**
+ * Transfer native currencies.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transfer: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletForeignAssetsAssetIds, u128, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer `MultiAsset`.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiasset: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer several `MultiAsset` specifying the item to be used as fee
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee_item` is index of the MultiAssets that we want to use for
+ * payment
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiassets: AugmentedSubmittable<(assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAssets, u32, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer `MultiAsset` specifying the fee and amount as separate.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee` is the multiasset to be spent to pay for execution in
+ * destination chain. Both fee and amount will be subtracted form the
+ * callers balance For now we only accept fee and asset having the same
+ * `MultiLocation` id.
+ *
+ * If `fee` is not high enough to cover for the execution costs in the
+ * destination chain, then the assets will be trapped in the
+ * destination chain
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiassetWithFee: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, fee: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAsset, XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer several currencies specifying the item to be used as fee
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee_item` is index of the currencies tuple that we want to use for
+ * payment
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMulticurrencies: AugmentedSubmittable<(currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>> | ([PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>, u32, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer native currencies specifying the fee and amount as
+ * separate.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee` is the amount to be spent to pay for execution in destination
+ * chain. Both fee and amount will be subtracted form the callers
+ * balance.
+ *
+ * If `fee` is not high enough to cover for the execution costs in the
+ * destination chain, then the assets will be trapped in the
+ * destination chain
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferWithFee: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, fee: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletForeignAssetsAssetIds, u128, u128, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
} // AugmentedSubmittables
} // declare module
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -790,10 +790,19 @@
OriginKindV0: OriginKindV0;
OriginKindV1: OriginKindV1;
OriginKindV2: OriginKindV2;
+ OrmlTokensAccountData: OrmlTokensAccountData;
+ OrmlTokensBalanceLock: OrmlTokensBalanceLock;
+ OrmlTokensModuleCall: OrmlTokensModuleCall;
+ OrmlTokensModuleError: OrmlTokensModuleError;
+ OrmlTokensModuleEvent: OrmlTokensModuleEvent;
+ OrmlTokensReserveData: OrmlTokensReserveData;
OrmlVestingModuleCall: OrmlVestingModuleCall;
OrmlVestingModuleError: OrmlVestingModuleError;
OrmlVestingModuleEvent: OrmlVestingModuleEvent;
OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
+ OrmlXtokensModuleCall: OrmlXtokensModuleCall;
+ OrmlXtokensModuleError: OrmlXtokensModuleError;
+ OrmlXtokensModuleEvent: OrmlXtokensModuleEvent;
OutboundHrmpMessage: OutboundHrmpMessage;
OutboundLaneData: OutboundLaneData;
OutboundMessageFee: OutboundMessageFee;
@@ -841,6 +850,12 @@
PalletEvmEvent: PalletEvmEvent;
PalletEvmMigrationCall: PalletEvmMigrationCall;
PalletEvmMigrationError: PalletEvmMigrationError;
+ PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds;
+ PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata;
+ PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall;
+ PalletForeignAssetsModuleError: PalletForeignAssetsModuleError;
+ PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent;
+ PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency;
PalletFungibleError: PalletFungibleError;
PalletId: PalletId;
PalletInflationCall: PalletInflationCall;
@@ -1422,6 +1437,7 @@
XcmV2WeightLimit: XcmV2WeightLimit;
XcmV2Xcm: XcmV2Xcm;
XcmVersion: XcmVersion;
+ XcmVersionedMultiAsset: XcmVersionedMultiAsset;
XcmVersionedMultiAssets: XcmVersionedMultiAssets;
XcmVersionedMultiLocation: XcmVersionedMultiLocation;
XcmVersionedXcm: XcmVersionedXcm;
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -747,6 +747,163 @@
/** @name OpalRuntimeRuntime */
export interface OpalRuntimeRuntime extends Null {}
+/** @name OrmlTokensAccountData */
+export interface OrmlTokensAccountData extends Struct {
+ readonly free: u128;
+ readonly reserved: u128;
+ readonly frozen: u128;
+}
+
+/** @name OrmlTokensBalanceLock */
+export interface OrmlTokensBalanceLock extends Struct {
+ readonly id: U8aFixed;
+ readonly amount: u128;
+}
+
+/** @name OrmlTokensModuleCall */
+export interface OrmlTokensModuleCall extends Enum {
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isTransferAll: boolean;
+ readonly asTransferAll: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly keepAlive: bool;
+ } & Struct;
+ readonly isTransferKeepAlive: boolean;
+ readonly asTransferKeepAlive: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isForceTransfer: boolean;
+ readonly asForceTransfer: {
+ readonly source: MultiAddress;
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isSetBalance: boolean;
+ readonly asSetBalance: {
+ readonly who: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly newFree: Compact<u128>;
+ readonly newReserved: Compact<u128>;
+ } & Struct;
+ readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance';
+}
+
+/** @name OrmlTokensModuleError */
+export interface OrmlTokensModuleError extends Enum {
+ readonly isBalanceTooLow: boolean;
+ readonly isAmountIntoBalanceFailed: boolean;
+ readonly isLiquidityRestrictions: boolean;
+ readonly isMaxLocksExceeded: boolean;
+ readonly isKeepAlive: boolean;
+ readonly isExistentialDeposit: boolean;
+ readonly isDeadAccount: boolean;
+ readonly isTooManyReserves: boolean;
+ readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';
+}
+
+/** @name OrmlTokensModuleEvent */
+export interface OrmlTokensModuleEvent extends Enum {
+ readonly isEndowed: boolean;
+ readonly asEndowed: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isDustLost: boolean;
+ readonly asDustLost: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly from: AccountId32;
+ readonly to: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isReserved: boolean;
+ readonly asReserved: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isUnreserved: boolean;
+ readonly asUnreserved: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isReserveRepatriated: boolean;
+ readonly asReserveRepatriated: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly from: AccountId32;
+ readonly to: AccountId32;
+ readonly amount: u128;
+ readonly status: FrameSupportTokensMiscBalanceStatus;
+ } & Struct;
+ readonly isBalanceSet: boolean;
+ readonly asBalanceSet: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly free: u128;
+ readonly reserved: u128;
+ } & Struct;
+ readonly isTotalIssuanceSet: boolean;
+ readonly asTotalIssuanceSet: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ } & Struct;
+ readonly isWithdrawn: boolean;
+ readonly asWithdrawn: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isSlashed: boolean;
+ readonly asSlashed: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly freeAmount: u128;
+ readonly reservedAmount: u128;
+ } & Struct;
+ readonly isDeposited: boolean;
+ readonly asDeposited: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isLockSet: boolean;
+ readonly asLockSet: {
+ readonly lockId: U8aFixed;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isLockRemoved: boolean;
+ readonly asLockRemoved: {
+ readonly lockId: U8aFixed;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ } & Struct;
+ readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved';
+}
+
+/** @name OrmlTokensReserveData */
+export interface OrmlTokensReserveData extends Struct {
+ readonly id: Null;
+ readonly amount: u128;
+}
+
/** @name OrmlVestingModuleCall */
export interface OrmlVestingModuleCall extends Enum {
readonly isClaim: boolean;
@@ -806,6 +963,89 @@
readonly perPeriod: Compact<u128>;
}
+/** @name OrmlXtokensModuleCall */
+export interface OrmlXtokensModuleCall extends Enum {
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiasset: boolean;
+ readonly asTransferMultiasset: {
+ readonly asset: XcmVersionedMultiAsset;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferWithFee: boolean;
+ readonly asTransferWithFee: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ readonly fee: u128;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiassetWithFee: boolean;
+ readonly asTransferMultiassetWithFee: {
+ readonly asset: XcmVersionedMultiAsset;
+ readonly fee: XcmVersionedMultiAsset;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMulticurrencies: boolean;
+ readonly asTransferMulticurrencies: {
+ readonly currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>;
+ readonly feeItem: u32;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiassets: boolean;
+ readonly asTransferMultiassets: {
+ readonly assets: XcmVersionedMultiAssets;
+ readonly feeItem: u32;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets';
+}
+
+/** @name OrmlXtokensModuleError */
+export interface OrmlXtokensModuleError extends Enum {
+ readonly isAssetHasNoReserve: boolean;
+ readonly isNotCrossChainTransfer: boolean;
+ readonly isInvalidDest: boolean;
+ readonly isNotCrossChainTransferableCurrency: boolean;
+ readonly isUnweighableMessage: boolean;
+ readonly isXcmExecutionFailed: boolean;
+ readonly isCannotReanchor: boolean;
+ readonly isInvalidAncestry: boolean;
+ readonly isInvalidAsset: boolean;
+ readonly isDestinationNotInvertible: boolean;
+ readonly isBadVersion: boolean;
+ readonly isDistinctReserveForAssetAndFee: boolean;
+ readonly isZeroFee: boolean;
+ readonly isZeroAmount: boolean;
+ readonly isTooManyAssetsBeingSent: boolean;
+ readonly isAssetIndexNonExistent: boolean;
+ readonly isFeeNotEnough: boolean;
+ readonly isNotSupportedMultiLocation: boolean;
+ readonly isMinXcmFeeNotDefined: boolean;
+ readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';
+}
+
+/** @name OrmlXtokensModuleEvent */
+export interface OrmlXtokensModuleEvent extends Enum {
+ readonly isTransferredMultiAssets: boolean;
+ readonly asTransferredMultiAssets: {
+ readonly sender: AccountId32;
+ readonly assets: XcmV1MultiassetMultiAssets;
+ readonly fee: XcmV1MultiAsset;
+ readonly dest: XcmV1MultiLocation;
+ } & Struct;
+ readonly type: 'TransferredMultiAssets';
+}
+
/** @name PalletAppPromotionCall */
export interface PalletAppPromotionCall extends Enum {
readonly isSetAdminAddress: boolean;
@@ -1186,7 +1426,8 @@
export interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly isNoPendingSponsor: boolean;
- readonly type: 'NoPermission' | 'NoPendingSponsor';
+ readonly isTooManyMethodsHaveSponsoredLimit: boolean;
+ readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';
}
/** @name PalletEvmContractHelpersEvent */
@@ -1264,6 +1505,83 @@
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
+/** @name PalletForeignAssetsAssetIds */
+export interface PalletForeignAssetsAssetIds extends Enum {
+ readonly isForeignAssetId: boolean;
+ readonly asForeignAssetId: u32;
+ readonly isNativeAssetId: boolean;
+ readonly asNativeAssetId: PalletForeignAssetsNativeCurrency;
+ readonly type: 'ForeignAssetId' | 'NativeAssetId';
+}
+
+/** @name PalletForeignAssetsModuleAssetMetadata */
+export interface PalletForeignAssetsModuleAssetMetadata extends Struct {
+ readonly name: Bytes;
+ readonly symbol: Bytes;
+ readonly decimals: u8;
+ readonly minimalBalance: u128;
+}
+
+/** @name PalletForeignAssetsModuleCall */
+export interface PalletForeignAssetsModuleCall extends Enum {
+ readonly isRegisterForeignAsset: boolean;
+ readonly asRegisterForeignAsset: {
+ readonly owner: AccountId32;
+ readonly location: XcmVersionedMultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isUpdateForeignAsset: boolean;
+ readonly asUpdateForeignAsset: {
+ readonly foreignAssetId: u32;
+ readonly location: XcmVersionedMultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';
+}
+
+/** @name PalletForeignAssetsModuleError */
+export interface PalletForeignAssetsModuleError extends Enum {
+ readonly isBadLocation: boolean;
+ readonly isMultiLocationExisted: boolean;
+ readonly isAssetIdNotExists: boolean;
+ readonly isAssetIdExisted: boolean;
+ readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';
+}
+
+/** @name PalletForeignAssetsModuleEvent */
+export interface PalletForeignAssetsModuleEvent extends Enum {
+ readonly isForeignAssetRegistered: boolean;
+ readonly asForeignAssetRegistered: {
+ readonly assetId: u32;
+ readonly assetAddress: XcmV1MultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isForeignAssetUpdated: boolean;
+ readonly asForeignAssetUpdated: {
+ readonly assetId: u32;
+ readonly assetAddress: XcmV1MultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isAssetRegistered: boolean;
+ readonly asAssetRegistered: {
+ readonly assetId: PalletForeignAssetsAssetIds;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isAssetUpdated: boolean;
+ readonly asAssetUpdated: {
+ readonly assetId: PalletForeignAssetsAssetIds;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated';
+}
+
+/** @name PalletForeignAssetsNativeCurrency */
+export interface PalletForeignAssetsNativeCurrency extends Enum {
+ readonly isHere: boolean;
+ readonly isParent: boolean;
+ readonly type: 'Here' | 'Parent';
+}
+
/** @name PalletFungibleError */
export interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
@@ -2492,7 +2810,7 @@
readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;
readonly limits: UpDataStructsCollectionLimits;
readonly permissions: UpDataStructsCollectionPermissions;
- readonly externalCollection: bool;
+ readonly flags: U8aFixed;
}
/** @name UpDataStructsCollectionLimits */
@@ -2666,6 +2984,7 @@
readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
readonly properties: Vec<UpDataStructsProperty>;
readonly readOnly: bool;
+ readonly foreign: bool;
}
/** @name UpDataStructsSponsoringRateLimit */
@@ -3441,6 +3760,15 @@
/** @name XcmV2Xcm */
export interface XcmV2Xcm extends Vec<XcmV2Instruction> {}
+/** @name XcmVersionedMultiAsset */
+export interface XcmVersionedMultiAsset extends Enum {
+ readonly isV0: boolean;
+ readonly asV0: XcmV0MultiAsset;
+ readonly isV1: boolean;
+ readonly asV1: XcmV1MultiAsset;
+ readonly type: 'V0' | 'V1';
+}
+
/** @name XcmVersionedMultiAssets */
export interface XcmVersionedMultiAssets extends Enum {
readonly isV0: boolean;
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -323,118 +323,47 @@
perPeriod: 'Compact<u128>'
},
/**
- * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event<T>
+ * Lookup39: orml_xtokens::module::Event<T>
**/
- CumulusPalletXcmpQueueEvent: {
+ OrmlXtokensModuleEvent: {
_enum: {
- Success: {
- messageHash: 'Option<H256>',
- weight: 'u64',
- },
- Fail: {
- messageHash: 'Option<H256>',
- error: 'XcmV2TraitsError',
- weight: 'u64',
- },
- BadVersion: {
- messageHash: 'Option<H256>',
- },
- BadFormat: {
- messageHash: 'Option<H256>',
- },
- UpwardMessageSent: {
- messageHash: 'Option<H256>',
- },
- XcmpMessageSent: {
- messageHash: 'Option<H256>',
- },
- OverweightEnqueued: {
- sender: 'u32',
- sentAt: 'u32',
- index: 'u64',
- required: 'u64',
- },
- OverweightServiced: {
- index: 'u64',
- used: 'u64'
+ TransferredMultiAssets: {
+ sender: 'AccountId32',
+ assets: 'XcmV1MultiassetMultiAssets',
+ fee: 'XcmV1MultiAsset',
+ dest: 'XcmV1MultiLocation'
}
}
},
/**
- * Lookup41: xcm::v2::traits::Error
+ * Lookup40: xcm::v1::multiasset::MultiAssets
**/
- XcmV2TraitsError: {
- _enum: {
- Overflow: 'Null',
- Unimplemented: 'Null',
- UntrustedReserveLocation: 'Null',
- UntrustedTeleportLocation: 'Null',
- MultiLocationFull: 'Null',
- MultiLocationNotInvertible: 'Null',
- BadOrigin: 'Null',
- InvalidLocation: 'Null',
- AssetNotFound: 'Null',
- FailedToTransactAsset: 'Null',
- NotWithdrawable: 'Null',
- LocationCannotHold: 'Null',
- ExceedsMaxMessageSize: 'Null',
- DestinationUnsupported: 'Null',
- Transport: 'Null',
- Unroutable: 'Null',
- UnknownClaim: 'Null',
- FailedToDecode: 'Null',
- MaxWeightInvalid: 'Null',
- NotHoldingFees: 'Null',
- TooExpensive: 'Null',
- Trap: 'u64',
- UnhandledXcmVersion: 'Null',
- WeightLimitReached: 'u64',
- Barrier: 'Null',
- WeightNotComputable: 'Null'
- }
- },
+ XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
/**
- * Lookup43: pallet_xcm::pallet::Event<T>
+ * Lookup42: xcm::v1::multiasset::MultiAsset
**/
- PalletXcmEvent: {
- _enum: {
- Attempted: 'XcmV2TraitsOutcome',
- Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
- UnexpectedResponse: '(XcmV1MultiLocation,u64)',
- ResponseReady: '(u64,XcmV2Response)',
- Notified: '(u64,u8,u8)',
- NotifyOverweight: '(u64,u8,u8,u64,u64)',
- NotifyDispatchError: '(u64,u8,u8)',
- NotifyDecodeFailed: '(u64,u8,u8)',
- InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
- InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
- ResponseTaken: 'u64',
- AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
- VersionChangeNotified: '(XcmV1MultiLocation,u32)',
- SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
- NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
- NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
- }
+ XcmV1MultiAsset: {
+ id: 'XcmV1MultiassetAssetId',
+ fun: 'XcmV1MultiassetFungibility'
},
/**
- * Lookup44: xcm::v2::traits::Outcome
+ * Lookup43: xcm::v1::multiasset::AssetId
**/
- XcmV2TraitsOutcome: {
+ XcmV1MultiassetAssetId: {
_enum: {
- Complete: 'u64',
- Incomplete: '(u64,XcmV2TraitsError)',
- Error: 'XcmV2TraitsError'
+ Concrete: 'XcmV1MultiLocation',
+ Abstract: 'Bytes'
}
},
/**
- * Lookup45: xcm::v1::multilocation::MultiLocation
+ * Lookup44: xcm::v1::multilocation::MultiLocation
**/
XcmV1MultiLocation: {
parents: 'u8',
interior: 'XcmV1MultilocationJunctions'
},
/**
- * Lookup46: xcm::v1::multilocation::Junctions
+ * Lookup45: xcm::v1::multilocation::Junctions
**/
XcmV1MultilocationJunctions: {
_enum: {
@@ -450,7 +379,7 @@
}
},
/**
- * Lookup47: xcm::v1::junction::Junction
+ * Lookup46: xcm::v1::junction::Junction
**/
XcmV1Junction: {
_enum: {
@@ -478,7 +407,7 @@
}
},
/**
- * Lookup49: xcm::v0::junction::NetworkId
+ * Lookup48: xcm::v0::junction::NetworkId
**/
XcmV0JunctionNetworkId: {
_enum: {
@@ -489,7 +418,7 @@
}
},
/**
- * Lookup53: xcm::v0::junction::BodyId
+ * Lookup52: xcm::v0::junction::BodyId
**/
XcmV0JunctionBodyId: {
_enum: {
@@ -503,7 +432,7 @@
}
},
/**
- * Lookup54: xcm::v0::junction::BodyPart
+ * Lookup53: xcm::v0::junction::BodyPart
**/
XcmV0JunctionBodyPart: {
_enum: {
@@ -526,11 +455,230 @@
}
},
/**
- * Lookup55: xcm::v2::Xcm<Call>
+ * Lookup54: xcm::v1::multiasset::Fungibility
+ **/
+ XcmV1MultiassetFungibility: {
+ _enum: {
+ Fungible: 'Compact<u128>',
+ NonFungible: 'XcmV1MultiassetAssetInstance'
+ }
+ },
+ /**
+ * Lookup55: xcm::v1::multiasset::AssetInstance
+ **/
+ XcmV1MultiassetAssetInstance: {
+ _enum: {
+ Undefined: 'Null',
+ Index: 'Compact<u128>',
+ Array4: '[u8;4]',
+ Array8: '[u8;8]',
+ Array16: '[u8;16]',
+ Array32: '[u8;32]',
+ Blob: 'Bytes'
+ }
+ },
+ /**
+ * Lookup58: orml_tokens::module::Event<T>
+ **/
+ OrmlTokensModuleEvent: {
+ _enum: {
+ Endowed: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ DustLost: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Transfer: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ from: 'AccountId32',
+ to: 'AccountId32',
+ amount: 'u128',
+ },
+ Reserved: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Unreserved: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ ReserveRepatriated: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ from: 'AccountId32',
+ to: 'AccountId32',
+ amount: 'u128',
+ status: 'FrameSupportTokensMiscBalanceStatus',
+ },
+ BalanceSet: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ free: 'u128',
+ reserved: 'u128',
+ },
+ TotalIssuanceSet: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ },
+ Withdrawn: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Slashed: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ freeAmount: 'u128',
+ reservedAmount: 'u128',
+ },
+ Deposited: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ LockSet: {
+ lockId: '[u8;8]',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ LockRemoved: {
+ lockId: '[u8;8]',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32'
+ }
+ }
+ },
+ /**
+ * Lookup59: pallet_foreign_assets::AssetIds
+ **/
+ PalletForeignAssetsAssetIds: {
+ _enum: {
+ ForeignAssetId: 'u32',
+ NativeAssetId: 'PalletForeignAssetsNativeCurrency'
+ }
+ },
+ /**
+ * Lookup60: pallet_foreign_assets::NativeCurrency
+ **/
+ PalletForeignAssetsNativeCurrency: {
+ _enum: ['Here', 'Parent']
+ },
+ /**
+ * Lookup61: cumulus_pallet_xcmp_queue::pallet::Event<T>
+ **/
+ CumulusPalletXcmpQueueEvent: {
+ _enum: {
+ Success: {
+ messageHash: 'Option<H256>',
+ weight: 'u64',
+ },
+ Fail: {
+ messageHash: 'Option<H256>',
+ error: 'XcmV2TraitsError',
+ weight: 'u64',
+ },
+ BadVersion: {
+ messageHash: 'Option<H256>',
+ },
+ BadFormat: {
+ messageHash: 'Option<H256>',
+ },
+ UpwardMessageSent: {
+ messageHash: 'Option<H256>',
+ },
+ XcmpMessageSent: {
+ messageHash: 'Option<H256>',
+ },
+ OverweightEnqueued: {
+ sender: 'u32',
+ sentAt: 'u32',
+ index: 'u64',
+ required: 'u64',
+ },
+ OverweightServiced: {
+ index: 'u64',
+ used: 'u64'
+ }
+ }
+ },
+ /**
+ * Lookup63: xcm::v2::traits::Error
+ **/
+ XcmV2TraitsError: {
+ _enum: {
+ Overflow: 'Null',
+ Unimplemented: 'Null',
+ UntrustedReserveLocation: 'Null',
+ UntrustedTeleportLocation: 'Null',
+ MultiLocationFull: 'Null',
+ MultiLocationNotInvertible: 'Null',
+ BadOrigin: 'Null',
+ InvalidLocation: 'Null',
+ AssetNotFound: 'Null',
+ FailedToTransactAsset: 'Null',
+ NotWithdrawable: 'Null',
+ LocationCannotHold: 'Null',
+ ExceedsMaxMessageSize: 'Null',
+ DestinationUnsupported: 'Null',
+ Transport: 'Null',
+ Unroutable: 'Null',
+ UnknownClaim: 'Null',
+ FailedToDecode: 'Null',
+ MaxWeightInvalid: 'Null',
+ NotHoldingFees: 'Null',
+ TooExpensive: 'Null',
+ Trap: 'u64',
+ UnhandledXcmVersion: 'Null',
+ WeightLimitReached: 'u64',
+ Barrier: 'Null',
+ WeightNotComputable: 'Null'
+ }
+ },
+ /**
+ * Lookup65: pallet_xcm::pallet::Event<T>
**/
+ PalletXcmEvent: {
+ _enum: {
+ Attempted: 'XcmV2TraitsOutcome',
+ Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
+ UnexpectedResponse: '(XcmV1MultiLocation,u64)',
+ ResponseReady: '(u64,XcmV2Response)',
+ Notified: '(u64,u8,u8)',
+ NotifyOverweight: '(u64,u8,u8,u64,u64)',
+ NotifyDispatchError: '(u64,u8,u8)',
+ NotifyDecodeFailed: '(u64,u8,u8)',
+ InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
+ InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
+ ResponseTaken: 'u64',
+ AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
+ VersionChangeNotified: '(XcmV1MultiLocation,u32)',
+ SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
+ NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
+ NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
+ }
+ },
+ /**
+ * Lookup66: xcm::v2::traits::Outcome
+ **/
+ XcmV2TraitsOutcome: {
+ _enum: {
+ Complete: 'u64',
+ Incomplete: '(u64,XcmV2TraitsError)',
+ Error: 'XcmV2TraitsError'
+ }
+ },
+ /**
+ * Lookup67: xcm::v2::Xcm<Call>
+ **/
XcmV2Xcm: 'Vec<XcmV2Instruction>',
/**
- * Lookup57: xcm::v2::Instruction<Call>
+ * Lookup69: xcm::v2::Instruction<Call>
**/
XcmV2Instruction: {
_enum: {
@@ -625,53 +773,10 @@
maxResponseWeight: 'Compact<u64>',
},
UnsubscribeVersion: 'Null'
- }
- },
- /**
- * Lookup58: xcm::v1::multiasset::MultiAssets
- **/
- XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
- /**
- * Lookup60: xcm::v1::multiasset::MultiAsset
- **/
- XcmV1MultiAsset: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetFungibility'
- },
- /**
- * Lookup61: xcm::v1::multiasset::AssetId
- **/
- XcmV1MultiassetAssetId: {
- _enum: {
- Concrete: 'XcmV1MultiLocation',
- Abstract: 'Bytes'
}
},
/**
- * Lookup62: xcm::v1::multiasset::Fungibility
- **/
- XcmV1MultiassetFungibility: {
- _enum: {
- Fungible: 'Compact<u128>',
- NonFungible: 'XcmV1MultiassetAssetInstance'
- }
- },
- /**
- * Lookup63: xcm::v1::multiasset::AssetInstance
- **/
- XcmV1MultiassetAssetInstance: {
- _enum: {
- Undefined: 'Null',
- Index: 'Compact<u128>',
- Array4: '[u8;4]',
- Array8: '[u8;8]',
- Array16: '[u8;16]',
- Array32: '[u8;32]',
- Blob: 'Bytes'
- }
- },
- /**
- * Lookup66: xcm::v2::Response
+ * Lookup70: xcm::v2::Response
**/
XcmV2Response: {
_enum: {
@@ -682,19 +787,19 @@
}
},
/**
- * Lookup69: xcm::v0::OriginKind
+ * Lookup73: xcm::v0::OriginKind
**/
XcmV0OriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
},
/**
- * Lookup70: xcm::double_encoded::DoubleEncoded<T>
+ * Lookup74: xcm::double_encoded::DoubleEncoded<T>
**/
XcmDoubleEncoded: {
encoded: 'Bytes'
},
/**
- * Lookup71: xcm::v1::multiasset::MultiAssetFilter
+ * Lookup75: xcm::v1::multiasset::MultiAssetFilter
**/
XcmV1MultiassetMultiAssetFilter: {
_enum: {
@@ -703,7 +808,7 @@
}
},
/**
- * Lookup72: xcm::v1::multiasset::WildMultiAsset
+ * Lookup76: xcm::v1::multiasset::WildMultiAsset
**/
XcmV1MultiassetWildMultiAsset: {
_enum: {
@@ -715,13 +820,13 @@
}
},
/**
- * Lookup73: xcm::v1::multiasset::WildFungibility
+ * Lookup77: xcm::v1::multiasset::WildFungibility
**/
XcmV1MultiassetWildFungibility: {
_enum: ['Fungible', 'NonFungible']
},
/**
- * Lookup74: xcm::v2::WeightLimit
+ * Lookup78: xcm::v2::WeightLimit
**/
XcmV2WeightLimit: {
_enum: {
@@ -730,7 +835,7 @@
}
},
/**
- * Lookup76: xcm::VersionedMultiAssets
+ * Lookup80: xcm::VersionedMultiAssets
**/
XcmVersionedMultiAssets: {
_enum: {
@@ -739,7 +844,7 @@
}
},
/**
- * Lookup78: xcm::v0::multi_asset::MultiAsset
+ * Lookup82: xcm::v0::multi_asset::MultiAsset
**/
XcmV0MultiAsset: {
_enum: {
@@ -778,7 +883,7 @@
}
},
/**
- * Lookup79: xcm::v0::multi_location::MultiLocation
+ * Lookup83: xcm::v0::multi_location::MultiLocation
**/
XcmV0MultiLocation: {
_enum: {
@@ -794,7 +899,7 @@
}
},
/**
- * Lookup80: xcm::v0::junction::Junction
+ * Lookup84: xcm::v0::junction::Junction
**/
XcmV0Junction: {
_enum: {
@@ -823,7 +928,7 @@
}
},
/**
- * Lookup81: xcm::VersionedMultiLocation
+ * Lookup85: xcm::VersionedMultiLocation
**/
XcmVersionedMultiLocation: {
_enum: {
@@ -832,7 +937,7 @@
}
},
/**
- * Lookup82: cumulus_pallet_xcm::pallet::Event<T>
+ * Lookup86: cumulus_pallet_xcm::pallet::Event<T>
**/
CumulusPalletXcmEvent: {
_enum: {
@@ -842,7 +947,7 @@
}
},
/**
- * Lookup83: cumulus_pallet_dmp_queue::pallet::Event<T>
+ * Lookup87: cumulus_pallet_dmp_queue::pallet::Event<T>
**/
CumulusPalletDmpQueueEvent: {
_enum: {
@@ -873,7 +978,7 @@
}
},
/**
- * Lookup84: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup88: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletUniqueRawEvent: {
_enum: {
@@ -890,7 +995,7 @@
}
},
/**
- * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
+ * Lookup89: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
**/
PalletEvmAccountBasicCrossAccountIdRepr: {
_enum: {
@@ -899,7 +1004,7 @@
}
},
/**
- * Lookup88: pallet_unique_scheduler::pallet::Event<T>
+ * Lookup92: pallet_unique_scheduler::pallet::Event<T>
**/
PalletUniqueSchedulerEvent: {
_enum: {
@@ -924,13 +1029,13 @@
}
},
/**
- * Lookup91: frame_support::traits::schedule::LookupError
+ * Lookup95: frame_support::traits::schedule::LookupError
**/
FrameSupportScheduleLookupError: {
_enum: ['Unknown', 'BadFormat']
},
/**
- * Lookup92: pallet_common::pallet::Event<T>
+ * Lookup96: pallet_common::pallet::Event<T>
**/
PalletCommonEvent: {
_enum: {
@@ -948,7 +1053,7 @@
}
},
/**
- * Lookup95: pallet_structure::pallet::Event<T>
+ * Lookup99: pallet_structure::pallet::Event<T>
**/
PalletStructureEvent: {
_enum: {
@@ -956,7 +1061,7 @@
}
},
/**
- * Lookup96: pallet_rmrk_core::pallet::Event<T>
+ * Lookup100: pallet_rmrk_core::pallet::Event<T>
**/
PalletRmrkCoreEvent: {
_enum: {
@@ -1033,7 +1138,7 @@
}
},
/**
- * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
+ * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
**/
RmrkTraitsNftAccountIdOrCollectionNftTuple: {
_enum: {
@@ -1042,7 +1147,7 @@
}
},
/**
- * Lookup102: pallet_rmrk_equip::pallet::Event<T>
+ * Lookup106: pallet_rmrk_equip::pallet::Event<T>
**/
PalletRmrkEquipEvent: {
_enum: {
@@ -1057,7 +1162,7 @@
}
},
/**
- * Lookup103: pallet_app_promotion::pallet::Event<T>
+ * Lookup107: pallet_app_promotion::pallet::Event<T>
**/
PalletAppPromotionEvent: {
_enum: {
@@ -1068,8 +1173,42 @@
}
},
/**
- * Lookup104: pallet_evm::pallet::Event<T>
+ * Lookup108: pallet_foreign_assets::module::Event<T>
**/
+ PalletForeignAssetsModuleEvent: {
+ _enum: {
+ ForeignAssetRegistered: {
+ assetId: 'u32',
+ assetAddress: 'XcmV1MultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ ForeignAssetUpdated: {
+ assetId: 'u32',
+ assetAddress: 'XcmV1MultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ AssetRegistered: {
+ assetId: 'PalletForeignAssetsAssetIds',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ AssetUpdated: {
+ assetId: 'PalletForeignAssetsAssetIds',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata'
+ }
+ }
+ },
+ /**
+ * Lookup109: pallet_foreign_assets::module::AssetMetadata<Balance>
+ **/
+ PalletForeignAssetsModuleAssetMetadata: {
+ name: 'Bytes',
+ symbol: 'Bytes',
+ decimals: 'u8',
+ minimalBalance: 'u128'
+ },
+ /**
+ * Lookup110: pallet_evm::pallet::Event<T>
+ **/
PalletEvmEvent: {
_enum: {
Log: 'EthereumLog',
@@ -1082,7 +1221,7 @@
}
},
/**
- * Lookup105: ethereum::log::Log
+ * Lookup111: ethereum::log::Log
**/
EthereumLog: {
address: 'H160',
@@ -1090,7 +1229,7 @@
data: 'Bytes'
},
/**
- * Lookup109: pallet_ethereum::pallet::Event
+ * Lookup115: pallet_ethereum::pallet::Event
**/
PalletEthereumEvent: {
_enum: {
@@ -1098,7 +1237,7 @@
}
},
/**
- * Lookup110: evm_core::error::ExitReason
+ * Lookup116: evm_core::error::ExitReason
**/
EvmCoreErrorExitReason: {
_enum: {
@@ -1109,13 +1248,13 @@
}
},
/**
- * Lookup111: evm_core::error::ExitSucceed
+ * Lookup117: evm_core::error::ExitSucceed
**/
EvmCoreErrorExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
/**
- * Lookup112: evm_core::error::ExitError
+ * Lookup118: evm_core::error::ExitError
**/
EvmCoreErrorExitError: {
_enum: {
@@ -1137,13 +1276,13 @@
}
},
/**
- * Lookup115: evm_core::error::ExitRevert
+ * Lookup121: evm_core::error::ExitRevert
**/
EvmCoreErrorExitRevert: {
_enum: ['Reverted']
},
/**
- * Lookup116: evm_core::error::ExitFatal
+ * Lookup122: evm_core::error::ExitFatal
**/
EvmCoreErrorExitFatal: {
_enum: {
@@ -1154,7 +1293,7 @@
}
},
/**
- * Lookup117: pallet_evm_contract_helpers::pallet::Event<T>
+ * Lookup123: pallet_evm_contract_helpers::pallet::Event<T>
**/
PalletEvmContractHelpersEvent: {
_enum: {
@@ -1164,7 +1303,7 @@
}
},
/**
- * Lookup118: frame_system::Phase
+ * Lookup124: frame_system::Phase
**/
FrameSystemPhase: {
_enum: {
@@ -1174,14 +1313,14 @@
}
},
/**
- * Lookup120: frame_system::LastRuntimeUpgradeInfo
+ * Lookup126: frame_system::LastRuntimeUpgradeInfo
**/
FrameSystemLastRuntimeUpgradeInfo: {
specVersion: 'Compact<u32>',
specName: 'Text'
},
/**
- * Lookup121: frame_system::pallet::Call<T>
+ * Lookup127: frame_system::pallet::Call<T>
**/
FrameSystemCall: {
_enum: {
@@ -1219,7 +1358,7 @@
}
},
/**
- * Lookup126: frame_system::limits::BlockWeights
+ * Lookup132: frame_system::limits::BlockWeights
**/
FrameSystemLimitsBlockWeights: {
baseBlock: 'u64',
@@ -1227,7 +1366,7 @@
perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
},
/**
- * Lookup127: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
+ * Lookup133: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
**/
FrameSupportWeightsPerDispatchClassWeightsPerClass: {
normal: 'FrameSystemLimitsWeightsPerClass',
@@ -1235,7 +1374,7 @@
mandatory: 'FrameSystemLimitsWeightsPerClass'
},
/**
- * Lookup128: frame_system::limits::WeightsPerClass
+ * Lookup134: frame_system::limits::WeightsPerClass
**/
FrameSystemLimitsWeightsPerClass: {
baseExtrinsic: 'u64',
@@ -1244,13 +1383,13 @@
reserved: 'Option<u64>'
},
/**
- * Lookup130: frame_system::limits::BlockLength
+ * Lookup136: frame_system::limits::BlockLength
**/
FrameSystemLimitsBlockLength: {
max: 'FrameSupportWeightsPerDispatchClassU32'
},
/**
- * Lookup131: frame_support::weights::PerDispatchClass<T>
+ * Lookup137: frame_support::weights::PerDispatchClass<T>
**/
FrameSupportWeightsPerDispatchClassU32: {
normal: 'u32',
@@ -1258,14 +1397,14 @@
mandatory: 'u32'
},
/**
- * Lookup132: frame_support::weights::RuntimeDbWeight
+ * Lookup138: frame_support::weights::RuntimeDbWeight
**/
FrameSupportWeightsRuntimeDbWeight: {
read: 'u64',
write: 'u64'
},
/**
- * Lookup133: sp_version::RuntimeVersion
+ * Lookup139: sp_version::RuntimeVersion
**/
SpVersionRuntimeVersion: {
specName: 'Text',
@@ -1278,13 +1417,13 @@
stateVersion: 'u8'
},
/**
- * Lookup138: frame_system::pallet::Error<T>
+ * Lookup144: frame_system::pallet::Error<T>
**/
FrameSystemError: {
_enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
},
/**
- * Lookup139: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
+ * Lookup145: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
**/
PolkadotPrimitivesV2PersistedValidationData: {
parentHead: 'Bytes',
@@ -1293,19 +1432,19 @@
maxPovSize: 'u32'
},
/**
- * Lookup142: polkadot_primitives::v2::UpgradeRestriction
+ * Lookup148: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
- * Lookup143: sp_trie::storage_proof::StorageProof
+ * Lookup149: sp_trie::storage_proof::StorageProof
**/
SpTrieStorageProof: {
trieNodes: 'BTreeSet<Bytes>'
},
/**
- * Lookup145: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
+ * Lookup151: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
**/
CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: {
dmqMqcHead: 'H256',
@@ -1314,7 +1453,7 @@
egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>'
},
/**
- * Lookup148: polkadot_primitives::v2::AbridgedHrmpChannel
+ * Lookup154: polkadot_primitives::v2::AbridgedHrmpChannel
**/
PolkadotPrimitivesV2AbridgedHrmpChannel: {
maxCapacity: 'u32',
@@ -1325,7 +1464,7 @@
mqcHead: 'Option<H256>'
},
/**
- * Lookup149: polkadot_primitives::v2::AbridgedHostConfiguration
+ * Lookup155: polkadot_primitives::v2::AbridgedHostConfiguration
**/
PolkadotPrimitivesV2AbridgedHostConfiguration: {
maxCodeSize: 'u32',
@@ -1339,14 +1478,14 @@
validationUpgradeDelay: 'u32'
},
/**
- * Lookup155: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
+ * Lookup161: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
- * Lookup156: cumulus_pallet_parachain_system::pallet::Call<T>
+ * Lookup162: cumulus_pallet_parachain_system::pallet::Call<T>
**/
CumulusPalletParachainSystemCall: {
_enum: {
@@ -1365,7 +1504,7 @@
}
},
/**
- * Lookup157: cumulus_primitives_parachain_inherent::ParachainInherentData
+ * Lookup163: cumulus_primitives_parachain_inherent::ParachainInherentData
**/
CumulusPrimitivesParachainInherentParachainInherentData: {
validationData: 'PolkadotPrimitivesV2PersistedValidationData',
@@ -1374,27 +1513,27 @@
horizontalMessages: 'BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>'
},
/**
- * Lookup159: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
+ * Lookup165: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
- * Lookup162: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
+ * Lookup168: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
- * Lookup165: cumulus_pallet_parachain_system::pallet::Error<T>
+ * Lookup171: cumulus_pallet_parachain_system::pallet::Error<T>
**/
CumulusPalletParachainSystemError: {
_enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized']
},
/**
- * Lookup167: pallet_balances::BalanceLock<Balance>
+ * Lookup173: pallet_balances::BalanceLock<Balance>
**/
PalletBalancesBalanceLock: {
id: '[u8;8]',
@@ -1402,26 +1541,26 @@
reasons: 'PalletBalancesReasons'
},
/**
- * Lookup168: pallet_balances::Reasons
+ * Lookup174: pallet_balances::Reasons
**/
PalletBalancesReasons: {
_enum: ['Fee', 'Misc', 'All']
},
/**
- * Lookup171: pallet_balances::ReserveData<ReserveIdentifier, Balance>
+ * Lookup177: pallet_balances::ReserveData<ReserveIdentifier, Balance>
**/
PalletBalancesReserveData: {
id: '[u8;16]',
amount: 'u128'
},
/**
- * Lookup173: pallet_balances::Releases
+ * Lookup179: pallet_balances::Releases
**/
PalletBalancesReleases: {
_enum: ['V1_0_0', 'V2_0_0']
},
/**
- * Lookup174: pallet_balances::pallet::Call<T, I>
+ * Lookup180: pallet_balances::pallet::Call<T, I>
**/
PalletBalancesCall: {
_enum: {
@@ -1454,13 +1593,13 @@
}
},
/**
- * Lookup177: pallet_balances::pallet::Error<T, I>
+ * Lookup183: pallet_balances::pallet::Error<T, I>
**/
PalletBalancesError: {
_enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves']
},
/**
- * Lookup179: pallet_timestamp::pallet::Call<T>
+ * Lookup185: pallet_timestamp::pallet::Call<T>
**/
PalletTimestampCall: {
_enum: {
@@ -1470,13 +1609,13 @@
}
},
/**
- * Lookup181: pallet_transaction_payment::Releases
+ * Lookup187: pallet_transaction_payment::Releases
**/
PalletTransactionPaymentReleases: {
_enum: ['V1Ancient', 'V2']
},
/**
- * Lookup182: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
+ * Lookup188: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
**/
PalletTreasuryProposal: {
proposer: 'AccountId32',
@@ -1485,7 +1624,7 @@
bond: 'u128'
},
/**
- * Lookup185: pallet_treasury::pallet::Call<T, I>
+ * Lookup191: pallet_treasury::pallet::Call<T, I>
**/
PalletTreasuryCall: {
_enum: {
@@ -1509,17 +1648,17 @@
}
},
/**
- * Lookup188: frame_support::PalletId
+ * Lookup194: frame_support::PalletId
**/
FrameSupportPalletId: '[u8;8]',
/**
- * Lookup189: pallet_treasury::pallet::Error<T, I>
+ * Lookup195: pallet_treasury::pallet::Error<T, I>
**/
PalletTreasuryError: {
_enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved']
},
/**
- * Lookup190: pallet_sudo::pallet::Call<T>
+ * Lookup196: pallet_sudo::pallet::Call<T>
**/
PalletSudoCall: {
_enum: {
@@ -1543,7 +1682,7 @@
}
},
/**
- * Lookup192: orml_vesting::module::Call<T>
+ * Lookup198: orml_vesting::module::Call<T>
**/
OrmlVestingModuleCall: {
_enum: {
@@ -1562,8 +1701,94 @@
}
},
/**
- * Lookup194: cumulus_pallet_xcmp_queue::pallet::Call<T>
+ * Lookup200: orml_xtokens::module::Call<T>
**/
+ OrmlXtokensModuleCall: {
+ _enum: {
+ transfer: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiasset: {
+ asset: 'XcmVersionedMultiAsset',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_with_fee: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ fee: 'u128',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiasset_with_fee: {
+ asset: 'XcmVersionedMultiAsset',
+ fee: 'XcmVersionedMultiAsset',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multicurrencies: {
+ currencies: 'Vec<(PalletForeignAssetsAssetIds,u128)>',
+ feeItem: 'u32',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiassets: {
+ assets: 'XcmVersionedMultiAssets',
+ feeItem: 'u32',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64'
+ }
+ }
+ },
+ /**
+ * Lookup201: xcm::VersionedMultiAsset
+ **/
+ XcmVersionedMultiAsset: {
+ _enum: {
+ V0: 'XcmV0MultiAsset',
+ V1: 'XcmV1MultiAsset'
+ }
+ },
+ /**
+ * Lookup204: orml_tokens::module::Call<T>
+ **/
+ OrmlTokensModuleCall: {
+ _enum: {
+ transfer: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ transfer_all: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ keepAlive: 'bool',
+ },
+ transfer_keep_alive: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ force_transfer: {
+ source: 'MultiAddress',
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ set_balance: {
+ who: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ newFree: 'Compact<u128>',
+ newReserved: 'Compact<u128>'
+ }
+ }
+ },
+ /**
+ * Lookup205: cumulus_pallet_xcmp_queue::pallet::Call<T>
+ **/
CumulusPalletXcmpQueueCall: {
_enum: {
service_overweight: {
@@ -1611,7 +1836,7 @@
}
},
/**
- * Lookup195: pallet_xcm::pallet::Call<T>
+ * Lookup206: pallet_xcm::pallet::Call<T>
**/
PalletXcmCall: {
_enum: {
@@ -1665,7 +1890,7 @@
}
},
/**
- * Lookup196: xcm::VersionedXcm<Call>
+ * Lookup207: xcm::VersionedXcm<Call>
**/
XcmVersionedXcm: {
_enum: {
@@ -1675,7 +1900,7 @@
}
},
/**
- * Lookup197: xcm::v0::Xcm<Call>
+ * Lookup208: xcm::v0::Xcm<Call>
**/
XcmV0Xcm: {
_enum: {
@@ -1729,7 +1954,7 @@
}
},
/**
- * Lookup199: xcm::v0::order::Order<Call>
+ * Lookup210: xcm::v0::order::Order<Call>
**/
XcmV0Order: {
_enum: {
@@ -1772,7 +1997,7 @@
}
},
/**
- * Lookup201: xcm::v0::Response
+ * Lookup212: xcm::v0::Response
**/
XcmV0Response: {
_enum: {
@@ -1780,7 +2005,7 @@
}
},
/**
- * Lookup202: xcm::v1::Xcm<Call>
+ * Lookup213: xcm::v1::Xcm<Call>
**/
XcmV1Xcm: {
_enum: {
@@ -1839,7 +2064,7 @@
}
},
/**
- * Lookup204: xcm::v1::order::Order<Call>
+ * Lookup215: xcm::v1::order::Order<Call>
**/
XcmV1Order: {
_enum: {
@@ -1884,7 +2109,7 @@
}
},
/**
- * Lookup206: xcm::v1::Response
+ * Lookup217: xcm::v1::Response
**/
XcmV1Response: {
_enum: {
@@ -1893,11 +2118,11 @@
}
},
/**
- * Lookup220: cumulus_pallet_xcm::pallet::Call<T>
+ * Lookup231: cumulus_pallet_xcm::pallet::Call<T>
**/
CumulusPalletXcmCall: 'Null',
/**
- * Lookup221: cumulus_pallet_dmp_queue::pallet::Call<T>
+ * Lookup232: cumulus_pallet_dmp_queue::pallet::Call<T>
**/
CumulusPalletDmpQueueCall: {
_enum: {
@@ -1908,7 +2133,7 @@
}
},
/**
- * Lookup222: pallet_inflation::pallet::Call<T>
+ * Lookup233: pallet_inflation::pallet::Call<T>
**/
PalletInflationCall: {
_enum: {
@@ -1918,7 +2143,7 @@
}
},
/**
- * Lookup223: pallet_unique::Call<T>
+ * Lookup234: pallet_unique::Call<T>
**/
PalletUniqueCall: {
_enum: {
@@ -2050,7 +2275,7 @@
}
},
/**
- * Lookup228: up_data_structs::CollectionMode
+ * Lookup239: up_data_structs::CollectionMode
**/
UpDataStructsCollectionMode: {
_enum: {
@@ -2060,7 +2285,7 @@
}
},
/**
- * Lookup229: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
+ * Lookup240: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
**/
UpDataStructsCreateCollectionData: {
mode: 'UpDataStructsCollectionMode',
@@ -2075,13 +2300,13 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup231: up_data_structs::AccessMode
+ * Lookup242: up_data_structs::AccessMode
**/
UpDataStructsAccessMode: {
_enum: ['Normal', 'AllowList']
},
/**
- * Lookup233: up_data_structs::CollectionLimits
+ * Lookup244: up_data_structs::CollectionLimits
**/
UpDataStructsCollectionLimits: {
accountTokenOwnershipLimit: 'Option<u32>',
@@ -2095,7 +2320,7 @@
transfersEnabled: 'Option<bool>'
},
/**
- * Lookup235: up_data_structs::SponsoringRateLimit
+ * Lookup246: up_data_structs::SponsoringRateLimit
**/
UpDataStructsSponsoringRateLimit: {
_enum: {
@@ -2104,7 +2329,7 @@
}
},
/**
- * Lookup238: up_data_structs::CollectionPermissions
+ * Lookup249: up_data_structs::CollectionPermissions
**/
UpDataStructsCollectionPermissions: {
access: 'Option<UpDataStructsAccessMode>',
@@ -2112,7 +2337,7 @@
nesting: 'Option<UpDataStructsNestingPermissions>'
},
/**
- * Lookup240: up_data_structs::NestingPermissions
+ * Lookup251: up_data_structs::NestingPermissions
**/
UpDataStructsNestingPermissions: {
tokenOwner: 'bool',
@@ -2120,18 +2345,18 @@
restricted: 'Option<UpDataStructsOwnerRestrictedSet>'
},
/**
- * Lookup242: up_data_structs::OwnerRestrictedSet
+ * Lookup253: up_data_structs::OwnerRestrictedSet
**/
UpDataStructsOwnerRestrictedSet: 'BTreeSet<u32>',
/**
- * Lookup247: up_data_structs::PropertyKeyPermission
+ * Lookup258: up_data_structs::PropertyKeyPermission
**/
UpDataStructsPropertyKeyPermission: {
key: 'Bytes',
permission: 'UpDataStructsPropertyPermission'
},
/**
- * Lookup248: up_data_structs::PropertyPermission
+ * Lookup259: up_data_structs::PropertyPermission
**/
UpDataStructsPropertyPermission: {
mutable: 'bool',
@@ -2139,14 +2364,14 @@
tokenOwner: 'bool'
},
/**
- * Lookup251: up_data_structs::Property
+ * Lookup262: up_data_structs::Property
**/
UpDataStructsProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup254: up_data_structs::CreateItemData
+ * Lookup265: up_data_structs::CreateItemData
**/
UpDataStructsCreateItemData: {
_enum: {
@@ -2156,26 +2381,26 @@
}
},
/**
- * Lookup255: up_data_structs::CreateNftData
+ * Lookup266: up_data_structs::CreateNftData
**/
UpDataStructsCreateNftData: {
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup256: up_data_structs::CreateFungibleData
+ * Lookup267: up_data_structs::CreateFungibleData
**/
UpDataStructsCreateFungibleData: {
value: 'u128'
},
/**
- * Lookup257: up_data_structs::CreateReFungibleData
+ * Lookup268: up_data_structs::CreateReFungibleData
**/
UpDataStructsCreateReFungibleData: {
pieces: 'u128',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup260: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup271: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateItemExData: {
_enum: {
@@ -2186,14 +2411,14 @@
}
},
/**
- * Lookup262: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup273: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateNftExData: {
properties: 'Vec<UpDataStructsProperty>',
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup269: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup280: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExSingleOwner: {
user: 'PalletEvmAccountBasicCrossAccountIdRepr',
@@ -2201,14 +2426,14 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup271: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup282: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExMultipleOwners: {
users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup272: pallet_unique_scheduler::pallet::Call<T>
+ * Lookup283: pallet_unique_scheduler::pallet::Call<T>
**/
PalletUniqueSchedulerCall: {
_enum: {
@@ -2232,7 +2457,7 @@
}
},
/**
- * Lookup274: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
+ * Lookup285: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
**/
FrameSupportScheduleMaybeHashed: {
_enum: {
@@ -2241,7 +2466,7 @@
}
},
/**
- * Lookup275: pallet_configuration::pallet::Call<T>
+ * Lookup286: pallet_configuration::pallet::Call<T>
**/
PalletConfigurationCall: {
_enum: {
@@ -2254,15 +2479,15 @@
}
},
/**
- * Lookup276: pallet_template_transaction_payment::Call<T>
+ * Lookup287: pallet_template_transaction_payment::Call<T>
**/
PalletTemplateTransactionPaymentCall: 'Null',
/**
- * Lookup277: pallet_structure::pallet::Call<T>
+ * Lookup288: pallet_structure::pallet::Call<T>
**/
PalletStructureCall: 'Null',
/**
- * Lookup278: pallet_rmrk_core::pallet::Call<T>
+ * Lookup289: pallet_rmrk_core::pallet::Call<T>
**/
PalletRmrkCoreCall: {
_enum: {
@@ -2353,7 +2578,7 @@
}
},
/**
- * Lookup284: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup295: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceTypes: {
_enum: {
@@ -2363,7 +2588,7 @@
}
},
/**
- * Lookup286: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup297: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceBasicResource: {
src: 'Option<Bytes>',
@@ -2372,7 +2597,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup288: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup299: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceComposableResource: {
parts: 'Vec<u32>',
@@ -2383,7 +2608,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup289: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup300: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceSlotResource: {
base: 'u32',
@@ -2394,7 +2619,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup292: pallet_rmrk_equip::pallet::Call<T>
+ * Lookup303: pallet_rmrk_equip::pallet::Call<T>
**/
PalletRmrkEquipCall: {
_enum: {
@@ -2415,7 +2640,7 @@
}
},
/**
- * Lookup295: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup306: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartPartType: {
_enum: {
@@ -2424,7 +2649,7 @@
}
},
/**
- * Lookup297: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup308: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartFixedPart: {
id: 'u32',
@@ -2432,7 +2657,7 @@
src: 'Bytes'
},
/**
- * Lookup298: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup309: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartSlotPart: {
id: 'u32',
@@ -2441,7 +2666,7 @@
z: 'u32'
},
/**
- * Lookup299: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup310: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartEquippableList: {
_enum: {
@@ -2451,7 +2676,7 @@
}
},
/**
- * Lookup301: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
+ * Lookup312: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
**/
RmrkTraitsTheme: {
name: 'Bytes',
@@ -2459,14 +2684,14 @@
inherit: 'bool'
},
/**
- * Lookup303: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup314: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsThemeThemeProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup305: pallet_app_promotion::pallet::Call<T>
+ * Lookup316: pallet_app_promotion::pallet::Call<T>
**/
PalletAppPromotionCall: {
_enum: {
@@ -2495,8 +2720,25 @@
}
},
/**
- * Lookup307: pallet_evm::pallet::Call<T>
+ * Lookup318: pallet_foreign_assets::module::Call<T>
**/
+ PalletForeignAssetsModuleCall: {
+ _enum: {
+ register_foreign_asset: {
+ owner: 'AccountId32',
+ location: 'XcmVersionedMultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ update_foreign_asset: {
+ foreignAssetId: 'u32',
+ location: 'XcmVersionedMultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata'
+ }
+ }
+ },
+ /**
+ * Lookup319: pallet_evm::pallet::Call<T>
+ **/
PalletEvmCall: {
_enum: {
withdraw: {
@@ -2538,7 +2780,7 @@
}
},
/**
- * Lookup311: pallet_ethereum::pallet::Call<T>
+ * Lookup323: pallet_ethereum::pallet::Call<T>
**/
PalletEthereumCall: {
_enum: {
@@ -2548,7 +2790,7 @@
}
},
/**
- * Lookup312: ethereum::transaction::TransactionV2
+ * Lookup324: ethereum::transaction::TransactionV2
**/
EthereumTransactionTransactionV2: {
_enum: {
@@ -2558,7 +2800,7 @@
}
},
/**
- * Lookup313: ethereum::transaction::LegacyTransaction
+ * Lookup325: ethereum::transaction::LegacyTransaction
**/
EthereumTransactionLegacyTransaction: {
nonce: 'U256',
@@ -2570,7 +2812,7 @@
signature: 'EthereumTransactionTransactionSignature'
},
/**
- * Lookup314: ethereum::transaction::TransactionAction
+ * Lookup326: ethereum::transaction::TransactionAction
**/
EthereumTransactionTransactionAction: {
_enum: {
@@ -2579,7 +2821,7 @@
}
},
/**
- * Lookup315: ethereum::transaction::TransactionSignature
+ * Lookup327: ethereum::transaction::TransactionSignature
**/
EthereumTransactionTransactionSignature: {
v: 'u64',
@@ -2587,7 +2829,7 @@
s: 'H256'
},
/**
- * Lookup317: ethereum::transaction::EIP2930Transaction
+ * Lookup329: ethereum::transaction::EIP2930Transaction
**/
EthereumTransactionEip2930Transaction: {
chainId: 'u64',
@@ -2603,14 +2845,14 @@
s: 'H256'
},
/**
- * Lookup319: ethereum::transaction::AccessListItem
+ * Lookup331: ethereum::transaction::AccessListItem
**/
EthereumTransactionAccessListItem: {
address: 'H160',
storageKeys: 'Vec<H256>'
},
/**
- * Lookup320: ethereum::transaction::EIP1559Transaction
+ * Lookup332: ethereum::transaction::EIP1559Transaction
**/
EthereumTransactionEip1559Transaction: {
chainId: 'u64',
@@ -2627,7 +2869,7 @@
s: 'H256'
},
/**
- * Lookup321: pallet_evm_migration::pallet::Call<T>
+ * Lookup333: pallet_evm_migration::pallet::Call<T>
**/
PalletEvmMigrationCall: {
_enum: {
@@ -2645,39 +2887,73 @@
}
},
/**
- * Lookup324: pallet_sudo::pallet::Error<T>
+ * Lookup336: pallet_sudo::pallet::Error<T>
**/
PalletSudoError: {
_enum: ['RequireSudo']
},
/**
- * Lookup326: orml_vesting::module::Error<T>
+ * Lookup338: orml_vesting::module::Error<T>
**/
OrmlVestingModuleError: {
_enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
},
/**
- * Lookup328: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ * Lookup339: orml_xtokens::module::Error<T>
+ **/
+ OrmlXtokensModuleError: {
+ _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined']
+ },
+ /**
+ * Lookup342: orml_tokens::BalanceLock<Balance>
+ **/
+ OrmlTokensBalanceLock: {
+ id: '[u8;8]',
+ amount: 'u128'
+ },
+ /**
+ * Lookup344: orml_tokens::AccountData<Balance>
+ **/
+ OrmlTokensAccountData: {
+ free: 'u128',
+ reserved: 'u128',
+ frozen: 'u128'
+ },
+ /**
+ * Lookup346: orml_tokens::ReserveData<ReserveIdentifier, Balance>
**/
+ OrmlTokensReserveData: {
+ id: 'Null',
+ amount: 'u128'
+ },
+ /**
+ * Lookup348: orml_tokens::module::Error<T>
+ **/
+ OrmlTokensModuleError: {
+ _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves']
+ },
+ /**
+ * Lookup350: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ **/
CumulusPalletXcmpQueueInboundChannelDetails: {
sender: 'u32',
state: 'CumulusPalletXcmpQueueInboundState',
messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
},
/**
- * Lookup329: cumulus_pallet_xcmp_queue::InboundState
+ * Lookup351: cumulus_pallet_xcmp_queue::InboundState
**/
CumulusPalletXcmpQueueInboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup332: polkadot_parachain::primitives::XcmpMessageFormat
+ * Lookup354: polkadot_parachain::primitives::XcmpMessageFormat
**/
PolkadotParachainPrimitivesXcmpMessageFormat: {
_enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
},
/**
- * Lookup335: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+ * Lookup357: cumulus_pallet_xcmp_queue::OutboundChannelDetails
**/
CumulusPalletXcmpQueueOutboundChannelDetails: {
recipient: 'u32',
@@ -2687,13 +2963,13 @@
lastIndex: 'u16'
},
/**
- * Lookup336: cumulus_pallet_xcmp_queue::OutboundState
+ * Lookup358: cumulus_pallet_xcmp_queue::OutboundState
**/
CumulusPalletXcmpQueueOutboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup338: cumulus_pallet_xcmp_queue::QueueConfigData
+ * Lookup360: cumulus_pallet_xcmp_queue::QueueConfigData
**/
CumulusPalletXcmpQueueQueueConfigData: {
suspendThreshold: 'u32',
@@ -2704,29 +2980,29 @@
xcmpMaxIndividualWeight: 'u64'
},
/**
- * Lookup340: cumulus_pallet_xcmp_queue::pallet::Error<T>
+ * Lookup362: cumulus_pallet_xcmp_queue::pallet::Error<T>
**/
CumulusPalletXcmpQueueError: {
_enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
},
/**
- * Lookup341: pallet_xcm::pallet::Error<T>
+ * Lookup363: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
},
/**
- * Lookup342: cumulus_pallet_xcm::pallet::Error<T>
+ * Lookup364: cumulus_pallet_xcm::pallet::Error<T>
**/
CumulusPalletXcmError: 'Null',
/**
- * Lookup343: cumulus_pallet_dmp_queue::ConfigData
+ * Lookup365: cumulus_pallet_dmp_queue::ConfigData
**/
CumulusPalletDmpQueueConfigData: {
maxIndividual: 'u64'
},
/**
- * Lookup344: cumulus_pallet_dmp_queue::PageIndexData
+ * Lookup366: cumulus_pallet_dmp_queue::PageIndexData
**/
CumulusPalletDmpQueuePageIndexData: {
beginUsed: 'u32',
@@ -2734,19 +3010,19 @@
overweightCount: 'u64'
},
/**
- * Lookup347: cumulus_pallet_dmp_queue::pallet::Error<T>
+ * Lookup369: cumulus_pallet_dmp_queue::pallet::Error<T>
**/
CumulusPalletDmpQueueError: {
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup351: pallet_unique::Error<T>
+ * Lookup373: pallet_unique::Error<T>
**/
PalletUniqueError: {
_enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
},
/**
- * Lookup354: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
+ * Lookup376: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
**/
PalletUniqueSchedulerScheduledV3: {
maybeId: 'Option<[u8;16]>',
@@ -2756,7 +3032,7 @@
origin: 'OpalRuntimeOriginCaller'
},
/**
- * Lookup355: opal_runtime::OriginCaller
+ * Lookup377: opal_runtime::OriginCaller
**/
OpalRuntimeOriginCaller: {
_enum: {
@@ -2865,7 +3141,7 @@
}
},
/**
- * Lookup356: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+ * Lookup378: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
**/
FrameSupportDispatchRawOrigin: {
_enum: {
@@ -2875,7 +3151,7 @@
}
},
/**
- * Lookup357: pallet_xcm::pallet::Origin
+ * Lookup379: pallet_xcm::pallet::Origin
**/
PalletXcmOrigin: {
_enum: {
@@ -2884,7 +3160,7 @@
}
},
/**
- * Lookup358: cumulus_pallet_xcm::pallet::Origin
+ * Lookup380: cumulus_pallet_xcm::pallet::Origin
**/
CumulusPalletXcmOrigin: {
_enum: {
@@ -2893,7 +3169,7 @@
}
},
/**
- * Lookup359: pallet_ethereum::RawOrigin
+ * Lookup381: pallet_ethereum::RawOrigin
**/
PalletEthereumRawOrigin: {
_enum: {
@@ -2901,17 +3177,17 @@
}
},
/**
- * Lookup360: sp_core::Void
+ * Lookup382: sp_core::Void
**/
SpCoreVoid: 'Null',
/**
- * Lookup361: pallet_unique_scheduler::pallet::Error<T>
+ * Lookup383: pallet_unique_scheduler::pallet::Error<T>
**/
PalletUniqueSchedulerError: {
_enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
},
/**
- * Lookup362: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup384: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -2922,10 +3198,10 @@
sponsorship: 'UpDataStructsSponsorshipStateAccountId32',
limits: 'UpDataStructsCollectionLimits',
permissions: 'UpDataStructsCollectionPermissions',
- externalCollection: 'bool'
+ flags: '[u8;1]'
},
/**
- * Lookup363: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup385: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
UpDataStructsSponsorshipStateAccountId32: {
_enum: {
@@ -2935,7 +3211,7 @@
}
},
/**
- * Lookup364: up_data_structs::Properties
+ * Lookup387: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2943,15 +3219,15 @@
spaceLimit: 'u32'
},
/**
- * Lookup365: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup388: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
- * Lookup370: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+ * Lookup393: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup377: up_data_structs::CollectionStats
+ * Lookup400: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -2959,18 +3235,18 @@
alive: 'u32'
},
/**
- * Lookup378: up_data_structs::TokenChild
+ * Lookup401: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup379: PhantomType::up_data_structs<T>
+ * Lookup402: PhantomType::up_data_structs<T>
**/
PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]',
/**
- * Lookup381: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup404: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -2978,7 +3254,7 @@
pieces: 'u128'
},
/**
- * Lookup383: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup406: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2991,10 +3267,11 @@
permissions: 'UpDataStructsCollectionPermissions',
tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',
properties: 'Vec<UpDataStructsProperty>',
- readOnly: 'bool'
+ readOnly: 'bool',
+ foreign: 'bool'
},
/**
- * Lookup384: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+ * Lookup407: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
RmrkTraitsCollectionCollectionInfo: {
issuer: 'AccountId32',
@@ -3004,7 +3281,7 @@
nftsCount: 'u32'
},
/**
- * Lookup385: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup408: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsNftNftInfo: {
owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -3014,14 +3291,14 @@
pending: 'bool'
},
/**
- * Lookup387: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup410: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
**/
RmrkTraitsNftRoyaltyInfo: {
recipient: 'AccountId32',
amount: 'Permill'
},
/**
- * Lookup388: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup411: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceInfo: {
id: 'u32',
@@ -3030,14 +3307,14 @@
pendingRemoval: 'bool'
},
/**
- * Lookup389: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup412: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPropertyPropertyInfo: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup390: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup413: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsBaseBaseInfo: {
issuer: 'AccountId32',
@@ -3045,86 +3322,92 @@
symbol: 'Bytes'
},
/**
- * Lookup391: rmrk_traits::nft::NftChild
+ * Lookup414: rmrk_traits::nft::NftChild
**/
RmrkTraitsNftNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup393: pallet_common::pallet::Error<T>
+ * Lookup416: pallet_common::pallet::Error<T>
**/
PalletCommonError: {
_enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal']
},
/**
- * Lookup395: pallet_fungible::pallet::Error<T>
+ * Lookup418: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup396: pallet_refungible::ItemData
+ * Lookup419: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup401: pallet_refungible::pallet::Error<T>
+ * Lookup424: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup402: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup425: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup404: up_data_structs::PropertyScope
+ * Lookup427: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
_enum: ['None', 'Rmrk']
},
/**
- * Lookup406: pallet_nonfungible::pallet::Error<T>
+ * Lookup429: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup407: pallet_structure::pallet::Error<T>
+ * Lookup430: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
},
/**
- * Lookup408: pallet_rmrk_core::pallet::Error<T>
+ * Lookup431: pallet_rmrk_core::pallet::Error<T>
**/
PalletRmrkCoreError: {
_enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId']
},
/**
- * Lookup410: pallet_rmrk_equip::pallet::Error<T>
+ * Lookup433: pallet_rmrk_equip::pallet::Error<T>
**/
PalletRmrkEquipError: {
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup416: pallet_app_promotion::pallet::Error<T>
+ * Lookup439: pallet_app_promotion::pallet::Error<T>
**/
PalletAppPromotionError: {
_enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation']
},
/**
- * Lookup419: pallet_evm::pallet::Error<T>
+ * Lookup440: pallet_foreign_assets::module::Error<T>
+ **/
+ PalletForeignAssetsModuleError: {
+ _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted']
+ },
+ /**
+ * Lookup443: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup422: fp_rpc::TransactionStatus
+ * Lookup446: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3136,11 +3419,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup424: ethbloom::Bloom
+ * Lookup448: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup426: ethereum::receipt::ReceiptV3
+ * Lookup450: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3150,7 +3433,7 @@
}
},
/**
- * Lookup427: ethereum::receipt::EIP658ReceiptData
+ * Lookup451: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3159,7 +3442,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup428: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup452: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3167,7 +3450,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup429: ethereum::header::Header
+ * Lookup453: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3187,23 +3470,23 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup430: ethereum_types::hash::H64
+ * Lookup454: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup435: pallet_ethereum::pallet::Error<T>
+ * Lookup459: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup436: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup460: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup437: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup461: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
_enum: {
@@ -3213,25 +3496,25 @@
}
},
/**
- * Lookup438: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup462: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup440: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup468: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
- _enum: ['NoPermission', 'NoPendingSponsor']
+ _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit']
},
/**
- * Lookup441: pallet_evm_migration::pallet::Error<T>
+ * Lookup469: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup443: sp_runtime::MultiSignature
+ * Lookup471: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3241,43 +3524,43 @@
}
},
/**
- * Lookup444: sp_core::ed25519::Signature
+ * Lookup472: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup446: sp_core::sr25519::Signature
+ * Lookup474: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup447: sp_core::ecdsa::Signature
+ * Lookup475: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup450: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup478: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup451: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup479: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup454: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup482: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup455: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup483: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup456: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup484: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup457: opal_runtime::Runtime
+ * Lookup485: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup458: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup486: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/registry.tsdiffbeforeafterboth--- a/tests/src/interfaces/registry.ts
+++ b/tests/src/interfaces/registry.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/types/types/registry' {
interface InterfaceTypes {
@@ -79,10 +79,19 @@
FrameSystemPhase: FrameSystemPhase;
OpalRuntimeOriginCaller: OpalRuntimeOriginCaller;
OpalRuntimeRuntime: OpalRuntimeRuntime;
+ OrmlTokensAccountData: OrmlTokensAccountData;
+ OrmlTokensBalanceLock: OrmlTokensBalanceLock;
+ OrmlTokensModuleCall: OrmlTokensModuleCall;
+ OrmlTokensModuleError: OrmlTokensModuleError;
+ OrmlTokensModuleEvent: OrmlTokensModuleEvent;
+ OrmlTokensReserveData: OrmlTokensReserveData;
OrmlVestingModuleCall: OrmlVestingModuleCall;
OrmlVestingModuleError: OrmlVestingModuleError;
OrmlVestingModuleEvent: OrmlVestingModuleEvent;
OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
+ OrmlXtokensModuleCall: OrmlXtokensModuleCall;
+ OrmlXtokensModuleError: OrmlXtokensModuleError;
+ OrmlXtokensModuleEvent: OrmlXtokensModuleEvent;
PalletAppPromotionCall: PalletAppPromotionCall;
PalletAppPromotionError: PalletAppPromotionError;
PalletAppPromotionEvent: PalletAppPromotionEvent;
@@ -112,6 +121,12 @@
PalletEvmEvent: PalletEvmEvent;
PalletEvmMigrationCall: PalletEvmMigrationCall;
PalletEvmMigrationError: PalletEvmMigrationError;
+ PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds;
+ PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata;
+ PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall;
+ PalletForeignAssetsModuleError: PalletForeignAssetsModuleError;
+ PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent;
+ PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency;
PalletFungibleError: PalletFungibleError;
PalletInflationCall: PalletInflationCall;
PalletNonfungibleError: PalletNonfungibleError;
@@ -252,6 +267,7 @@
XcmV2TraitsOutcome: XcmV2TraitsOutcome;
XcmV2WeightLimit: XcmV2WeightLimit;
XcmV2Xcm: XcmV2Xcm;
+ XcmVersionedMultiAsset: XcmVersionedMultiAsset;
XcmVersionedMultiAssets: XcmVersionedMultiAssets;
XcmVersionedMultiLocation: XcmVersionedMultiLocation;
XcmVersionedXcm: XcmVersionedXcm;
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/types/lookup';78import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';9import type { ITuple } from '@polkadot/types-codec/types';10import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';11import type { Event } from '@polkadot/types/interfaces/system';1213declare module '@polkadot/types/lookup' {14 /** @name FrameSystemAccountInfo (3) */15 interface FrameSystemAccountInfo extends Struct {16 readonly nonce: u32;17 readonly consumers: u32;18 readonly providers: u32;19 readonly sufficients: u32;20 readonly data: PalletBalancesAccountData;21 }2223 /** @name PalletBalancesAccountData (5) */24 interface PalletBalancesAccountData extends Struct {25 readonly free: u128;26 readonly reserved: u128;27 readonly miscFrozen: u128;28 readonly feeFrozen: u128;29 }3031 /** @name FrameSupportWeightsPerDispatchClassU64 (7) */32 interface FrameSupportWeightsPerDispatchClassU64 extends Struct {33 readonly normal: u64;34 readonly operational: u64;35 readonly mandatory: u64;36 }3738 /** @name SpRuntimeDigest (11) */39 interface SpRuntimeDigest extends Struct {40 readonly logs: Vec<SpRuntimeDigestDigestItem>;41 }4243 /** @name SpRuntimeDigestDigestItem (13) */44 interface SpRuntimeDigestDigestItem extends Enum {45 readonly isOther: boolean;46 readonly asOther: Bytes;47 readonly isConsensus: boolean;48 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;49 readonly isSeal: boolean;50 readonly asSeal: ITuple<[U8aFixed, Bytes]>;51 readonly isPreRuntime: boolean;52 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;53 readonly isRuntimeEnvironmentUpdated: boolean;54 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';55 }5657 /** @name FrameSystemEventRecord (16) */58 interface FrameSystemEventRecord extends Struct {59 readonly phase: FrameSystemPhase;60 readonly event: Event;61 readonly topics: Vec<H256>;62 }6364 /** @name FrameSystemEvent (18) */65 interface FrameSystemEvent extends Enum {66 readonly isExtrinsicSuccess: boolean;67 readonly asExtrinsicSuccess: {68 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;69 } & Struct;70 readonly isExtrinsicFailed: boolean;71 readonly asExtrinsicFailed: {72 readonly dispatchError: SpRuntimeDispatchError;73 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;74 } & Struct;75 readonly isCodeUpdated: boolean;76 readonly isNewAccount: boolean;77 readonly asNewAccount: {78 readonly account: AccountId32;79 } & Struct;80 readonly isKilledAccount: boolean;81 readonly asKilledAccount: {82 readonly account: AccountId32;83 } & Struct;84 readonly isRemarked: boolean;85 readonly asRemarked: {86 readonly sender: AccountId32;87 readonly hash_: H256;88 } & Struct;89 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';90 }9192 /** @name FrameSupportWeightsDispatchInfo (19) */93 interface FrameSupportWeightsDispatchInfo extends Struct {94 readonly weight: u64;95 readonly class: FrameSupportWeightsDispatchClass;96 readonly paysFee: FrameSupportWeightsPays;97 }9899 /** @name FrameSupportWeightsDispatchClass (20) */100 interface FrameSupportWeightsDispatchClass extends Enum {101 readonly isNormal: boolean;102 readonly isOperational: boolean;103 readonly isMandatory: boolean;104 readonly type: 'Normal' | 'Operational' | 'Mandatory';105 }106107 /** @name FrameSupportWeightsPays (21) */108 interface FrameSupportWeightsPays extends Enum {109 readonly isYes: boolean;110 readonly isNo: boolean;111 readonly type: 'Yes' | 'No';112 }113114 /** @name SpRuntimeDispatchError (22) */115 interface SpRuntimeDispatchError extends Enum {116 readonly isOther: boolean;117 readonly isCannotLookup: boolean;118 readonly isBadOrigin: boolean;119 readonly isModule: boolean;120 readonly asModule: SpRuntimeModuleError;121 readonly isConsumerRemaining: boolean;122 readonly isNoProviders: boolean;123 readonly isTooManyConsumers: boolean;124 readonly isToken: boolean;125 readonly asToken: SpRuntimeTokenError;126 readonly isArithmetic: boolean;127 readonly asArithmetic: SpRuntimeArithmeticError;128 readonly isTransactional: boolean;129 readonly asTransactional: SpRuntimeTransactionalError;130 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';131 }132133 /** @name SpRuntimeModuleError (23) */134 interface SpRuntimeModuleError extends Struct {135 readonly index: u8;136 readonly error: U8aFixed;137 }138139 /** @name SpRuntimeTokenError (24) */140 interface SpRuntimeTokenError extends Enum {141 readonly isNoFunds: boolean;142 readonly isWouldDie: boolean;143 readonly isBelowMinimum: boolean;144 readonly isCannotCreate: boolean;145 readonly isUnknownAsset: boolean;146 readonly isFrozen: boolean;147 readonly isUnsupported: boolean;148 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';149 }150151 /** @name SpRuntimeArithmeticError (25) */152 interface SpRuntimeArithmeticError extends Enum {153 readonly isUnderflow: boolean;154 readonly isOverflow: boolean;155 readonly isDivisionByZero: boolean;156 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';157 }158159 /** @name SpRuntimeTransactionalError (26) */160 interface SpRuntimeTransactionalError extends Enum {161 readonly isLimitReached: boolean;162 readonly isNoLayer: boolean;163 readonly type: 'LimitReached' | 'NoLayer';164 }165166 /** @name CumulusPalletParachainSystemEvent (27) */167 interface CumulusPalletParachainSystemEvent extends Enum {168 readonly isValidationFunctionStored: boolean;169 readonly isValidationFunctionApplied: boolean;170 readonly asValidationFunctionApplied: {171 readonly relayChainBlockNum: u32;172 } & Struct;173 readonly isValidationFunctionDiscarded: boolean;174 readonly isUpgradeAuthorized: boolean;175 readonly asUpgradeAuthorized: {176 readonly codeHash: H256;177 } & Struct;178 readonly isDownwardMessagesReceived: boolean;179 readonly asDownwardMessagesReceived: {180 readonly count: u32;181 } & Struct;182 readonly isDownwardMessagesProcessed: boolean;183 readonly asDownwardMessagesProcessed: {184 readonly weightUsed: u64;185 readonly dmqHead: H256;186 } & Struct;187 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';188 }189190 /** @name PalletBalancesEvent (28) */191 interface PalletBalancesEvent extends Enum {192 readonly isEndowed: boolean;193 readonly asEndowed: {194 readonly account: AccountId32;195 readonly freeBalance: u128;196 } & Struct;197 readonly isDustLost: boolean;198 readonly asDustLost: {199 readonly account: AccountId32;200 readonly amount: u128;201 } & Struct;202 readonly isTransfer: boolean;203 readonly asTransfer: {204 readonly from: AccountId32;205 readonly to: AccountId32;206 readonly amount: u128;207 } & Struct;208 readonly isBalanceSet: boolean;209 readonly asBalanceSet: {210 readonly who: AccountId32;211 readonly free: u128;212 readonly reserved: u128;213 } & Struct;214 readonly isReserved: boolean;215 readonly asReserved: {216 readonly who: AccountId32;217 readonly amount: u128;218 } & Struct;219 readonly isUnreserved: boolean;220 readonly asUnreserved: {221 readonly who: AccountId32;222 readonly amount: u128;223 } & Struct;224 readonly isReserveRepatriated: boolean;225 readonly asReserveRepatriated: {226 readonly from: AccountId32;227 readonly to: AccountId32;228 readonly amount: u128;229 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;230 } & Struct;231 readonly isDeposit: boolean;232 readonly asDeposit: {233 readonly who: AccountId32;234 readonly amount: u128;235 } & Struct;236 readonly isWithdraw: boolean;237 readonly asWithdraw: {238 readonly who: AccountId32;239 readonly amount: u128;240 } & Struct;241 readonly isSlashed: boolean;242 readonly asSlashed: {243 readonly who: AccountId32;244 readonly amount: u128;245 } & Struct;246 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';247 }248249 /** @name FrameSupportTokensMiscBalanceStatus (29) */250 interface FrameSupportTokensMiscBalanceStatus extends Enum {251 readonly isFree: boolean;252 readonly isReserved: boolean;253 readonly type: 'Free' | 'Reserved';254 }255256 /** @name PalletTransactionPaymentEvent (30) */257 interface PalletTransactionPaymentEvent extends Enum {258 readonly isTransactionFeePaid: boolean;259 readonly asTransactionFeePaid: {260 readonly who: AccountId32;261 readonly actualFee: u128;262 readonly tip: u128;263 } & Struct;264 readonly type: 'TransactionFeePaid';265 }266267 /** @name PalletTreasuryEvent (31) */268 interface PalletTreasuryEvent extends Enum {269 readonly isProposed: boolean;270 readonly asProposed: {271 readonly proposalIndex: u32;272 } & Struct;273 readonly isSpending: boolean;274 readonly asSpending: {275 readonly budgetRemaining: u128;276 } & Struct;277 readonly isAwarded: boolean;278 readonly asAwarded: {279 readonly proposalIndex: u32;280 readonly award: u128;281 readonly account: AccountId32;282 } & Struct;283 readonly isRejected: boolean;284 readonly asRejected: {285 readonly proposalIndex: u32;286 readonly slashed: u128;287 } & Struct;288 readonly isBurnt: boolean;289 readonly asBurnt: {290 readonly burntFunds: u128;291 } & Struct;292 readonly isRollover: boolean;293 readonly asRollover: {294 readonly rolloverBalance: u128;295 } & Struct;296 readonly isDeposit: boolean;297 readonly asDeposit: {298 readonly value: u128;299 } & Struct;300 readonly isSpendApproved: boolean;301 readonly asSpendApproved: {302 readonly proposalIndex: u32;303 readonly amount: u128;304 readonly beneficiary: AccountId32;305 } & Struct;306 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';307 }308309 /** @name PalletSudoEvent (32) */310 interface PalletSudoEvent extends Enum {311 readonly isSudid: boolean;312 readonly asSudid: {313 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;314 } & Struct;315 readonly isKeyChanged: boolean;316 readonly asKeyChanged: {317 readonly oldSudoer: Option<AccountId32>;318 } & Struct;319 readonly isSudoAsDone: boolean;320 readonly asSudoAsDone: {321 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;322 } & Struct;323 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';324 }325326 /** @name OrmlVestingModuleEvent (36) */327 interface OrmlVestingModuleEvent extends Enum {328 readonly isVestingScheduleAdded: boolean;329 readonly asVestingScheduleAdded: {330 readonly from: AccountId32;331 readonly to: AccountId32;332 readonly vestingSchedule: OrmlVestingVestingSchedule;333 } & Struct;334 readonly isClaimed: boolean;335 readonly asClaimed: {336 readonly who: AccountId32;337 readonly amount: u128;338 } & Struct;339 readonly isVestingSchedulesUpdated: boolean;340 readonly asVestingSchedulesUpdated: {341 readonly who: AccountId32;342 } & Struct;343 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';344 }345346 /** @name OrmlVestingVestingSchedule (37) */347 interface OrmlVestingVestingSchedule extends Struct {348 readonly start: u32;349 readonly period: u32;350 readonly periodCount: u32;351 readonly perPeriod: Compact<u128>;352 }353354 /** @name CumulusPalletXcmpQueueEvent (39) */355 interface CumulusPalletXcmpQueueEvent extends Enum {356 readonly isSuccess: boolean;357 readonly asSuccess: {358 readonly messageHash: Option<H256>;359 readonly weight: u64;360 } & Struct;361 readonly isFail: boolean;362 readonly asFail: {363 readonly messageHash: Option<H256>;364 readonly error: XcmV2TraitsError;365 readonly weight: u64;366 } & Struct;367 readonly isBadVersion: boolean;368 readonly asBadVersion: {369 readonly messageHash: Option<H256>;370 } & Struct;371 readonly isBadFormat: boolean;372 readonly asBadFormat: {373 readonly messageHash: Option<H256>;374 } & Struct;375 readonly isUpwardMessageSent: boolean;376 readonly asUpwardMessageSent: {377 readonly messageHash: Option<H256>;378 } & Struct;379 readonly isXcmpMessageSent: boolean;380 readonly asXcmpMessageSent: {381 readonly messageHash: Option<H256>;382 } & Struct;383 readonly isOverweightEnqueued: boolean;384 readonly asOverweightEnqueued: {385 readonly sender: u32;386 readonly sentAt: u32;387 readonly index: u64;388 readonly required: u64;389 } & Struct;390 readonly isOverweightServiced: boolean;391 readonly asOverweightServiced: {392 readonly index: u64;393 readonly used: u64;394 } & Struct;395 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';396 }397398 /** @name XcmV2TraitsError (41) */399 interface XcmV2TraitsError extends Enum {400 readonly isOverflow: boolean;401 readonly isUnimplemented: boolean;402 readonly isUntrustedReserveLocation: boolean;403 readonly isUntrustedTeleportLocation: boolean;404 readonly isMultiLocationFull: boolean;405 readonly isMultiLocationNotInvertible: boolean;406 readonly isBadOrigin: boolean;407 readonly isInvalidLocation: boolean;408 readonly isAssetNotFound: boolean;409 readonly isFailedToTransactAsset: boolean;410 readonly isNotWithdrawable: boolean;411 readonly isLocationCannotHold: boolean;412 readonly isExceedsMaxMessageSize: boolean;413 readonly isDestinationUnsupported: boolean;414 readonly isTransport: boolean;415 readonly isUnroutable: boolean;416 readonly isUnknownClaim: boolean;417 readonly isFailedToDecode: boolean;418 readonly isMaxWeightInvalid: boolean;419 readonly isNotHoldingFees: boolean;420 readonly isTooExpensive: boolean;421 readonly isTrap: boolean;422 readonly asTrap: u64;423 readonly isUnhandledXcmVersion: boolean;424 readonly isWeightLimitReached: boolean;425 readonly asWeightLimitReached: u64;426 readonly isBarrier: boolean;427 readonly isWeightNotComputable: boolean;428 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';429 }430431 /** @name PalletXcmEvent (43) */432 interface PalletXcmEvent extends Enum {433 readonly isAttempted: boolean;434 readonly asAttempted: XcmV2TraitsOutcome;435 readonly isSent: boolean;436 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;437 readonly isUnexpectedResponse: boolean;438 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;439 readonly isResponseReady: boolean;440 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;441 readonly isNotified: boolean;442 readonly asNotified: ITuple<[u64, u8, u8]>;443 readonly isNotifyOverweight: boolean;444 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;445 readonly isNotifyDispatchError: boolean;446 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;447 readonly isNotifyDecodeFailed: boolean;448 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;449 readonly isInvalidResponder: boolean;450 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;451 readonly isInvalidResponderVersion: boolean;452 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;453 readonly isResponseTaken: boolean;454 readonly asResponseTaken: u64;455 readonly isAssetsTrapped: boolean;456 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;457 readonly isVersionChangeNotified: boolean;458 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;459 readonly isSupportedVersionChanged: boolean;460 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;461 readonly isNotifyTargetSendFail: boolean;462 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;463 readonly isNotifyTargetMigrationFail: boolean;464 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;465 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';466 }467468 /** @name XcmV2TraitsOutcome (44) */469 interface XcmV2TraitsOutcome extends Enum {470 readonly isComplete: boolean;471 readonly asComplete: u64;472 readonly isIncomplete: boolean;473 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;474 readonly isError: boolean;475 readonly asError: XcmV2TraitsError;476 readonly type: 'Complete' | 'Incomplete' | 'Error';477 }478479 /** @name XcmV1MultiLocation (45) */480 interface XcmV1MultiLocation extends Struct {481 readonly parents: u8;482 readonly interior: XcmV1MultilocationJunctions;483 }484485 /** @name XcmV1MultilocationJunctions (46) */486 interface XcmV1MultilocationJunctions extends Enum {487 readonly isHere: boolean;488 readonly isX1: boolean;489 readonly asX1: XcmV1Junction;490 readonly isX2: boolean;491 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;492 readonly isX3: boolean;493 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;494 readonly isX4: boolean;495 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;496 readonly isX5: boolean;497 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;498 readonly isX6: boolean;499 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;500 readonly isX7: boolean;501 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;502 readonly isX8: boolean;503 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;504 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';505 }506507 /** @name XcmV1Junction (47) */508 interface XcmV1Junction extends Enum {509 readonly isParachain: boolean;510 readonly asParachain: Compact<u32>;511 readonly isAccountId32: boolean;512 readonly asAccountId32: {513 readonly network: XcmV0JunctionNetworkId;514 readonly id: U8aFixed;515 } & Struct;516 readonly isAccountIndex64: boolean;517 readonly asAccountIndex64: {518 readonly network: XcmV0JunctionNetworkId;519 readonly index: Compact<u64>;520 } & Struct;521 readonly isAccountKey20: boolean;522 readonly asAccountKey20: {523 readonly network: XcmV0JunctionNetworkId;524 readonly key: U8aFixed;525 } & Struct;526 readonly isPalletInstance: boolean;527 readonly asPalletInstance: u8;528 readonly isGeneralIndex: boolean;529 readonly asGeneralIndex: Compact<u128>;530 readonly isGeneralKey: boolean;531 readonly asGeneralKey: Bytes;532 readonly isOnlyChild: boolean;533 readonly isPlurality: boolean;534 readonly asPlurality: {535 readonly id: XcmV0JunctionBodyId;536 readonly part: XcmV0JunctionBodyPart;537 } & Struct;538 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';539 }540541 /** @name XcmV0JunctionNetworkId (49) */542 interface XcmV0JunctionNetworkId extends Enum {543 readonly isAny: boolean;544 readonly isNamed: boolean;545 readonly asNamed: Bytes;546 readonly isPolkadot: boolean;547 readonly isKusama: boolean;548 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';549 }550551 /** @name XcmV0JunctionBodyId (53) */552 interface XcmV0JunctionBodyId extends Enum {553 readonly isUnit: boolean;554 readonly isNamed: boolean;555 readonly asNamed: Bytes;556 readonly isIndex: boolean;557 readonly asIndex: Compact<u32>;558 readonly isExecutive: boolean;559 readonly isTechnical: boolean;560 readonly isLegislative: boolean;561 readonly isJudicial: boolean;562 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';563 }564565 /** @name XcmV0JunctionBodyPart (54) */566 interface XcmV0JunctionBodyPart extends Enum {567 readonly isVoice: boolean;568 readonly isMembers: boolean;569 readonly asMembers: {570 readonly count: Compact<u32>;571 } & Struct;572 readonly isFraction: boolean;573 readonly asFraction: {574 readonly nom: Compact<u32>;575 readonly denom: Compact<u32>;576 } & Struct;577 readonly isAtLeastProportion: boolean;578 readonly asAtLeastProportion: {579 readonly nom: Compact<u32>;580 readonly denom: Compact<u32>;581 } & Struct;582 readonly isMoreThanProportion: boolean;583 readonly asMoreThanProportion: {584 readonly nom: Compact<u32>;585 readonly denom: Compact<u32>;586 } & Struct;587 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';588 }589590 /** @name XcmV2Xcm (55) */591 interface XcmV2Xcm extends Vec<XcmV2Instruction> {}592593 /** @name XcmV2Instruction (57) */594 interface XcmV2Instruction extends Enum {595 readonly isWithdrawAsset: boolean;596 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;597 readonly isReserveAssetDeposited: boolean;598 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;599 readonly isReceiveTeleportedAsset: boolean;600 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;601 readonly isQueryResponse: boolean;602 readonly asQueryResponse: {603 readonly queryId: Compact<u64>;604 readonly response: XcmV2Response;605 readonly maxWeight: Compact<u64>;606 } & Struct;607 readonly isTransferAsset: boolean;608 readonly asTransferAsset: {609 readonly assets: XcmV1MultiassetMultiAssets;610 readonly beneficiary: XcmV1MultiLocation;611 } & Struct;612 readonly isTransferReserveAsset: boolean;613 readonly asTransferReserveAsset: {614 readonly assets: XcmV1MultiassetMultiAssets;615 readonly dest: XcmV1MultiLocation;616 readonly xcm: XcmV2Xcm;617 } & Struct;618 readonly isTransact: boolean;619 readonly asTransact: {620 readonly originType: XcmV0OriginKind;621 readonly requireWeightAtMost: Compact<u64>;622 readonly call: XcmDoubleEncoded;623 } & Struct;624 readonly isHrmpNewChannelOpenRequest: boolean;625 readonly asHrmpNewChannelOpenRequest: {626 readonly sender: Compact<u32>;627 readonly maxMessageSize: Compact<u32>;628 readonly maxCapacity: Compact<u32>;629 } & Struct;630 readonly isHrmpChannelAccepted: boolean;631 readonly asHrmpChannelAccepted: {632 readonly recipient: Compact<u32>;633 } & Struct;634 readonly isHrmpChannelClosing: boolean;635 readonly asHrmpChannelClosing: {636 readonly initiator: Compact<u32>;637 readonly sender: Compact<u32>;638 readonly recipient: Compact<u32>;639 } & Struct;640 readonly isClearOrigin: boolean;641 readonly isDescendOrigin: boolean;642 readonly asDescendOrigin: XcmV1MultilocationJunctions;643 readonly isReportError: boolean;644 readonly asReportError: {645 readonly queryId: Compact<u64>;646 readonly dest: XcmV1MultiLocation;647 readonly maxResponseWeight: Compact<u64>;648 } & Struct;649 readonly isDepositAsset: boolean;650 readonly asDepositAsset: {651 readonly assets: XcmV1MultiassetMultiAssetFilter;652 readonly maxAssets: Compact<u32>;653 readonly beneficiary: XcmV1MultiLocation;654 } & Struct;655 readonly isDepositReserveAsset: boolean;656 readonly asDepositReserveAsset: {657 readonly assets: XcmV1MultiassetMultiAssetFilter;658 readonly maxAssets: Compact<u32>;659 readonly dest: XcmV1MultiLocation;660 readonly xcm: XcmV2Xcm;661 } & Struct;662 readonly isExchangeAsset: boolean;663 readonly asExchangeAsset: {664 readonly give: XcmV1MultiassetMultiAssetFilter;665 readonly receive: XcmV1MultiassetMultiAssets;666 } & Struct;667 readonly isInitiateReserveWithdraw: boolean;668 readonly asInitiateReserveWithdraw: {669 readonly assets: XcmV1MultiassetMultiAssetFilter;670 readonly reserve: XcmV1MultiLocation;671 readonly xcm: XcmV2Xcm;672 } & Struct;673 readonly isInitiateTeleport: boolean;674 readonly asInitiateTeleport: {675 readonly assets: XcmV1MultiassetMultiAssetFilter;676 readonly dest: XcmV1MultiLocation;677 readonly xcm: XcmV2Xcm;678 } & Struct;679 readonly isQueryHolding: boolean;680 readonly asQueryHolding: {681 readonly queryId: Compact<u64>;682 readonly dest: XcmV1MultiLocation;683 readonly assets: XcmV1MultiassetMultiAssetFilter;684 readonly maxResponseWeight: Compact<u64>;685 } & Struct;686 readonly isBuyExecution: boolean;687 readonly asBuyExecution: {688 readonly fees: XcmV1MultiAsset;689 readonly weightLimit: XcmV2WeightLimit;690 } & Struct;691 readonly isRefundSurplus: boolean;692 readonly isSetErrorHandler: boolean;693 readonly asSetErrorHandler: XcmV2Xcm;694 readonly isSetAppendix: boolean;695 readonly asSetAppendix: XcmV2Xcm;696 readonly isClearError: boolean;697 readonly isClaimAsset: boolean;698 readonly asClaimAsset: {699 readonly assets: XcmV1MultiassetMultiAssets;700 readonly ticket: XcmV1MultiLocation;701 } & Struct;702 readonly isTrap: boolean;703 readonly asTrap: Compact<u64>;704 readonly isSubscribeVersion: boolean;705 readonly asSubscribeVersion: {706 readonly queryId: Compact<u64>;707 readonly maxResponseWeight: Compact<u64>;708 } & Struct;709 readonly isUnsubscribeVersion: boolean;710 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';711 }712713 /** @name XcmV1MultiassetMultiAssets (58) */714 interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}715716 /** @name XcmV1MultiAsset (60) */717 interface XcmV1MultiAsset extends Struct {718 readonly id: XcmV1MultiassetAssetId;719 readonly fun: XcmV1MultiassetFungibility;720 }721722 /** @name XcmV1MultiassetAssetId (61) */723 interface XcmV1MultiassetAssetId extends Enum {724 readonly isConcrete: boolean;725 readonly asConcrete: XcmV1MultiLocation;726 readonly isAbstract: boolean;727 readonly asAbstract: Bytes;728 readonly type: 'Concrete' | 'Abstract';729 }730731 /** @name XcmV1MultiassetFungibility (62) */732 interface XcmV1MultiassetFungibility extends Enum {733 readonly isFungible: boolean;734 readonly asFungible: Compact<u128>;735 readonly isNonFungible: boolean;736 readonly asNonFungible: XcmV1MultiassetAssetInstance;737 readonly type: 'Fungible' | 'NonFungible';738 }739740 /** @name XcmV1MultiassetAssetInstance (63) */741 interface XcmV1MultiassetAssetInstance extends Enum {742 readonly isUndefined: boolean;743 readonly isIndex: boolean;744 readonly asIndex: Compact<u128>;745 readonly isArray4: boolean;746 readonly asArray4: U8aFixed;747 readonly isArray8: boolean;748 readonly asArray8: U8aFixed;749 readonly isArray16: boolean;750 readonly asArray16: U8aFixed;751 readonly isArray32: boolean;752 readonly asArray32: U8aFixed;753 readonly isBlob: boolean;754 readonly asBlob: Bytes;755 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';756 }757758 /** @name XcmV2Response (66) */759 interface XcmV2Response extends Enum {760 readonly isNull: boolean;761 readonly isAssets: boolean;762 readonly asAssets: XcmV1MultiassetMultiAssets;763 readonly isExecutionResult: boolean;764 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;765 readonly isVersion: boolean;766 readonly asVersion: u32;767 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';768 }769770 /** @name XcmV0OriginKind (69) */771 interface XcmV0OriginKind extends Enum {772 readonly isNative: boolean;773 readonly isSovereignAccount: boolean;774 readonly isSuperuser: boolean;775 readonly isXcm: boolean;776 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';777 }778779 /** @name XcmDoubleEncoded (70) */780 interface XcmDoubleEncoded extends Struct {781 readonly encoded: Bytes;782 }783784 /** @name XcmV1MultiassetMultiAssetFilter (71) */785 interface XcmV1MultiassetMultiAssetFilter extends Enum {786 readonly isDefinite: boolean;787 readonly asDefinite: XcmV1MultiassetMultiAssets;788 readonly isWild: boolean;789 readonly asWild: XcmV1MultiassetWildMultiAsset;790 readonly type: 'Definite' | 'Wild';791 }792793 /** @name XcmV1MultiassetWildMultiAsset (72) */794 interface XcmV1MultiassetWildMultiAsset extends Enum {795 readonly isAll: boolean;796 readonly isAllOf: boolean;797 readonly asAllOf: {798 readonly id: XcmV1MultiassetAssetId;799 readonly fun: XcmV1MultiassetWildFungibility;800 } & Struct;801 readonly type: 'All' | 'AllOf';802 }803804 /** @name XcmV1MultiassetWildFungibility (73) */805 interface XcmV1MultiassetWildFungibility extends Enum {806 readonly isFungible: boolean;807 readonly isNonFungible: boolean;808 readonly type: 'Fungible' | 'NonFungible';809 }810811 /** @name XcmV2WeightLimit (74) */812 interface XcmV2WeightLimit extends Enum {813 readonly isUnlimited: boolean;814 readonly isLimited: boolean;815 readonly asLimited: Compact<u64>;816 readonly type: 'Unlimited' | 'Limited';817 }818819 /** @name XcmVersionedMultiAssets (76) */820 interface XcmVersionedMultiAssets extends Enum {821 readonly isV0: boolean;822 readonly asV0: Vec<XcmV0MultiAsset>;823 readonly isV1: boolean;824 readonly asV1: XcmV1MultiassetMultiAssets;825 readonly type: 'V0' | 'V1';826 }827828 /** @name XcmV0MultiAsset (78) */829 interface XcmV0MultiAsset extends Enum {830 readonly isNone: boolean;831 readonly isAll: boolean;832 readonly isAllFungible: boolean;833 readonly isAllNonFungible: boolean;834 readonly isAllAbstractFungible: boolean;835 readonly asAllAbstractFungible: {836 readonly id: Bytes;837 } & Struct;838 readonly isAllAbstractNonFungible: boolean;839 readonly asAllAbstractNonFungible: {840 readonly class: Bytes;841 } & Struct;842 readonly isAllConcreteFungible: boolean;843 readonly asAllConcreteFungible: {844 readonly id: XcmV0MultiLocation;845 } & Struct;846 readonly isAllConcreteNonFungible: boolean;847 readonly asAllConcreteNonFungible: {848 readonly class: XcmV0MultiLocation;849 } & Struct;850 readonly isAbstractFungible: boolean;851 readonly asAbstractFungible: {852 readonly id: Bytes;853 readonly amount: Compact<u128>;854 } & Struct;855 readonly isAbstractNonFungible: boolean;856 readonly asAbstractNonFungible: {857 readonly class: Bytes;858 readonly instance: XcmV1MultiassetAssetInstance;859 } & Struct;860 readonly isConcreteFungible: boolean;861 readonly asConcreteFungible: {862 readonly id: XcmV0MultiLocation;863 readonly amount: Compact<u128>;864 } & Struct;865 readonly isConcreteNonFungible: boolean;866 readonly asConcreteNonFungible: {867 readonly class: XcmV0MultiLocation;868 readonly instance: XcmV1MultiassetAssetInstance;869 } & Struct;870 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';871 }872873 /** @name XcmV0MultiLocation (79) */874 interface XcmV0MultiLocation extends Enum {875 readonly isNull: boolean;876 readonly isX1: boolean;877 readonly asX1: XcmV0Junction;878 readonly isX2: boolean;879 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;880 readonly isX3: boolean;881 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;882 readonly isX4: boolean;883 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;884 readonly isX5: boolean;885 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;886 readonly isX6: boolean;887 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;888 readonly isX7: boolean;889 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;890 readonly isX8: boolean;891 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;892 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';893 }894895 /** @name XcmV0Junction (80) */896 interface XcmV0Junction extends Enum {897 readonly isParent: boolean;898 readonly isParachain: boolean;899 readonly asParachain: Compact<u32>;900 readonly isAccountId32: boolean;901 readonly asAccountId32: {902 readonly network: XcmV0JunctionNetworkId;903 readonly id: U8aFixed;904 } & Struct;905 readonly isAccountIndex64: boolean;906 readonly asAccountIndex64: {907 readonly network: XcmV0JunctionNetworkId;908 readonly index: Compact<u64>;909 } & Struct;910 readonly isAccountKey20: boolean;911 readonly asAccountKey20: {912 readonly network: XcmV0JunctionNetworkId;913 readonly key: U8aFixed;914 } & Struct;915 readonly isPalletInstance: boolean;916 readonly asPalletInstance: u8;917 readonly isGeneralIndex: boolean;918 readonly asGeneralIndex: Compact<u128>;919 readonly isGeneralKey: boolean;920 readonly asGeneralKey: Bytes;921 readonly isOnlyChild: boolean;922 readonly isPlurality: boolean;923 readonly asPlurality: {924 readonly id: XcmV0JunctionBodyId;925 readonly part: XcmV0JunctionBodyPart;926 } & Struct;927 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';928 }929930 /** @name XcmVersionedMultiLocation (81) */931 interface XcmVersionedMultiLocation extends Enum {932 readonly isV0: boolean;933 readonly asV0: XcmV0MultiLocation;934 readonly isV1: boolean;935 readonly asV1: XcmV1MultiLocation;936 readonly type: 'V0' | 'V1';937 }938939 /** @name CumulusPalletXcmEvent (82) */940 interface CumulusPalletXcmEvent extends Enum {941 readonly isInvalidFormat: boolean;942 readonly asInvalidFormat: U8aFixed;943 readonly isUnsupportedVersion: boolean;944 readonly asUnsupportedVersion: U8aFixed;945 readonly isExecutedDownward: boolean;946 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;947 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';948 }949950 /** @name CumulusPalletDmpQueueEvent (83) */951 interface CumulusPalletDmpQueueEvent extends Enum {952 readonly isInvalidFormat: boolean;953 readonly asInvalidFormat: {954 readonly messageId: U8aFixed;955 } & Struct;956 readonly isUnsupportedVersion: boolean;957 readonly asUnsupportedVersion: {958 readonly messageId: U8aFixed;959 } & Struct;960 readonly isExecutedDownward: boolean;961 readonly asExecutedDownward: {962 readonly messageId: U8aFixed;963 readonly outcome: XcmV2TraitsOutcome;964 } & Struct;965 readonly isWeightExhausted: boolean;966 readonly asWeightExhausted: {967 readonly messageId: U8aFixed;968 readonly remainingWeight: u64;969 readonly requiredWeight: u64;970 } & Struct;971 readonly isOverweightEnqueued: boolean;972 readonly asOverweightEnqueued: {973 readonly messageId: U8aFixed;974 readonly overweightIndex: u64;975 readonly requiredWeight: u64;976 } & Struct;977 readonly isOverweightServiced: boolean;978 readonly asOverweightServiced: {979 readonly overweightIndex: u64;980 readonly weightUsed: u64;981 } & Struct;982 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';983 }984985 /** @name PalletUniqueRawEvent (84) */986 interface PalletUniqueRawEvent extends Enum {987 readonly isCollectionSponsorRemoved: boolean;988 readonly asCollectionSponsorRemoved: u32;989 readonly isCollectionAdminAdded: boolean;990 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;991 readonly isCollectionOwnedChanged: boolean;992 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;993 readonly isCollectionSponsorSet: boolean;994 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;995 readonly isSponsorshipConfirmed: boolean;996 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;997 readonly isCollectionAdminRemoved: boolean;998 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;999 readonly isAllowListAddressRemoved: boolean;1000 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1001 readonly isAllowListAddressAdded: boolean;1002 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1003 readonly isCollectionLimitSet: boolean;1004 readonly asCollectionLimitSet: u32;1005 readonly isCollectionPermissionSet: boolean;1006 readonly asCollectionPermissionSet: u32;1007 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';1008 }10091010 /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */1011 interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1012 readonly isSubstrate: boolean;1013 readonly asSubstrate: AccountId32;1014 readonly isEthereum: boolean;1015 readonly asEthereum: H160;1016 readonly type: 'Substrate' | 'Ethereum';1017 }10181019 /** @name PalletUniqueSchedulerEvent (88) */1020 interface PalletUniqueSchedulerEvent extends Enum {1021 readonly isScheduled: boolean;1022 readonly asScheduled: {1023 readonly when: u32;1024 readonly index: u32;1025 } & Struct;1026 readonly isCanceled: boolean;1027 readonly asCanceled: {1028 readonly when: u32;1029 readonly index: u32;1030 } & Struct;1031 readonly isDispatched: boolean;1032 readonly asDispatched: {1033 readonly task: ITuple<[u32, u32]>;1034 readonly id: Option<U8aFixed>;1035 readonly result: Result<Null, SpRuntimeDispatchError>;1036 } & Struct;1037 readonly isCallLookupFailed: boolean;1038 readonly asCallLookupFailed: {1039 readonly task: ITuple<[u32, u32]>;1040 readonly id: Option<U8aFixed>;1041 readonly error: FrameSupportScheduleLookupError;1042 } & Struct;1043 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';1044 }10451046 /** @name FrameSupportScheduleLookupError (91) */1047 interface FrameSupportScheduleLookupError extends Enum {1048 readonly isUnknown: boolean;1049 readonly isBadFormat: boolean;1050 readonly type: 'Unknown' | 'BadFormat';1051 }10521053 /** @name PalletCommonEvent (92) */1054 interface PalletCommonEvent extends Enum {1055 readonly isCollectionCreated: boolean;1056 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1057 readonly isCollectionDestroyed: boolean;1058 readonly asCollectionDestroyed: u32;1059 readonly isItemCreated: boolean;1060 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1061 readonly isItemDestroyed: boolean;1062 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1063 readonly isTransfer: boolean;1064 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1065 readonly isApproved: boolean;1066 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1067 readonly isCollectionPropertySet: boolean;1068 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1069 readonly isCollectionPropertyDeleted: boolean;1070 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1071 readonly isTokenPropertySet: boolean;1072 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1073 readonly isTokenPropertyDeleted: boolean;1074 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1075 readonly isPropertyPermissionSet: boolean;1076 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1077 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1078 }10791080 /** @name PalletStructureEvent (95) */1081 interface PalletStructureEvent extends Enum {1082 readonly isExecuted: boolean;1083 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1084 readonly type: 'Executed';1085 }10861087 /** @name PalletRmrkCoreEvent (96) */1088 interface PalletRmrkCoreEvent extends Enum {1089 readonly isCollectionCreated: boolean;1090 readonly asCollectionCreated: {1091 readonly issuer: AccountId32;1092 readonly collectionId: u32;1093 } & Struct;1094 readonly isCollectionDestroyed: boolean;1095 readonly asCollectionDestroyed: {1096 readonly issuer: AccountId32;1097 readonly collectionId: u32;1098 } & Struct;1099 readonly isIssuerChanged: boolean;1100 readonly asIssuerChanged: {1101 readonly oldIssuer: AccountId32;1102 readonly newIssuer: AccountId32;1103 readonly collectionId: u32;1104 } & Struct;1105 readonly isCollectionLocked: boolean;1106 readonly asCollectionLocked: {1107 readonly issuer: AccountId32;1108 readonly collectionId: u32;1109 } & Struct;1110 readonly isNftMinted: boolean;1111 readonly asNftMinted: {1112 readonly owner: AccountId32;1113 readonly collectionId: u32;1114 readonly nftId: u32;1115 } & Struct;1116 readonly isNftBurned: boolean;1117 readonly asNftBurned: {1118 readonly owner: AccountId32;1119 readonly nftId: u32;1120 } & Struct;1121 readonly isNftSent: boolean;1122 readonly asNftSent: {1123 readonly sender: AccountId32;1124 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1125 readonly collectionId: u32;1126 readonly nftId: u32;1127 readonly approvalRequired: bool;1128 } & Struct;1129 readonly isNftAccepted: boolean;1130 readonly asNftAccepted: {1131 readonly sender: AccountId32;1132 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1133 readonly collectionId: u32;1134 readonly nftId: u32;1135 } & Struct;1136 readonly isNftRejected: boolean;1137 readonly asNftRejected: {1138 readonly sender: AccountId32;1139 readonly collectionId: u32;1140 readonly nftId: u32;1141 } & Struct;1142 readonly isPropertySet: boolean;1143 readonly asPropertySet: {1144 readonly collectionId: u32;1145 readonly maybeNftId: Option<u32>;1146 readonly key: Bytes;1147 readonly value: Bytes;1148 } & Struct;1149 readonly isResourceAdded: boolean;1150 readonly asResourceAdded: {1151 readonly nftId: u32;1152 readonly resourceId: u32;1153 } & Struct;1154 readonly isResourceRemoval: boolean;1155 readonly asResourceRemoval: {1156 readonly nftId: u32;1157 readonly resourceId: u32;1158 } & Struct;1159 readonly isResourceAccepted: boolean;1160 readonly asResourceAccepted: {1161 readonly nftId: u32;1162 readonly resourceId: u32;1163 } & Struct;1164 readonly isResourceRemovalAccepted: boolean;1165 readonly asResourceRemovalAccepted: {1166 readonly nftId: u32;1167 readonly resourceId: u32;1168 } & Struct;1169 readonly isPrioritySet: boolean;1170 readonly asPrioritySet: {1171 readonly collectionId: u32;1172 readonly nftId: u32;1173 } & Struct;1174 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1175 }11761177 /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */1178 interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {1179 readonly isAccountId: boolean;1180 readonly asAccountId: AccountId32;1181 readonly isCollectionAndNftTuple: boolean;1182 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;1183 readonly type: 'AccountId' | 'CollectionAndNftTuple';1184 }11851186 /** @name PalletRmrkEquipEvent (102) */1187 interface PalletRmrkEquipEvent extends Enum {1188 readonly isBaseCreated: boolean;1189 readonly asBaseCreated: {1190 readonly issuer: AccountId32;1191 readonly baseId: u32;1192 } & Struct;1193 readonly isEquippablesUpdated: boolean;1194 readonly asEquippablesUpdated: {1195 readonly baseId: u32;1196 readonly slotId: u32;1197 } & Struct;1198 readonly type: 'BaseCreated' | 'EquippablesUpdated';1199 }12001201 /** @name PalletAppPromotionEvent (103) */1202 interface PalletAppPromotionEvent extends Enum {1203 readonly isStakingRecalculation: boolean;1204 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;1205 readonly isStake: boolean;1206 readonly asStake: ITuple<[AccountId32, u128]>;1207 readonly isUnstake: boolean;1208 readonly asUnstake: ITuple<[AccountId32, u128]>;1209 readonly isSetAdmin: boolean;1210 readonly asSetAdmin: AccountId32;1211 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';1212 }12131214 /** @name PalletEvmEvent (104) */1215 interface PalletEvmEvent extends Enum {1216 readonly isLog: boolean;1217 readonly asLog: EthereumLog;1218 readonly isCreated: boolean;1219 readonly asCreated: H160;1220 readonly isCreatedFailed: boolean;1221 readonly asCreatedFailed: H160;1222 readonly isExecuted: boolean;1223 readonly asExecuted: H160;1224 readonly isExecutedFailed: boolean;1225 readonly asExecutedFailed: H160;1226 readonly isBalanceDeposit: boolean;1227 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1228 readonly isBalanceWithdraw: boolean;1229 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1230 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1231 }12321233 /** @name EthereumLog (105) */1234 interface EthereumLog extends Struct {1235 readonly address: H160;1236 readonly topics: Vec<H256>;1237 readonly data: Bytes;1238 }12391240 /** @name PalletEthereumEvent (109) */1241 interface PalletEthereumEvent extends Enum {1242 readonly isExecuted: boolean;1243 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1244 readonly type: 'Executed';1245 }12461247 /** @name EvmCoreErrorExitReason (110) */1248 interface EvmCoreErrorExitReason extends Enum {1249 readonly isSucceed: boolean;1250 readonly asSucceed: EvmCoreErrorExitSucceed;1251 readonly isError: boolean;1252 readonly asError: EvmCoreErrorExitError;1253 readonly isRevert: boolean;1254 readonly asRevert: EvmCoreErrorExitRevert;1255 readonly isFatal: boolean;1256 readonly asFatal: EvmCoreErrorExitFatal;1257 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';1258 }12591260 /** @name EvmCoreErrorExitSucceed (111) */1261 interface EvmCoreErrorExitSucceed extends Enum {1262 readonly isStopped: boolean;1263 readonly isReturned: boolean;1264 readonly isSuicided: boolean;1265 readonly type: 'Stopped' | 'Returned' | 'Suicided';1266 }12671268 /** @name EvmCoreErrorExitError (112) */1269 interface EvmCoreErrorExitError extends Enum {1270 readonly isStackUnderflow: boolean;1271 readonly isStackOverflow: boolean;1272 readonly isInvalidJump: boolean;1273 readonly isInvalidRange: boolean;1274 readonly isDesignatedInvalid: boolean;1275 readonly isCallTooDeep: boolean;1276 readonly isCreateCollision: boolean;1277 readonly isCreateContractLimit: boolean;1278 readonly isOutOfOffset: boolean;1279 readonly isOutOfGas: boolean;1280 readonly isOutOfFund: boolean;1281 readonly isPcUnderflow: boolean;1282 readonly isCreateEmpty: boolean;1283 readonly isOther: boolean;1284 readonly asOther: Text;1285 readonly isInvalidCode: boolean;1286 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';1287 }12881289 /** @name EvmCoreErrorExitRevert (115) */1290 interface EvmCoreErrorExitRevert extends Enum {1291 readonly isReverted: boolean;1292 readonly type: 'Reverted';1293 }12941295 /** @name EvmCoreErrorExitFatal (116) */1296 interface EvmCoreErrorExitFatal extends Enum {1297 readonly isNotSupported: boolean;1298 readonly isUnhandledInterrupt: boolean;1299 readonly isCallErrorAsFatal: boolean;1300 readonly asCallErrorAsFatal: EvmCoreErrorExitError;1301 readonly isOther: boolean;1302 readonly asOther: Text;1303 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';1304 }13051306 /** @name PalletEvmContractHelpersEvent (117) */1307 interface PalletEvmContractHelpersEvent extends Enum {1308 readonly isContractSponsorSet: boolean;1309 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1310 readonly isContractSponsorshipConfirmed: boolean;1311 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1312 readonly isContractSponsorRemoved: boolean;1313 readonly asContractSponsorRemoved: H160;1314 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1315 }13161317 /** @name FrameSystemPhase (118) */1318 interface FrameSystemPhase extends Enum {1319 readonly isApplyExtrinsic: boolean;1320 readonly asApplyExtrinsic: u32;1321 readonly isFinalization: boolean;1322 readonly isInitialization: boolean;1323 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';1324 }13251326 /** @name FrameSystemLastRuntimeUpgradeInfo (120) */1327 interface FrameSystemLastRuntimeUpgradeInfo extends Struct {1328 readonly specVersion: Compact<u32>;1329 readonly specName: Text;1330 }13311332 /** @name FrameSystemCall (121) */1333 interface FrameSystemCall extends Enum {1334 readonly isFillBlock: boolean;1335 readonly asFillBlock: {1336 readonly ratio: Perbill;1337 } & Struct;1338 readonly isRemark: boolean;1339 readonly asRemark: {1340 readonly remark: Bytes;1341 } & Struct;1342 readonly isSetHeapPages: boolean;1343 readonly asSetHeapPages: {1344 readonly pages: u64;1345 } & Struct;1346 readonly isSetCode: boolean;1347 readonly asSetCode: {1348 readonly code: Bytes;1349 } & Struct;1350 readonly isSetCodeWithoutChecks: boolean;1351 readonly asSetCodeWithoutChecks: {1352 readonly code: Bytes;1353 } & Struct;1354 readonly isSetStorage: boolean;1355 readonly asSetStorage: {1356 readonly items: Vec<ITuple<[Bytes, Bytes]>>;1357 } & Struct;1358 readonly isKillStorage: boolean;1359 readonly asKillStorage: {1360 readonly keys_: Vec<Bytes>;1361 } & Struct;1362 readonly isKillPrefix: boolean;1363 readonly asKillPrefix: {1364 readonly prefix: Bytes;1365 readonly subkeys: u32;1366 } & Struct;1367 readonly isRemarkWithEvent: boolean;1368 readonly asRemarkWithEvent: {1369 readonly remark: Bytes;1370 } & Struct;1371 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';1372 }13731374 /** @name FrameSystemLimitsBlockWeights (126) */1375 interface FrameSystemLimitsBlockWeights extends Struct {1376 readonly baseBlock: u64;1377 readonly maxBlock: u64;1378 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;1379 }13801381 /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (127) */1382 interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {1383 readonly normal: FrameSystemLimitsWeightsPerClass;1384 readonly operational: FrameSystemLimitsWeightsPerClass;1385 readonly mandatory: FrameSystemLimitsWeightsPerClass;1386 }13871388 /** @name FrameSystemLimitsWeightsPerClass (128) */1389 interface FrameSystemLimitsWeightsPerClass extends Struct {1390 readonly baseExtrinsic: u64;1391 readonly maxExtrinsic: Option<u64>;1392 readonly maxTotal: Option<u64>;1393 readonly reserved: Option<u64>;1394 }13951396 /** @name FrameSystemLimitsBlockLength (130) */1397 interface FrameSystemLimitsBlockLength extends Struct {1398 readonly max: FrameSupportWeightsPerDispatchClassU32;1399 }14001401 /** @name FrameSupportWeightsPerDispatchClassU32 (131) */1402 interface FrameSupportWeightsPerDispatchClassU32 extends Struct {1403 readonly normal: u32;1404 readonly operational: u32;1405 readonly mandatory: u32;1406 }14071408 /** @name FrameSupportWeightsRuntimeDbWeight (132) */1409 interface FrameSupportWeightsRuntimeDbWeight extends Struct {1410 readonly read: u64;1411 readonly write: u64;1412 }14131414 /** @name SpVersionRuntimeVersion (133) */1415 interface SpVersionRuntimeVersion extends Struct {1416 readonly specName: Text;1417 readonly implName: Text;1418 readonly authoringVersion: u32;1419 readonly specVersion: u32;1420 readonly implVersion: u32;1421 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;1422 readonly transactionVersion: u32;1423 readonly stateVersion: u8;1424 }14251426 /** @name FrameSystemError (138) */1427 interface FrameSystemError extends Enum {1428 readonly isInvalidSpecName: boolean;1429 readonly isSpecVersionNeedsToIncrease: boolean;1430 readonly isFailedToExtractRuntimeVersion: boolean;1431 readonly isNonDefaultComposite: boolean;1432 readonly isNonZeroRefCount: boolean;1433 readonly isCallFiltered: boolean;1434 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';1435 }14361437 /** @name PolkadotPrimitivesV2PersistedValidationData (139) */1438 interface PolkadotPrimitivesV2PersistedValidationData extends Struct {1439 readonly parentHead: Bytes;1440 readonly relayParentNumber: u32;1441 readonly relayParentStorageRoot: H256;1442 readonly maxPovSize: u32;1443 }14441445 /** @name PolkadotPrimitivesV2UpgradeRestriction (142) */1446 interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {1447 readonly isPresent: boolean;1448 readonly type: 'Present';1449 }14501451 /** @name SpTrieStorageProof (143) */1452 interface SpTrieStorageProof extends Struct {1453 readonly trieNodes: BTreeSet<Bytes>;1454 }14551456 /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (145) */1457 interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {1458 readonly dmqMqcHead: H256;1459 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;1460 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1461 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1462 }14631464 /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (148) */1465 interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {1466 readonly maxCapacity: u32;1467 readonly maxTotalSize: u32;1468 readonly maxMessageSize: u32;1469 readonly msgCount: u32;1470 readonly totalSize: u32;1471 readonly mqcHead: Option<H256>;1472 }14731474 /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (149) */1475 interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {1476 readonly maxCodeSize: u32;1477 readonly maxHeadDataSize: u32;1478 readonly maxUpwardQueueCount: u32;1479 readonly maxUpwardQueueSize: u32;1480 readonly maxUpwardMessageSize: u32;1481 readonly maxUpwardMessageNumPerCandidate: u32;1482 readonly hrmpMaxMessageNumPerCandidate: u32;1483 readonly validationUpgradeCooldown: u32;1484 readonly validationUpgradeDelay: u32;1485 }14861487 /** @name PolkadotCorePrimitivesOutboundHrmpMessage (155) */1488 interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {1489 readonly recipient: u32;1490 readonly data: Bytes;1491 }14921493 /** @name CumulusPalletParachainSystemCall (156) */1494 interface CumulusPalletParachainSystemCall extends Enum {1495 readonly isSetValidationData: boolean;1496 readonly asSetValidationData: {1497 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;1498 } & Struct;1499 readonly isSudoSendUpwardMessage: boolean;1500 readonly asSudoSendUpwardMessage: {1501 readonly message: Bytes;1502 } & Struct;1503 readonly isAuthorizeUpgrade: boolean;1504 readonly asAuthorizeUpgrade: {1505 readonly codeHash: H256;1506 } & Struct;1507 readonly isEnactAuthorizedUpgrade: boolean;1508 readonly asEnactAuthorizedUpgrade: {1509 readonly code: Bytes;1510 } & Struct;1511 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';1512 }15131514 /** @name CumulusPrimitivesParachainInherentParachainInherentData (157) */1515 interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {1516 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;1517 readonly relayChainState: SpTrieStorageProof;1518 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;1519 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;1520 }15211522 /** @name PolkadotCorePrimitivesInboundDownwardMessage (159) */1523 interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {1524 readonly sentAt: u32;1525 readonly msg: Bytes;1526 }15271528 /** @name PolkadotCorePrimitivesInboundHrmpMessage (162) */1529 interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {1530 readonly sentAt: u32;1531 readonly data: Bytes;1532 }15331534 /** @name CumulusPalletParachainSystemError (165) */1535 interface CumulusPalletParachainSystemError extends Enum {1536 readonly isOverlappingUpgrades: boolean;1537 readonly isProhibitedByPolkadot: boolean;1538 readonly isTooBig: boolean;1539 readonly isValidationDataNotAvailable: boolean;1540 readonly isHostConfigurationNotAvailable: boolean;1541 readonly isNotScheduled: boolean;1542 readonly isNothingAuthorized: boolean;1543 readonly isUnauthorized: boolean;1544 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';1545 }15461547 /** @name PalletBalancesBalanceLock (167) */1548 interface PalletBalancesBalanceLock extends Struct {1549 readonly id: U8aFixed;1550 readonly amount: u128;1551 readonly reasons: PalletBalancesReasons;1552 }15531554 /** @name PalletBalancesReasons (168) */1555 interface PalletBalancesReasons extends Enum {1556 readonly isFee: boolean;1557 readonly isMisc: boolean;1558 readonly isAll: boolean;1559 readonly type: 'Fee' | 'Misc' | 'All';1560 }15611562 /** @name PalletBalancesReserveData (171) */1563 interface PalletBalancesReserveData extends Struct {1564 readonly id: U8aFixed;1565 readonly amount: u128;1566 }15671568 /** @name PalletBalancesReleases (173) */1569 interface PalletBalancesReleases extends Enum {1570 readonly isV100: boolean;1571 readonly isV200: boolean;1572 readonly type: 'V100' | 'V200';1573 }15741575 /** @name PalletBalancesCall (174) */1576 interface PalletBalancesCall extends Enum {1577 readonly isTransfer: boolean;1578 readonly asTransfer: {1579 readonly dest: MultiAddress;1580 readonly value: Compact<u128>;1581 } & Struct;1582 readonly isSetBalance: boolean;1583 readonly asSetBalance: {1584 readonly who: MultiAddress;1585 readonly newFree: Compact<u128>;1586 readonly newReserved: Compact<u128>;1587 } & Struct;1588 readonly isForceTransfer: boolean;1589 readonly asForceTransfer: {1590 readonly source: MultiAddress;1591 readonly dest: MultiAddress;1592 readonly value: Compact<u128>;1593 } & Struct;1594 readonly isTransferKeepAlive: boolean;1595 readonly asTransferKeepAlive: {1596 readonly dest: MultiAddress;1597 readonly value: Compact<u128>;1598 } & Struct;1599 readonly isTransferAll: boolean;1600 readonly asTransferAll: {1601 readonly dest: MultiAddress;1602 readonly keepAlive: bool;1603 } & Struct;1604 readonly isForceUnreserve: boolean;1605 readonly asForceUnreserve: {1606 readonly who: MultiAddress;1607 readonly amount: u128;1608 } & Struct;1609 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';1610 }16111612 /** @name PalletBalancesError (177) */1613 interface PalletBalancesError extends Enum {1614 readonly isVestingBalance: boolean;1615 readonly isLiquidityRestrictions: boolean;1616 readonly isInsufficientBalance: boolean;1617 readonly isExistentialDeposit: boolean;1618 readonly isKeepAlive: boolean;1619 readonly isExistingVestingSchedule: boolean;1620 readonly isDeadAccount: boolean;1621 readonly isTooManyReserves: boolean;1622 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';1623 }16241625 /** @name PalletTimestampCall (179) */1626 interface PalletTimestampCall extends Enum {1627 readonly isSet: boolean;1628 readonly asSet: {1629 readonly now: Compact<u64>;1630 } & Struct;1631 readonly type: 'Set';1632 }16331634 /** @name PalletTransactionPaymentReleases (181) */1635 interface PalletTransactionPaymentReleases extends Enum {1636 readonly isV1Ancient: boolean;1637 readonly isV2: boolean;1638 readonly type: 'V1Ancient' | 'V2';1639 }16401641 /** @name PalletTreasuryProposal (182) */1642 interface PalletTreasuryProposal extends Struct {1643 readonly proposer: AccountId32;1644 readonly value: u128;1645 readonly beneficiary: AccountId32;1646 readonly bond: u128;1647 }16481649 /** @name PalletTreasuryCall (185) */1650 interface PalletTreasuryCall extends Enum {1651 readonly isProposeSpend: boolean;1652 readonly asProposeSpend: {1653 readonly value: Compact<u128>;1654 readonly beneficiary: MultiAddress;1655 } & Struct;1656 readonly isRejectProposal: boolean;1657 readonly asRejectProposal: {1658 readonly proposalId: Compact<u32>;1659 } & Struct;1660 readonly isApproveProposal: boolean;1661 readonly asApproveProposal: {1662 readonly proposalId: Compact<u32>;1663 } & Struct;1664 readonly isSpend: boolean;1665 readonly asSpend: {1666 readonly amount: Compact<u128>;1667 readonly beneficiary: MultiAddress;1668 } & Struct;1669 readonly isRemoveApproval: boolean;1670 readonly asRemoveApproval: {1671 readonly proposalId: Compact<u32>;1672 } & Struct;1673 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';1674 }16751676 /** @name FrameSupportPalletId (188) */1677 interface FrameSupportPalletId extends U8aFixed {}16781679 /** @name PalletTreasuryError (189) */1680 interface PalletTreasuryError extends Enum {1681 readonly isInsufficientProposersBalance: boolean;1682 readonly isInvalidIndex: boolean;1683 readonly isTooManyApprovals: boolean;1684 readonly isInsufficientPermission: boolean;1685 readonly isProposalNotApproved: boolean;1686 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';1687 }16881689 /** @name PalletSudoCall (190) */1690 interface PalletSudoCall extends Enum {1691 readonly isSudo: boolean;1692 readonly asSudo: {1693 readonly call: Call;1694 } & Struct;1695 readonly isSudoUncheckedWeight: boolean;1696 readonly asSudoUncheckedWeight: {1697 readonly call: Call;1698 readonly weight: u64;1699 } & Struct;1700 readonly isSetKey: boolean;1701 readonly asSetKey: {1702 readonly new_: MultiAddress;1703 } & Struct;1704 readonly isSudoAs: boolean;1705 readonly asSudoAs: {1706 readonly who: MultiAddress;1707 readonly call: Call;1708 } & Struct;1709 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1710 }17111712 /** @name OrmlVestingModuleCall (192) */1713 interface OrmlVestingModuleCall extends Enum {1714 readonly isClaim: boolean;1715 readonly isVestedTransfer: boolean;1716 readonly asVestedTransfer: {1717 readonly dest: MultiAddress;1718 readonly schedule: OrmlVestingVestingSchedule;1719 } & Struct;1720 readonly isUpdateVestingSchedules: boolean;1721 readonly asUpdateVestingSchedules: {1722 readonly who: MultiAddress;1723 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;1724 } & Struct;1725 readonly isClaimFor: boolean;1726 readonly asClaimFor: {1727 readonly dest: MultiAddress;1728 } & Struct;1729 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';1730 }17311732 /** @name CumulusPalletXcmpQueueCall (194) */1733 interface CumulusPalletXcmpQueueCall extends Enum {1734 readonly isServiceOverweight: boolean;1735 readonly asServiceOverweight: {1736 readonly index: u64;1737 readonly weightLimit: u64;1738 } & Struct;1739 readonly isSuspendXcmExecution: boolean;1740 readonly isResumeXcmExecution: boolean;1741 readonly isUpdateSuspendThreshold: boolean;1742 readonly asUpdateSuspendThreshold: {1743 readonly new_: u32;1744 } & Struct;1745 readonly isUpdateDropThreshold: boolean;1746 readonly asUpdateDropThreshold: {1747 readonly new_: u32;1748 } & Struct;1749 readonly isUpdateResumeThreshold: boolean;1750 readonly asUpdateResumeThreshold: {1751 readonly new_: u32;1752 } & Struct;1753 readonly isUpdateThresholdWeight: boolean;1754 readonly asUpdateThresholdWeight: {1755 readonly new_: u64;1756 } & Struct;1757 readonly isUpdateWeightRestrictDecay: boolean;1758 readonly asUpdateWeightRestrictDecay: {1759 readonly new_: u64;1760 } & Struct;1761 readonly isUpdateXcmpMaxIndividualWeight: boolean;1762 readonly asUpdateXcmpMaxIndividualWeight: {1763 readonly new_: u64;1764 } & Struct;1765 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';1766 }17671768 /** @name PalletXcmCall (195) */1769 interface PalletXcmCall extends Enum {1770 readonly isSend: boolean;1771 readonly asSend: {1772 readonly dest: XcmVersionedMultiLocation;1773 readonly message: XcmVersionedXcm;1774 } & Struct;1775 readonly isTeleportAssets: boolean;1776 readonly asTeleportAssets: {1777 readonly dest: XcmVersionedMultiLocation;1778 readonly beneficiary: XcmVersionedMultiLocation;1779 readonly assets: XcmVersionedMultiAssets;1780 readonly feeAssetItem: u32;1781 } & Struct;1782 readonly isReserveTransferAssets: boolean;1783 readonly asReserveTransferAssets: {1784 readonly dest: XcmVersionedMultiLocation;1785 readonly beneficiary: XcmVersionedMultiLocation;1786 readonly assets: XcmVersionedMultiAssets;1787 readonly feeAssetItem: u32;1788 } & Struct;1789 readonly isExecute: boolean;1790 readonly asExecute: {1791 readonly message: XcmVersionedXcm;1792 readonly maxWeight: u64;1793 } & Struct;1794 readonly isForceXcmVersion: boolean;1795 readonly asForceXcmVersion: {1796 readonly location: XcmV1MultiLocation;1797 readonly xcmVersion: u32;1798 } & Struct;1799 readonly isForceDefaultXcmVersion: boolean;1800 readonly asForceDefaultXcmVersion: {1801 readonly maybeXcmVersion: Option<u32>;1802 } & Struct;1803 readonly isForceSubscribeVersionNotify: boolean;1804 readonly asForceSubscribeVersionNotify: {1805 readonly location: XcmVersionedMultiLocation;1806 } & Struct;1807 readonly isForceUnsubscribeVersionNotify: boolean;1808 readonly asForceUnsubscribeVersionNotify: {1809 readonly location: XcmVersionedMultiLocation;1810 } & Struct;1811 readonly isLimitedReserveTransferAssets: boolean;1812 readonly asLimitedReserveTransferAssets: {1813 readonly dest: XcmVersionedMultiLocation;1814 readonly beneficiary: XcmVersionedMultiLocation;1815 readonly assets: XcmVersionedMultiAssets;1816 readonly feeAssetItem: u32;1817 readonly weightLimit: XcmV2WeightLimit;1818 } & Struct;1819 readonly isLimitedTeleportAssets: boolean;1820 readonly asLimitedTeleportAssets: {1821 readonly dest: XcmVersionedMultiLocation;1822 readonly beneficiary: XcmVersionedMultiLocation;1823 readonly assets: XcmVersionedMultiAssets;1824 readonly feeAssetItem: u32;1825 readonly weightLimit: XcmV2WeightLimit;1826 } & Struct;1827 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';1828 }18291830 /** @name XcmVersionedXcm (196) */1831 interface XcmVersionedXcm extends Enum {1832 readonly isV0: boolean;1833 readonly asV0: XcmV0Xcm;1834 readonly isV1: boolean;1835 readonly asV1: XcmV1Xcm;1836 readonly isV2: boolean;1837 readonly asV2: XcmV2Xcm;1838 readonly type: 'V0' | 'V1' | 'V2';1839 }18401841 /** @name XcmV0Xcm (197) */1842 interface XcmV0Xcm extends Enum {1843 readonly isWithdrawAsset: boolean;1844 readonly asWithdrawAsset: {1845 readonly assets: Vec<XcmV0MultiAsset>;1846 readonly effects: Vec<XcmV0Order>;1847 } & Struct;1848 readonly isReserveAssetDeposit: boolean;1849 readonly asReserveAssetDeposit: {1850 readonly assets: Vec<XcmV0MultiAsset>;1851 readonly effects: Vec<XcmV0Order>;1852 } & Struct;1853 readonly isTeleportAsset: boolean;1854 readonly asTeleportAsset: {1855 readonly assets: Vec<XcmV0MultiAsset>;1856 readonly effects: Vec<XcmV0Order>;1857 } & Struct;1858 readonly isQueryResponse: boolean;1859 readonly asQueryResponse: {1860 readonly queryId: Compact<u64>;1861 readonly response: XcmV0Response;1862 } & Struct;1863 readonly isTransferAsset: boolean;1864 readonly asTransferAsset: {1865 readonly assets: Vec<XcmV0MultiAsset>;1866 readonly dest: XcmV0MultiLocation;1867 } & Struct;1868 readonly isTransferReserveAsset: boolean;1869 readonly asTransferReserveAsset: {1870 readonly assets: Vec<XcmV0MultiAsset>;1871 readonly dest: XcmV0MultiLocation;1872 readonly effects: Vec<XcmV0Order>;1873 } & Struct;1874 readonly isTransact: boolean;1875 readonly asTransact: {1876 readonly originType: XcmV0OriginKind;1877 readonly requireWeightAtMost: u64;1878 readonly call: XcmDoubleEncoded;1879 } & Struct;1880 readonly isHrmpNewChannelOpenRequest: boolean;1881 readonly asHrmpNewChannelOpenRequest: {1882 readonly sender: Compact<u32>;1883 readonly maxMessageSize: Compact<u32>;1884 readonly maxCapacity: Compact<u32>;1885 } & Struct;1886 readonly isHrmpChannelAccepted: boolean;1887 readonly asHrmpChannelAccepted: {1888 readonly recipient: Compact<u32>;1889 } & Struct;1890 readonly isHrmpChannelClosing: boolean;1891 readonly asHrmpChannelClosing: {1892 readonly initiator: Compact<u32>;1893 readonly sender: Compact<u32>;1894 readonly recipient: Compact<u32>;1895 } & Struct;1896 readonly isRelayedFrom: boolean;1897 readonly asRelayedFrom: {1898 readonly who: XcmV0MultiLocation;1899 readonly message: XcmV0Xcm;1900 } & Struct;1901 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';1902 }19031904 /** @name XcmV0Order (199) */1905 interface XcmV0Order extends Enum {1906 readonly isNull: boolean;1907 readonly isDepositAsset: boolean;1908 readonly asDepositAsset: {1909 readonly assets: Vec<XcmV0MultiAsset>;1910 readonly dest: XcmV0MultiLocation;1911 } & Struct;1912 readonly isDepositReserveAsset: boolean;1913 readonly asDepositReserveAsset: {1914 readonly assets: Vec<XcmV0MultiAsset>;1915 readonly dest: XcmV0MultiLocation;1916 readonly effects: Vec<XcmV0Order>;1917 } & Struct;1918 readonly isExchangeAsset: boolean;1919 readonly asExchangeAsset: {1920 readonly give: Vec<XcmV0MultiAsset>;1921 readonly receive: Vec<XcmV0MultiAsset>;1922 } & Struct;1923 readonly isInitiateReserveWithdraw: boolean;1924 readonly asInitiateReserveWithdraw: {1925 readonly assets: Vec<XcmV0MultiAsset>;1926 readonly reserve: XcmV0MultiLocation;1927 readonly effects: Vec<XcmV0Order>;1928 } & Struct;1929 readonly isInitiateTeleport: boolean;1930 readonly asInitiateTeleport: {1931 readonly assets: Vec<XcmV0MultiAsset>;1932 readonly dest: XcmV0MultiLocation;1933 readonly effects: Vec<XcmV0Order>;1934 } & Struct;1935 readonly isQueryHolding: boolean;1936 readonly asQueryHolding: {1937 readonly queryId: Compact<u64>;1938 readonly dest: XcmV0MultiLocation;1939 readonly assets: Vec<XcmV0MultiAsset>;1940 } & Struct;1941 readonly isBuyExecution: boolean;1942 readonly asBuyExecution: {1943 readonly fees: XcmV0MultiAsset;1944 readonly weight: u64;1945 readonly debt: u64;1946 readonly haltOnError: bool;1947 readonly xcm: Vec<XcmV0Xcm>;1948 } & Struct;1949 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';1950 }19511952 /** @name XcmV0Response (201) */1953 interface XcmV0Response extends Enum {1954 readonly isAssets: boolean;1955 readonly asAssets: Vec<XcmV0MultiAsset>;1956 readonly type: 'Assets';1957 }19581959 /** @name XcmV1Xcm (202) */1960 interface XcmV1Xcm extends Enum {1961 readonly isWithdrawAsset: boolean;1962 readonly asWithdrawAsset: {1963 readonly assets: XcmV1MultiassetMultiAssets;1964 readonly effects: Vec<XcmV1Order>;1965 } & Struct;1966 readonly isReserveAssetDeposited: boolean;1967 readonly asReserveAssetDeposited: {1968 readonly assets: XcmV1MultiassetMultiAssets;1969 readonly effects: Vec<XcmV1Order>;1970 } & Struct;1971 readonly isReceiveTeleportedAsset: boolean;1972 readonly asReceiveTeleportedAsset: {1973 readonly assets: XcmV1MultiassetMultiAssets;1974 readonly effects: Vec<XcmV1Order>;1975 } & Struct;1976 readonly isQueryResponse: boolean;1977 readonly asQueryResponse: {1978 readonly queryId: Compact<u64>;1979 readonly response: XcmV1Response;1980 } & Struct;1981 readonly isTransferAsset: boolean;1982 readonly asTransferAsset: {1983 readonly assets: XcmV1MultiassetMultiAssets;1984 readonly beneficiary: XcmV1MultiLocation;1985 } & Struct;1986 readonly isTransferReserveAsset: boolean;1987 readonly asTransferReserveAsset: {1988 readonly assets: XcmV1MultiassetMultiAssets;1989 readonly dest: XcmV1MultiLocation;1990 readonly effects: Vec<XcmV1Order>;1991 } & Struct;1992 readonly isTransact: boolean;1993 readonly asTransact: {1994 readonly originType: XcmV0OriginKind;1995 readonly requireWeightAtMost: u64;1996 readonly call: XcmDoubleEncoded;1997 } & Struct;1998 readonly isHrmpNewChannelOpenRequest: boolean;1999 readonly asHrmpNewChannelOpenRequest: {2000 readonly sender: Compact<u32>;2001 readonly maxMessageSize: Compact<u32>;2002 readonly maxCapacity: Compact<u32>;2003 } & Struct;2004 readonly isHrmpChannelAccepted: boolean;2005 readonly asHrmpChannelAccepted: {2006 readonly recipient: Compact<u32>;2007 } & Struct;2008 readonly isHrmpChannelClosing: boolean;2009 readonly asHrmpChannelClosing: {2010 readonly initiator: Compact<u32>;2011 readonly sender: Compact<u32>;2012 readonly recipient: Compact<u32>;2013 } & Struct;2014 readonly isRelayedFrom: boolean;2015 readonly asRelayedFrom: {2016 readonly who: XcmV1MultilocationJunctions;2017 readonly message: XcmV1Xcm;2018 } & Struct;2019 readonly isSubscribeVersion: boolean;2020 readonly asSubscribeVersion: {2021 readonly queryId: Compact<u64>;2022 readonly maxResponseWeight: Compact<u64>;2023 } & Struct;2024 readonly isUnsubscribeVersion: boolean;2025 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';2026 }20272028 /** @name XcmV1Order (204) */2029 interface XcmV1Order extends Enum {2030 readonly isNoop: boolean;2031 readonly isDepositAsset: boolean;2032 readonly asDepositAsset: {2033 readonly assets: XcmV1MultiassetMultiAssetFilter;2034 readonly maxAssets: u32;2035 readonly beneficiary: XcmV1MultiLocation;2036 } & Struct;2037 readonly isDepositReserveAsset: boolean;2038 readonly asDepositReserveAsset: {2039 readonly assets: XcmV1MultiassetMultiAssetFilter;2040 readonly maxAssets: u32;2041 readonly dest: XcmV1MultiLocation;2042 readonly effects: Vec<XcmV1Order>;2043 } & Struct;2044 readonly isExchangeAsset: boolean;2045 readonly asExchangeAsset: {2046 readonly give: XcmV1MultiassetMultiAssetFilter;2047 readonly receive: XcmV1MultiassetMultiAssets;2048 } & Struct;2049 readonly isInitiateReserveWithdraw: boolean;2050 readonly asInitiateReserveWithdraw: {2051 readonly assets: XcmV1MultiassetMultiAssetFilter;2052 readonly reserve: XcmV1MultiLocation;2053 readonly effects: Vec<XcmV1Order>;2054 } & Struct;2055 readonly isInitiateTeleport: boolean;2056 readonly asInitiateTeleport: {2057 readonly assets: XcmV1MultiassetMultiAssetFilter;2058 readonly dest: XcmV1MultiLocation;2059 readonly effects: Vec<XcmV1Order>;2060 } & Struct;2061 readonly isQueryHolding: boolean;2062 readonly asQueryHolding: {2063 readonly queryId: Compact<u64>;2064 readonly dest: XcmV1MultiLocation;2065 readonly assets: XcmV1MultiassetMultiAssetFilter;2066 } & Struct;2067 readonly isBuyExecution: boolean;2068 readonly asBuyExecution: {2069 readonly fees: XcmV1MultiAsset;2070 readonly weight: u64;2071 readonly debt: u64;2072 readonly haltOnError: bool;2073 readonly instructions: Vec<XcmV1Xcm>;2074 } & Struct;2075 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2076 }20772078 /** @name XcmV1Response (206) */2079 interface XcmV1Response extends Enum {2080 readonly isAssets: boolean;2081 readonly asAssets: XcmV1MultiassetMultiAssets;2082 readonly isVersion: boolean;2083 readonly asVersion: u32;2084 readonly type: 'Assets' | 'Version';2085 }20862087 /** @name CumulusPalletXcmCall (220) */2088 type CumulusPalletXcmCall = Null;20892090 /** @name CumulusPalletDmpQueueCall (221) */2091 interface CumulusPalletDmpQueueCall extends Enum {2092 readonly isServiceOverweight: boolean;2093 readonly asServiceOverweight: {2094 readonly index: u64;2095 readonly weightLimit: u64;2096 } & Struct;2097 readonly type: 'ServiceOverweight';2098 }20992100 /** @name PalletInflationCall (222) */2101 interface PalletInflationCall extends Enum {2102 readonly isStartInflation: boolean;2103 readonly asStartInflation: {2104 readonly inflationStartRelayBlock: u32;2105 } & Struct;2106 readonly type: 'StartInflation';2107 }21082109 /** @name PalletUniqueCall (223) */2110 interface PalletUniqueCall extends Enum {2111 readonly isCreateCollection: boolean;2112 readonly asCreateCollection: {2113 readonly collectionName: Vec<u16>;2114 readonly collectionDescription: Vec<u16>;2115 readonly tokenPrefix: Bytes;2116 readonly mode: UpDataStructsCollectionMode;2117 } & Struct;2118 readonly isCreateCollectionEx: boolean;2119 readonly asCreateCollectionEx: {2120 readonly data: UpDataStructsCreateCollectionData;2121 } & Struct;2122 readonly isDestroyCollection: boolean;2123 readonly asDestroyCollection: {2124 readonly collectionId: u32;2125 } & Struct;2126 readonly isAddToAllowList: boolean;2127 readonly asAddToAllowList: {2128 readonly collectionId: u32;2129 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2130 } & Struct;2131 readonly isRemoveFromAllowList: boolean;2132 readonly asRemoveFromAllowList: {2133 readonly collectionId: u32;2134 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2135 } & Struct;2136 readonly isChangeCollectionOwner: boolean;2137 readonly asChangeCollectionOwner: {2138 readonly collectionId: u32;2139 readonly newOwner: AccountId32;2140 } & Struct;2141 readonly isAddCollectionAdmin: boolean;2142 readonly asAddCollectionAdmin: {2143 readonly collectionId: u32;2144 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2145 } & Struct;2146 readonly isRemoveCollectionAdmin: boolean;2147 readonly asRemoveCollectionAdmin: {2148 readonly collectionId: u32;2149 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2150 } & Struct;2151 readonly isSetCollectionSponsor: boolean;2152 readonly asSetCollectionSponsor: {2153 readonly collectionId: u32;2154 readonly newSponsor: AccountId32;2155 } & Struct;2156 readonly isConfirmSponsorship: boolean;2157 readonly asConfirmSponsorship: {2158 readonly collectionId: u32;2159 } & Struct;2160 readonly isRemoveCollectionSponsor: boolean;2161 readonly asRemoveCollectionSponsor: {2162 readonly collectionId: u32;2163 } & Struct;2164 readonly isCreateItem: boolean;2165 readonly asCreateItem: {2166 readonly collectionId: u32;2167 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2168 readonly data: UpDataStructsCreateItemData;2169 } & Struct;2170 readonly isCreateMultipleItems: boolean;2171 readonly asCreateMultipleItems: {2172 readonly collectionId: u32;2173 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2174 readonly itemsData: Vec<UpDataStructsCreateItemData>;2175 } & Struct;2176 readonly isSetCollectionProperties: boolean;2177 readonly asSetCollectionProperties: {2178 readonly collectionId: u32;2179 readonly properties: Vec<UpDataStructsProperty>;2180 } & Struct;2181 readonly isDeleteCollectionProperties: boolean;2182 readonly asDeleteCollectionProperties: {2183 readonly collectionId: u32;2184 readonly propertyKeys: Vec<Bytes>;2185 } & Struct;2186 readonly isSetTokenProperties: boolean;2187 readonly asSetTokenProperties: {2188 readonly collectionId: u32;2189 readonly tokenId: u32;2190 readonly properties: Vec<UpDataStructsProperty>;2191 } & Struct;2192 readonly isDeleteTokenProperties: boolean;2193 readonly asDeleteTokenProperties: {2194 readonly collectionId: u32;2195 readonly tokenId: u32;2196 readonly propertyKeys: Vec<Bytes>;2197 } & Struct;2198 readonly isSetTokenPropertyPermissions: boolean;2199 readonly asSetTokenPropertyPermissions: {2200 readonly collectionId: u32;2201 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2202 } & Struct;2203 readonly isCreateMultipleItemsEx: boolean;2204 readonly asCreateMultipleItemsEx: {2205 readonly collectionId: u32;2206 readonly data: UpDataStructsCreateItemExData;2207 } & Struct;2208 readonly isSetTransfersEnabledFlag: boolean;2209 readonly asSetTransfersEnabledFlag: {2210 readonly collectionId: u32;2211 readonly value: bool;2212 } & Struct;2213 readonly isBurnItem: boolean;2214 readonly asBurnItem: {2215 readonly collectionId: u32;2216 readonly itemId: u32;2217 readonly value: u128;2218 } & Struct;2219 readonly isBurnFrom: boolean;2220 readonly asBurnFrom: {2221 readonly collectionId: u32;2222 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2223 readonly itemId: u32;2224 readonly value: u128;2225 } & Struct;2226 readonly isTransfer: boolean;2227 readonly asTransfer: {2228 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2229 readonly collectionId: u32;2230 readonly itemId: u32;2231 readonly value: u128;2232 } & Struct;2233 readonly isApprove: boolean;2234 readonly asApprove: {2235 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2236 readonly collectionId: u32;2237 readonly itemId: u32;2238 readonly amount: u128;2239 } & Struct;2240 readonly isTransferFrom: boolean;2241 readonly asTransferFrom: {2242 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2243 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2244 readonly collectionId: u32;2245 readonly itemId: u32;2246 readonly value: u128;2247 } & Struct;2248 readonly isSetCollectionLimits: boolean;2249 readonly asSetCollectionLimits: {2250 readonly collectionId: u32;2251 readonly newLimit: UpDataStructsCollectionLimits;2252 } & Struct;2253 readonly isSetCollectionPermissions: boolean;2254 readonly asSetCollectionPermissions: {2255 readonly collectionId: u32;2256 readonly newPermission: UpDataStructsCollectionPermissions;2257 } & Struct;2258 readonly isRepartition: boolean;2259 readonly asRepartition: {2260 readonly collectionId: u32;2261 readonly tokenId: u32;2262 readonly amount: u128;2263 } & Struct;2264 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';2265 }22662267 /** @name UpDataStructsCollectionMode (228) */2268 interface UpDataStructsCollectionMode extends Enum {2269 readonly isNft: boolean;2270 readonly isFungible: boolean;2271 readonly asFungible: u8;2272 readonly isReFungible: boolean;2273 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2274 }22752276 /** @name UpDataStructsCreateCollectionData (229) */2277 interface UpDataStructsCreateCollectionData extends Struct {2278 readonly mode: UpDataStructsCollectionMode;2279 readonly access: Option<UpDataStructsAccessMode>;2280 readonly name: Vec<u16>;2281 readonly description: Vec<u16>;2282 readonly tokenPrefix: Bytes;2283 readonly pendingSponsor: Option<AccountId32>;2284 readonly limits: Option<UpDataStructsCollectionLimits>;2285 readonly permissions: Option<UpDataStructsCollectionPermissions>;2286 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2287 readonly properties: Vec<UpDataStructsProperty>;2288 }22892290 /** @name UpDataStructsAccessMode (231) */2291 interface UpDataStructsAccessMode extends Enum {2292 readonly isNormal: boolean;2293 readonly isAllowList: boolean;2294 readonly type: 'Normal' | 'AllowList';2295 }22962297 /** @name UpDataStructsCollectionLimits (233) */2298 interface UpDataStructsCollectionLimits extends Struct {2299 readonly accountTokenOwnershipLimit: Option<u32>;2300 readonly sponsoredDataSize: Option<u32>;2301 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2302 readonly tokenLimit: Option<u32>;2303 readonly sponsorTransferTimeout: Option<u32>;2304 readonly sponsorApproveTimeout: Option<u32>;2305 readonly ownerCanTransfer: Option<bool>;2306 readonly ownerCanDestroy: Option<bool>;2307 readonly transfersEnabled: Option<bool>;2308 }23092310 /** @name UpDataStructsSponsoringRateLimit (235) */2311 interface UpDataStructsSponsoringRateLimit extends Enum {2312 readonly isSponsoringDisabled: boolean;2313 readonly isBlocks: boolean;2314 readonly asBlocks: u32;2315 readonly type: 'SponsoringDisabled' | 'Blocks';2316 }23172318 /** @name UpDataStructsCollectionPermissions (238) */2319 interface UpDataStructsCollectionPermissions extends Struct {2320 readonly access: Option<UpDataStructsAccessMode>;2321 readonly mintMode: Option<bool>;2322 readonly nesting: Option<UpDataStructsNestingPermissions>;2323 }23242325 /** @name UpDataStructsNestingPermissions (240) */2326 interface UpDataStructsNestingPermissions extends Struct {2327 readonly tokenOwner: bool;2328 readonly collectionAdmin: bool;2329 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2330 }23312332 /** @name UpDataStructsOwnerRestrictedSet (242) */2333 interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}23342335 /** @name UpDataStructsPropertyKeyPermission (247) */2336 interface UpDataStructsPropertyKeyPermission extends Struct {2337 readonly key: Bytes;2338 readonly permission: UpDataStructsPropertyPermission;2339 }23402341 /** @name UpDataStructsPropertyPermission (248) */2342 interface UpDataStructsPropertyPermission extends Struct {2343 readonly mutable: bool;2344 readonly collectionAdmin: bool;2345 readonly tokenOwner: bool;2346 }23472348 /** @name UpDataStructsProperty (251) */2349 interface UpDataStructsProperty extends Struct {2350 readonly key: Bytes;2351 readonly value: Bytes;2352 }23532354 /** @name UpDataStructsCreateItemData (254) */2355 interface UpDataStructsCreateItemData extends Enum {2356 readonly isNft: boolean;2357 readonly asNft: UpDataStructsCreateNftData;2358 readonly isFungible: boolean;2359 readonly asFungible: UpDataStructsCreateFungibleData;2360 readonly isReFungible: boolean;2361 readonly asReFungible: UpDataStructsCreateReFungibleData;2362 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2363 }23642365 /** @name UpDataStructsCreateNftData (255) */2366 interface UpDataStructsCreateNftData extends Struct {2367 readonly properties: Vec<UpDataStructsProperty>;2368 }23692370 /** @name UpDataStructsCreateFungibleData (256) */2371 interface UpDataStructsCreateFungibleData extends Struct {2372 readonly value: u128;2373 }23742375 /** @name UpDataStructsCreateReFungibleData (257) */2376 interface UpDataStructsCreateReFungibleData extends Struct {2377 readonly pieces: u128;2378 readonly properties: Vec<UpDataStructsProperty>;2379 }23802381 /** @name UpDataStructsCreateItemExData (260) */2382 interface UpDataStructsCreateItemExData extends Enum {2383 readonly isNft: boolean;2384 readonly asNft: Vec<UpDataStructsCreateNftExData>;2385 readonly isFungible: boolean;2386 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2387 readonly isRefungibleMultipleItems: boolean;2388 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2389 readonly isRefungibleMultipleOwners: boolean;2390 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2391 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2392 }23932394 /** @name UpDataStructsCreateNftExData (262) */2395 interface UpDataStructsCreateNftExData extends Struct {2396 readonly properties: Vec<UpDataStructsProperty>;2397 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2398 }23992400 /** @name UpDataStructsCreateRefungibleExSingleOwner (269) */2401 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2402 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2403 readonly pieces: u128;2404 readonly properties: Vec<UpDataStructsProperty>;2405 }24062407 /** @name UpDataStructsCreateRefungibleExMultipleOwners (271) */2408 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2409 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2410 readonly properties: Vec<UpDataStructsProperty>;2411 }24122413 /** @name PalletUniqueSchedulerCall (272) */2414 interface PalletUniqueSchedulerCall extends Enum {2415 readonly isScheduleNamed: boolean;2416 readonly asScheduleNamed: {2417 readonly id: U8aFixed;2418 readonly when: u32;2419 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2420 readonly priority: u8;2421 readonly call: FrameSupportScheduleMaybeHashed;2422 } & Struct;2423 readonly isCancelNamed: boolean;2424 readonly asCancelNamed: {2425 readonly id: U8aFixed;2426 } & Struct;2427 readonly isScheduleNamedAfter: boolean;2428 readonly asScheduleNamedAfter: {2429 readonly id: U8aFixed;2430 readonly after: u32;2431 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2432 readonly priority: u8;2433 readonly call: FrameSupportScheduleMaybeHashed;2434 } & Struct;2435 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';2436 }24372438 /** @name FrameSupportScheduleMaybeHashed (274) */2439 interface FrameSupportScheduleMaybeHashed extends Enum {2440 readonly isValue: boolean;2441 readonly asValue: Call;2442 readonly isHash: boolean;2443 readonly asHash: H256;2444 readonly type: 'Value' | 'Hash';2445 }24462447 /** @name PalletConfigurationCall (275) */2448 interface PalletConfigurationCall extends Enum {2449 readonly isSetWeightToFeeCoefficientOverride: boolean;2450 readonly asSetWeightToFeeCoefficientOverride: {2451 readonly coeff: Option<u32>;2452 } & Struct;2453 readonly isSetMinGasPriceOverride: boolean;2454 readonly asSetMinGasPriceOverride: {2455 readonly coeff: Option<u64>;2456 } & Struct;2457 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';2458 }24592460 /** @name PalletTemplateTransactionPaymentCall (276) */2461 type PalletTemplateTransactionPaymentCall = Null;24622463 /** @name PalletStructureCall (277) */2464 type PalletStructureCall = Null;24652466 /** @name PalletRmrkCoreCall (278) */2467 interface PalletRmrkCoreCall extends Enum {2468 readonly isCreateCollection: boolean;2469 readonly asCreateCollection: {2470 readonly metadata: Bytes;2471 readonly max: Option<u32>;2472 readonly symbol: Bytes;2473 } & Struct;2474 readonly isDestroyCollection: boolean;2475 readonly asDestroyCollection: {2476 readonly collectionId: u32;2477 } & Struct;2478 readonly isChangeCollectionIssuer: boolean;2479 readonly asChangeCollectionIssuer: {2480 readonly collectionId: u32;2481 readonly newIssuer: MultiAddress;2482 } & Struct;2483 readonly isLockCollection: boolean;2484 readonly asLockCollection: {2485 readonly collectionId: u32;2486 } & Struct;2487 readonly isMintNft: boolean;2488 readonly asMintNft: {2489 readonly owner: Option<AccountId32>;2490 readonly collectionId: u32;2491 readonly recipient: Option<AccountId32>;2492 readonly royaltyAmount: Option<Permill>;2493 readonly metadata: Bytes;2494 readonly transferable: bool;2495 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;2496 } & Struct;2497 readonly isBurnNft: boolean;2498 readonly asBurnNft: {2499 readonly collectionId: u32;2500 readonly nftId: u32;2501 readonly maxBurns: u32;2502 } & Struct;2503 readonly isSend: boolean;2504 readonly asSend: {2505 readonly rmrkCollectionId: u32;2506 readonly rmrkNftId: u32;2507 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2508 } & Struct;2509 readonly isAcceptNft: boolean;2510 readonly asAcceptNft: {2511 readonly rmrkCollectionId: u32;2512 readonly rmrkNftId: u32;2513 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2514 } & Struct;2515 readonly isRejectNft: boolean;2516 readonly asRejectNft: {2517 readonly rmrkCollectionId: u32;2518 readonly rmrkNftId: u32;2519 } & Struct;2520 readonly isAcceptResource: boolean;2521 readonly asAcceptResource: {2522 readonly rmrkCollectionId: u32;2523 readonly rmrkNftId: u32;2524 readonly resourceId: u32;2525 } & Struct;2526 readonly isAcceptResourceRemoval: boolean;2527 readonly asAcceptResourceRemoval: {2528 readonly rmrkCollectionId: u32;2529 readonly rmrkNftId: u32;2530 readonly resourceId: u32;2531 } & Struct;2532 readonly isSetProperty: boolean;2533 readonly asSetProperty: {2534 readonly rmrkCollectionId: Compact<u32>;2535 readonly maybeNftId: Option<u32>;2536 readonly key: Bytes;2537 readonly value: Bytes;2538 } & Struct;2539 readonly isSetPriority: boolean;2540 readonly asSetPriority: {2541 readonly rmrkCollectionId: u32;2542 readonly rmrkNftId: u32;2543 readonly priorities: Vec<u32>;2544 } & Struct;2545 readonly isAddBasicResource: boolean;2546 readonly asAddBasicResource: {2547 readonly rmrkCollectionId: u32;2548 readonly nftId: u32;2549 readonly resource: RmrkTraitsResourceBasicResource;2550 } & Struct;2551 readonly isAddComposableResource: boolean;2552 readonly asAddComposableResource: {2553 readonly rmrkCollectionId: u32;2554 readonly nftId: u32;2555 readonly resource: RmrkTraitsResourceComposableResource;2556 } & Struct;2557 readonly isAddSlotResource: boolean;2558 readonly asAddSlotResource: {2559 readonly rmrkCollectionId: u32;2560 readonly nftId: u32;2561 readonly resource: RmrkTraitsResourceSlotResource;2562 } & Struct;2563 readonly isRemoveResource: boolean;2564 readonly asRemoveResource: {2565 readonly rmrkCollectionId: u32;2566 readonly nftId: u32;2567 readonly resourceId: u32;2568 } & Struct;2569 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';2570 }25712572 /** @name RmrkTraitsResourceResourceTypes (284) */2573 interface RmrkTraitsResourceResourceTypes extends Enum {2574 readonly isBasic: boolean;2575 readonly asBasic: RmrkTraitsResourceBasicResource;2576 readonly isComposable: boolean;2577 readonly asComposable: RmrkTraitsResourceComposableResource;2578 readonly isSlot: boolean;2579 readonly asSlot: RmrkTraitsResourceSlotResource;2580 readonly type: 'Basic' | 'Composable' | 'Slot';2581 }25822583 /** @name RmrkTraitsResourceBasicResource (286) */2584 interface RmrkTraitsResourceBasicResource extends Struct {2585 readonly src: Option<Bytes>;2586 readonly metadata: Option<Bytes>;2587 readonly license: Option<Bytes>;2588 readonly thumb: Option<Bytes>;2589 }25902591 /** @name RmrkTraitsResourceComposableResource (288) */2592 interface RmrkTraitsResourceComposableResource extends Struct {2593 readonly parts: Vec<u32>;2594 readonly base: u32;2595 readonly src: Option<Bytes>;2596 readonly metadata: Option<Bytes>;2597 readonly license: Option<Bytes>;2598 readonly thumb: Option<Bytes>;2599 }26002601 /** @name RmrkTraitsResourceSlotResource (289) */2602 interface RmrkTraitsResourceSlotResource extends Struct {2603 readonly base: u32;2604 readonly src: Option<Bytes>;2605 readonly metadata: Option<Bytes>;2606 readonly slot: u32;2607 readonly license: Option<Bytes>;2608 readonly thumb: Option<Bytes>;2609 }26102611 /** @name PalletRmrkEquipCall (292) */2612 interface PalletRmrkEquipCall extends Enum {2613 readonly isCreateBase: boolean;2614 readonly asCreateBase: {2615 readonly baseType: Bytes;2616 readonly symbol: Bytes;2617 readonly parts: Vec<RmrkTraitsPartPartType>;2618 } & Struct;2619 readonly isThemeAdd: boolean;2620 readonly asThemeAdd: {2621 readonly baseId: u32;2622 readonly theme: RmrkTraitsTheme;2623 } & Struct;2624 readonly isEquippable: boolean;2625 readonly asEquippable: {2626 readonly baseId: u32;2627 readonly slotId: u32;2628 readonly equippables: RmrkTraitsPartEquippableList;2629 } & Struct;2630 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';2631 }26322633 /** @name RmrkTraitsPartPartType (295) */2634 interface RmrkTraitsPartPartType extends Enum {2635 readonly isFixedPart: boolean;2636 readonly asFixedPart: RmrkTraitsPartFixedPart;2637 readonly isSlotPart: boolean;2638 readonly asSlotPart: RmrkTraitsPartSlotPart;2639 readonly type: 'FixedPart' | 'SlotPart';2640 }26412642 /** @name RmrkTraitsPartFixedPart (297) */2643 interface RmrkTraitsPartFixedPart extends Struct {2644 readonly id: u32;2645 readonly z: u32;2646 readonly src: Bytes;2647 }26482649 /** @name RmrkTraitsPartSlotPart (298) */2650 interface RmrkTraitsPartSlotPart extends Struct {2651 readonly id: u32;2652 readonly equippable: RmrkTraitsPartEquippableList;2653 readonly src: Bytes;2654 readonly z: u32;2655 }26562657 /** @name RmrkTraitsPartEquippableList (299) */2658 interface RmrkTraitsPartEquippableList extends Enum {2659 readonly isAll: boolean;2660 readonly isEmpty: boolean;2661 readonly isCustom: boolean;2662 readonly asCustom: Vec<u32>;2663 readonly type: 'All' | 'Empty' | 'Custom';2664 }26652666 /** @name RmrkTraitsTheme (301) */2667 interface RmrkTraitsTheme extends Struct {2668 readonly name: Bytes;2669 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2670 readonly inherit: bool;2671 }26722673 /** @name RmrkTraitsThemeThemeProperty (303) */2674 interface RmrkTraitsThemeThemeProperty extends Struct {2675 readonly key: Bytes;2676 readonly value: Bytes;2677 }26782679 /** @name PalletAppPromotionCall (305) */2680 interface PalletAppPromotionCall extends Enum {2681 readonly isSetAdminAddress: boolean;2682 readonly asSetAdminAddress: {2683 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;2684 } & Struct;2685 readonly isStake: boolean;2686 readonly asStake: {2687 readonly amount: u128;2688 } & Struct;2689 readonly isUnstake: boolean;2690 readonly isSponsorCollection: boolean;2691 readonly asSponsorCollection: {2692 readonly collectionId: u32;2693 } & Struct;2694 readonly isStopSponsoringCollection: boolean;2695 readonly asStopSponsoringCollection: {2696 readonly collectionId: u32;2697 } & Struct;2698 readonly isSponsorContract: boolean;2699 readonly asSponsorContract: {2700 readonly contractId: H160;2701 } & Struct;2702 readonly isStopSponsoringContract: boolean;2703 readonly asStopSponsoringContract: {2704 readonly contractId: H160;2705 } & Struct;2706 readonly isPayoutStakers: boolean;2707 readonly asPayoutStakers: {2708 readonly stakersNumber: Option<u8>;2709 } & Struct;2710 readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';2711 }27122713 /** @name PalletEvmCall (307) */2714 interface PalletEvmCall extends Enum {2715 readonly isWithdraw: boolean;2716 readonly asWithdraw: {2717 readonly address: H160;2718 readonly value: u128;2719 } & Struct;2720 readonly isCall: boolean;2721 readonly asCall: {2722 readonly source: H160;2723 readonly target: H160;2724 readonly input: Bytes;2725 readonly value: U256;2726 readonly gasLimit: u64;2727 readonly maxFeePerGas: U256;2728 readonly maxPriorityFeePerGas: Option<U256>;2729 readonly nonce: Option<U256>;2730 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2731 } & Struct;2732 readonly isCreate: boolean;2733 readonly asCreate: {2734 readonly source: H160;2735 readonly init: Bytes;2736 readonly value: U256;2737 readonly gasLimit: u64;2738 readonly maxFeePerGas: U256;2739 readonly maxPriorityFeePerGas: Option<U256>;2740 readonly nonce: Option<U256>;2741 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2742 } & Struct;2743 readonly isCreate2: boolean;2744 readonly asCreate2: {2745 readonly source: H160;2746 readonly init: Bytes;2747 readonly salt: H256;2748 readonly value: U256;2749 readonly gasLimit: u64;2750 readonly maxFeePerGas: U256;2751 readonly maxPriorityFeePerGas: Option<U256>;2752 readonly nonce: Option<U256>;2753 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2754 } & Struct;2755 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';2756 }27572758 /** @name PalletEthereumCall (311) */2759 interface PalletEthereumCall extends Enum {2760 readonly isTransact: boolean;2761 readonly asTransact: {2762 readonly transaction: EthereumTransactionTransactionV2;2763 } & Struct;2764 readonly type: 'Transact';2765 }27662767 /** @name EthereumTransactionTransactionV2 (312) */2768 interface EthereumTransactionTransactionV2 extends Enum {2769 readonly isLegacy: boolean;2770 readonly asLegacy: EthereumTransactionLegacyTransaction;2771 readonly isEip2930: boolean;2772 readonly asEip2930: EthereumTransactionEip2930Transaction;2773 readonly isEip1559: boolean;2774 readonly asEip1559: EthereumTransactionEip1559Transaction;2775 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';2776 }27772778 /** @name EthereumTransactionLegacyTransaction (313) */2779 interface EthereumTransactionLegacyTransaction extends Struct {2780 readonly nonce: U256;2781 readonly gasPrice: U256;2782 readonly gasLimit: U256;2783 readonly action: EthereumTransactionTransactionAction;2784 readonly value: U256;2785 readonly input: Bytes;2786 readonly signature: EthereumTransactionTransactionSignature;2787 }27882789 /** @name EthereumTransactionTransactionAction (314) */2790 interface EthereumTransactionTransactionAction extends Enum {2791 readonly isCall: boolean;2792 readonly asCall: H160;2793 readonly isCreate: boolean;2794 readonly type: 'Call' | 'Create';2795 }27962797 /** @name EthereumTransactionTransactionSignature (315) */2798 interface EthereumTransactionTransactionSignature extends Struct {2799 readonly v: u64;2800 readonly r: H256;2801 readonly s: H256;2802 }28032804 /** @name EthereumTransactionEip2930Transaction (317) */2805 interface EthereumTransactionEip2930Transaction extends Struct {2806 readonly chainId: u64;2807 readonly nonce: U256;2808 readonly gasPrice: U256;2809 readonly gasLimit: U256;2810 readonly action: EthereumTransactionTransactionAction;2811 readonly value: U256;2812 readonly input: Bytes;2813 readonly accessList: Vec<EthereumTransactionAccessListItem>;2814 readonly oddYParity: bool;2815 readonly r: H256;2816 readonly s: H256;2817 }28182819 /** @name EthereumTransactionAccessListItem (319) */2820 interface EthereumTransactionAccessListItem extends Struct {2821 readonly address: H160;2822 readonly storageKeys: Vec<H256>;2823 }28242825 /** @name EthereumTransactionEip1559Transaction (320) */2826 interface EthereumTransactionEip1559Transaction extends Struct {2827 readonly chainId: u64;2828 readonly nonce: U256;2829 readonly maxPriorityFeePerGas: U256;2830 readonly maxFeePerGas: U256;2831 readonly gasLimit: U256;2832 readonly action: EthereumTransactionTransactionAction;2833 readonly value: U256;2834 readonly input: Bytes;2835 readonly accessList: Vec<EthereumTransactionAccessListItem>;2836 readonly oddYParity: bool;2837 readonly r: H256;2838 readonly s: H256;2839 }28402841 /** @name PalletEvmMigrationCall (321) */2842 interface PalletEvmMigrationCall extends Enum {2843 readonly isBegin: boolean;2844 readonly asBegin: {2845 readonly address: H160;2846 } & Struct;2847 readonly isSetData: boolean;2848 readonly asSetData: {2849 readonly address: H160;2850 readonly data: Vec<ITuple<[H256, H256]>>;2851 } & Struct;2852 readonly isFinish: boolean;2853 readonly asFinish: {2854 readonly address: H160;2855 readonly code: Bytes;2856 } & Struct;2857 readonly type: 'Begin' | 'SetData' | 'Finish';2858 }28592860 /** @name PalletSudoError (324) */2861 interface PalletSudoError extends Enum {2862 readonly isRequireSudo: boolean;2863 readonly type: 'RequireSudo';2864 }28652866 /** @name OrmlVestingModuleError (326) */2867 interface OrmlVestingModuleError extends Enum {2868 readonly isZeroVestingPeriod: boolean;2869 readonly isZeroVestingPeriodCount: boolean;2870 readonly isInsufficientBalanceToLock: boolean;2871 readonly isTooManyVestingSchedules: boolean;2872 readonly isAmountLow: boolean;2873 readonly isMaxVestingSchedulesExceeded: boolean;2874 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';2875 }28762877 /** @name CumulusPalletXcmpQueueInboundChannelDetails (328) */2878 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {2879 readonly sender: u32;2880 readonly state: CumulusPalletXcmpQueueInboundState;2881 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;2882 }28832884 /** @name CumulusPalletXcmpQueueInboundState (329) */2885 interface CumulusPalletXcmpQueueInboundState extends Enum {2886 readonly isOk: boolean;2887 readonly isSuspended: boolean;2888 readonly type: 'Ok' | 'Suspended';2889 }28902891 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (332) */2892 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2893 readonly isConcatenatedVersionedXcm: boolean;2894 readonly isConcatenatedEncodedBlob: boolean;2895 readonly isSignals: boolean;2896 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2897 }28982899 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (335) */2900 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {2901 readonly recipient: u32;2902 readonly state: CumulusPalletXcmpQueueOutboundState;2903 readonly signalsExist: bool;2904 readonly firstIndex: u16;2905 readonly lastIndex: u16;2906 }29072908 /** @name CumulusPalletXcmpQueueOutboundState (336) */2909 interface CumulusPalletXcmpQueueOutboundState extends Enum {2910 readonly isOk: boolean;2911 readonly isSuspended: boolean;2912 readonly type: 'Ok' | 'Suspended';2913 }29142915 /** @name CumulusPalletXcmpQueueQueueConfigData (338) */2916 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {2917 readonly suspendThreshold: u32;2918 readonly dropThreshold: u32;2919 readonly resumeThreshold: u32;2920 readonly thresholdWeight: u64;2921 readonly weightRestrictDecay: u64;2922 readonly xcmpMaxIndividualWeight: u64;2923 }29242925 /** @name CumulusPalletXcmpQueueError (340) */2926 interface CumulusPalletXcmpQueueError extends Enum {2927 readonly isFailedToSend: boolean;2928 readonly isBadXcmOrigin: boolean;2929 readonly isBadXcm: boolean;2930 readonly isBadOverweightIndex: boolean;2931 readonly isWeightOverLimit: boolean;2932 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';2933 }29342935 /** @name PalletXcmError (341) */2936 interface PalletXcmError extends Enum {2937 readonly isUnreachable: boolean;2938 readonly isSendFailure: boolean;2939 readonly isFiltered: boolean;2940 readonly isUnweighableMessage: boolean;2941 readonly isDestinationNotInvertible: boolean;2942 readonly isEmpty: boolean;2943 readonly isCannotReanchor: boolean;2944 readonly isTooManyAssets: boolean;2945 readonly isInvalidOrigin: boolean;2946 readonly isBadVersion: boolean;2947 readonly isBadLocation: boolean;2948 readonly isNoSubscription: boolean;2949 readonly isAlreadySubscribed: boolean;2950 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';2951 }29522953 /** @name CumulusPalletXcmError (342) */2954 type CumulusPalletXcmError = Null;29552956 /** @name CumulusPalletDmpQueueConfigData (343) */2957 interface CumulusPalletDmpQueueConfigData extends Struct {2958 readonly maxIndividual: u64;2959 }29602961 /** @name CumulusPalletDmpQueuePageIndexData (344) */2962 interface CumulusPalletDmpQueuePageIndexData extends Struct {2963 readonly beginUsed: u32;2964 readonly endUsed: u32;2965 readonly overweightCount: u64;2966 }29672968 /** @name CumulusPalletDmpQueueError (347) */2969 interface CumulusPalletDmpQueueError extends Enum {2970 readonly isUnknown: boolean;2971 readonly isOverLimit: boolean;2972 readonly type: 'Unknown' | 'OverLimit';2973 }29742975 /** @name PalletUniqueError (351) */2976 interface PalletUniqueError extends Enum {2977 readonly isCollectionDecimalPointLimitExceeded: boolean;2978 readonly isConfirmUnsetSponsorFail: boolean;2979 readonly isEmptyArgument: boolean;2980 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;2981 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';2982 }29832984 /** @name PalletUniqueSchedulerScheduledV3 (354) */2985 interface PalletUniqueSchedulerScheduledV3 extends Struct {2986 readonly maybeId: Option<U8aFixed>;2987 readonly priority: u8;2988 readonly call: FrameSupportScheduleMaybeHashed;2989 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2990 readonly origin: OpalRuntimeOriginCaller;2991 }29922993 /** @name OpalRuntimeOriginCaller (355) */2994 interface OpalRuntimeOriginCaller extends Enum {2995 readonly isSystem: boolean;2996 readonly asSystem: FrameSupportDispatchRawOrigin;2997 readonly isVoid: boolean;2998 readonly isPolkadotXcm: boolean;2999 readonly asPolkadotXcm: PalletXcmOrigin;3000 readonly isCumulusXcm: boolean;3001 readonly asCumulusXcm: CumulusPalletXcmOrigin;3002 readonly isEthereum: boolean;3003 readonly asEthereum: PalletEthereumRawOrigin;3004 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';3005 }30063007 /** @name FrameSupportDispatchRawOrigin (356) */3008 interface FrameSupportDispatchRawOrigin extends Enum {3009 readonly isRoot: boolean;3010 readonly isSigned: boolean;3011 readonly asSigned: AccountId32;3012 readonly isNone: boolean;3013 readonly type: 'Root' | 'Signed' | 'None';3014 }30153016 /** @name PalletXcmOrigin (357) */3017 interface PalletXcmOrigin extends Enum {3018 readonly isXcm: boolean;3019 readonly asXcm: XcmV1MultiLocation;3020 readonly isResponse: boolean;3021 readonly asResponse: XcmV1MultiLocation;3022 readonly type: 'Xcm' | 'Response';3023 }30243025 /** @name CumulusPalletXcmOrigin (358) */3026 interface CumulusPalletXcmOrigin extends Enum {3027 readonly isRelay: boolean;3028 readonly isSiblingParachain: boolean;3029 readonly asSiblingParachain: u32;3030 readonly type: 'Relay' | 'SiblingParachain';3031 }30323033 /** @name PalletEthereumRawOrigin (359) */3034 interface PalletEthereumRawOrigin extends Enum {3035 readonly isEthereumTransaction: boolean;3036 readonly asEthereumTransaction: H160;3037 readonly type: 'EthereumTransaction';3038 }30393040 /** @name SpCoreVoid (360) */3041 type SpCoreVoid = Null;30423043 /** @name PalletUniqueSchedulerError (361) */3044 interface PalletUniqueSchedulerError extends Enum {3045 readonly isFailedToSchedule: boolean;3046 readonly isNotFound: boolean;3047 readonly isTargetBlockNumberInPast: boolean;3048 readonly isRescheduleNoChange: boolean;3049 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';3050 }30513052 /** @name UpDataStructsCollection (362) */3053 interface UpDataStructsCollection extends Struct {3054 readonly owner: AccountId32;3055 readonly mode: UpDataStructsCollectionMode;3056 readonly name: Vec<u16>;3057 readonly description: Vec<u16>;3058 readonly tokenPrefix: Bytes;3059 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3060 readonly limits: UpDataStructsCollectionLimits;3061 readonly permissions: UpDataStructsCollectionPermissions;3062 readonly externalCollection: bool;3063 }30643065 /** @name UpDataStructsSponsorshipStateAccountId32 (363) */3066 interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3067 readonly isDisabled: boolean;3068 readonly isUnconfirmed: boolean;3069 readonly asUnconfirmed: AccountId32;3070 readonly isConfirmed: boolean;3071 readonly asConfirmed: AccountId32;3072 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3073 }30743075 /** @name UpDataStructsProperties (364) */3076 interface UpDataStructsProperties extends Struct {3077 readonly map: UpDataStructsPropertiesMapBoundedVec;3078 readonly consumedSpace: u32;3079 readonly spaceLimit: u32;3080 }30813082 /** @name UpDataStructsPropertiesMapBoundedVec (365) */3083 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}30843085 /** @name UpDataStructsPropertiesMapPropertyPermission (370) */3086 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}30873088 /** @name UpDataStructsCollectionStats (377) */3089 interface UpDataStructsCollectionStats extends Struct {3090 readonly created: u32;3091 readonly destroyed: u32;3092 readonly alive: u32;3093 }30943095 /** @name UpDataStructsTokenChild (378) */3096 interface UpDataStructsTokenChild extends Struct {3097 readonly token: u32;3098 readonly collection: u32;3099 }31003101 /** @name PhantomTypeUpDataStructs (379) */3102 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}31033104 /** @name UpDataStructsTokenData (381) */3105 interface UpDataStructsTokenData extends Struct {3106 readonly properties: Vec<UpDataStructsProperty>;3107 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3108 readonly pieces: u128;3109 }31103111 /** @name UpDataStructsRpcCollection (383) */3112 interface UpDataStructsRpcCollection extends Struct {3113 readonly owner: AccountId32;3114 readonly mode: UpDataStructsCollectionMode;3115 readonly name: Vec<u16>;3116 readonly description: Vec<u16>;3117 readonly tokenPrefix: Bytes;3118 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3119 readonly limits: UpDataStructsCollectionLimits;3120 readonly permissions: UpDataStructsCollectionPermissions;3121 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3122 readonly properties: Vec<UpDataStructsProperty>;3123 readonly readOnly: bool;3124 }31253126 /** @name RmrkTraitsCollectionCollectionInfo (384) */3127 interface RmrkTraitsCollectionCollectionInfo extends Struct {3128 readonly issuer: AccountId32;3129 readonly metadata: Bytes;3130 readonly max: Option<u32>;3131 readonly symbol: Bytes;3132 readonly nftsCount: u32;3133 }31343135 /** @name RmrkTraitsNftNftInfo (385) */3136 interface RmrkTraitsNftNftInfo extends Struct {3137 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;3138 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;3139 readonly metadata: Bytes;3140 readonly equipped: bool;3141 readonly pending: bool;3142 }31433144 /** @name RmrkTraitsNftRoyaltyInfo (387) */3145 interface RmrkTraitsNftRoyaltyInfo extends Struct {3146 readonly recipient: AccountId32;3147 readonly amount: Permill;3148 }31493150 /** @name RmrkTraitsResourceResourceInfo (388) */3151 interface RmrkTraitsResourceResourceInfo extends Struct {3152 readonly id: u32;3153 readonly resource: RmrkTraitsResourceResourceTypes;3154 readonly pending: bool;3155 readonly pendingRemoval: bool;3156 }31573158 /** @name RmrkTraitsPropertyPropertyInfo (389) */3159 interface RmrkTraitsPropertyPropertyInfo extends Struct {3160 readonly key: Bytes;3161 readonly value: Bytes;3162 }31633164 /** @name RmrkTraitsBaseBaseInfo (390) */3165 interface RmrkTraitsBaseBaseInfo extends Struct {3166 readonly issuer: AccountId32;3167 readonly baseType: Bytes;3168 readonly symbol: Bytes;3169 }31703171 /** @name RmrkTraitsNftNftChild (391) */3172 interface RmrkTraitsNftNftChild extends Struct {3173 readonly collectionId: u32;3174 readonly nftId: u32;3175 }31763177 /** @name PalletCommonError (393) */3178 interface PalletCommonError extends Enum {3179 readonly isCollectionNotFound: boolean;3180 readonly isMustBeTokenOwner: boolean;3181 readonly isNoPermission: boolean;3182 readonly isCantDestroyNotEmptyCollection: boolean;3183 readonly isPublicMintingNotAllowed: boolean;3184 readonly isAddressNotInAllowlist: boolean;3185 readonly isCollectionNameLimitExceeded: boolean;3186 readonly isCollectionDescriptionLimitExceeded: boolean;3187 readonly isCollectionTokenPrefixLimitExceeded: boolean;3188 readonly isTotalCollectionsLimitExceeded: boolean;3189 readonly isCollectionAdminCountExceeded: boolean;3190 readonly isCollectionLimitBoundsExceeded: boolean;3191 readonly isOwnerPermissionsCantBeReverted: boolean;3192 readonly isTransferNotAllowed: boolean;3193 readonly isAccountTokenLimitExceeded: boolean;3194 readonly isCollectionTokenLimitExceeded: boolean;3195 readonly isMetadataFlagFrozen: boolean;3196 readonly isTokenNotFound: boolean;3197 readonly isTokenValueTooLow: boolean;3198 readonly isApprovedValueTooLow: boolean;3199 readonly isCantApproveMoreThanOwned: boolean;3200 readonly isAddressIsZero: boolean;3201 readonly isUnsupportedOperation: boolean;3202 readonly isNotSufficientFounds: boolean;3203 readonly isUserIsNotAllowedToNest: boolean;3204 readonly isSourceCollectionIsNotAllowedToNest: boolean;3205 readonly isCollectionFieldSizeExceeded: boolean;3206 readonly isNoSpaceForProperty: boolean;3207 readonly isPropertyLimitReached: boolean;3208 readonly isPropertyKeyIsTooLong: boolean;3209 readonly isInvalidCharacterInPropertyKey: boolean;3210 readonly isEmptyPropertyKey: boolean;3211 readonly isCollectionIsExternal: boolean;3212 readonly isCollectionIsInternal: boolean;3213 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';3214 }32153216 /** @name PalletFungibleError (395) */3217 interface PalletFungibleError extends Enum {3218 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;3219 readonly isFungibleItemsHaveNoId: boolean;3220 readonly isFungibleItemsDontHaveData: boolean;3221 readonly isFungibleDisallowsNesting: boolean;3222 readonly isSettingPropertiesNotAllowed: boolean;3223 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3224 }32253226 /** @name PalletRefungibleItemData (396) */3227 interface PalletRefungibleItemData extends Struct {3228 readonly constData: Bytes;3229 }32303231 /** @name PalletRefungibleError (401) */3232 interface PalletRefungibleError extends Enum {3233 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;3234 readonly isWrongRefungiblePieces: boolean;3235 readonly isRepartitionWhileNotOwningAllPieces: boolean;3236 readonly isRefungibleDisallowsNesting: boolean;3237 readonly isSettingPropertiesNotAllowed: boolean;3238 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3239 }32403241 /** @name PalletNonfungibleItemData (402) */3242 interface PalletNonfungibleItemData extends Struct {3243 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3244 }32453246 /** @name UpDataStructsPropertyScope (404) */3247 interface UpDataStructsPropertyScope extends Enum {3248 readonly isNone: boolean;3249 readonly isRmrk: boolean;3250 readonly type: 'None' | 'Rmrk';3251 }32523253 /** @name PalletNonfungibleError (406) */3254 interface PalletNonfungibleError extends Enum {3255 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;3256 readonly isNonfungibleItemsHaveNoAmount: boolean;3257 readonly isCantBurnNftWithChildren: boolean;3258 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';3259 }32603261 /** @name PalletStructureError (407) */3262 interface PalletStructureError extends Enum {3263 readonly isOuroborosDetected: boolean;3264 readonly isDepthLimit: boolean;3265 readonly isBreadthLimit: boolean;3266 readonly isTokenNotFound: boolean;3267 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';3268 }32693270 /** @name PalletRmrkCoreError (408) */3271 interface PalletRmrkCoreError extends Enum {3272 readonly isCorruptedCollectionType: boolean;3273 readonly isRmrkPropertyKeyIsTooLong: boolean;3274 readonly isRmrkPropertyValueIsTooLong: boolean;3275 readonly isRmrkPropertyIsNotFound: boolean;3276 readonly isUnableToDecodeRmrkData: boolean;3277 readonly isCollectionNotEmpty: boolean;3278 readonly isNoAvailableCollectionId: boolean;3279 readonly isNoAvailableNftId: boolean;3280 readonly isCollectionUnknown: boolean;3281 readonly isNoPermission: boolean;3282 readonly isNonTransferable: boolean;3283 readonly isCollectionFullOrLocked: boolean;3284 readonly isResourceDoesntExist: boolean;3285 readonly isCannotSendToDescendentOrSelf: boolean;3286 readonly isCannotAcceptNonOwnedNft: boolean;3287 readonly isCannotRejectNonOwnedNft: boolean;3288 readonly isCannotRejectNonPendingNft: boolean;3289 readonly isResourceNotPending: boolean;3290 readonly isNoAvailableResourceId: boolean;3291 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';3292 }32933294 /** @name PalletRmrkEquipError (410) */3295 interface PalletRmrkEquipError extends Enum {3296 readonly isPermissionError: boolean;3297 readonly isNoAvailableBaseId: boolean;3298 readonly isNoAvailablePartId: boolean;3299 readonly isBaseDoesntExist: boolean;3300 readonly isNeedsDefaultThemeFirst: boolean;3301 readonly isPartDoesntExist: boolean;3302 readonly isNoEquippableOnFixedPart: boolean;3303 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';3304 }33053306 /** @name PalletAppPromotionError (416) */3307 interface PalletAppPromotionError extends Enum {3308 readonly isAdminNotSet: boolean;3309 readonly isNoPermission: boolean;3310 readonly isNotSufficientFunds: boolean;3311 readonly isPendingForBlockOverflow: boolean;3312 readonly isSponsorNotSet: boolean;3313 readonly isIncorrectLockedBalanceOperation: boolean;3314 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';3315 }33163317 /** @name PalletEvmError (419) */3318 interface PalletEvmError extends Enum {3319 readonly isBalanceLow: boolean;3320 readonly isFeeOverflow: boolean;3321 readonly isPaymentOverflow: boolean;3322 readonly isWithdrawFailed: boolean;3323 readonly isGasPriceTooLow: boolean;3324 readonly isInvalidNonce: boolean;3325 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';3326 }33273328 /** @name FpRpcTransactionStatus (422) */3329 interface FpRpcTransactionStatus extends Struct {3330 readonly transactionHash: H256;3331 readonly transactionIndex: u32;3332 readonly from: H160;3333 readonly to: Option<H160>;3334 readonly contractAddress: Option<H160>;3335 readonly logs: Vec<EthereumLog>;3336 readonly logsBloom: EthbloomBloom;3337 }33383339 /** @name EthbloomBloom (424) */3340 interface EthbloomBloom extends U8aFixed {}33413342 /** @name EthereumReceiptReceiptV3 (426) */3343 interface EthereumReceiptReceiptV3 extends Enum {3344 readonly isLegacy: boolean;3345 readonly asLegacy: EthereumReceiptEip658ReceiptData;3346 readonly isEip2930: boolean;3347 readonly asEip2930: EthereumReceiptEip658ReceiptData;3348 readonly isEip1559: boolean;3349 readonly asEip1559: EthereumReceiptEip658ReceiptData;3350 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3351 }33523353 /** @name EthereumReceiptEip658ReceiptData (427) */3354 interface EthereumReceiptEip658ReceiptData extends Struct {3355 readonly statusCode: u8;3356 readonly usedGas: U256;3357 readonly logsBloom: EthbloomBloom;3358 readonly logs: Vec<EthereumLog>;3359 }33603361 /** @name EthereumBlock (428) */3362 interface EthereumBlock extends Struct {3363 readonly header: EthereumHeader;3364 readonly transactions: Vec<EthereumTransactionTransactionV2>;3365 readonly ommers: Vec<EthereumHeader>;3366 }33673368 /** @name EthereumHeader (429) */3369 interface EthereumHeader extends Struct {3370 readonly parentHash: H256;3371 readonly ommersHash: H256;3372 readonly beneficiary: H160;3373 readonly stateRoot: H256;3374 readonly transactionsRoot: H256;3375 readonly receiptsRoot: H256;3376 readonly logsBloom: EthbloomBloom;3377 readonly difficulty: U256;3378 readonly number: U256;3379 readonly gasLimit: U256;3380 readonly gasUsed: U256;3381 readonly timestamp: u64;3382 readonly extraData: Bytes;3383 readonly mixHash: H256;3384 readonly nonce: EthereumTypesHashH64;3385 }33863387 /** @name EthereumTypesHashH64 (430) */3388 interface EthereumTypesHashH64 extends U8aFixed {}33893390 /** @name PalletEthereumError (435) */3391 interface PalletEthereumError extends Enum {3392 readonly isInvalidSignature: boolean;3393 readonly isPreLogExists: boolean;3394 readonly type: 'InvalidSignature' | 'PreLogExists';3395 }33963397 /** @name PalletEvmCoderSubstrateError (436) */3398 interface PalletEvmCoderSubstrateError extends Enum {3399 readonly isOutOfGas: boolean;3400 readonly isOutOfFund: boolean;3401 readonly type: 'OutOfGas' | 'OutOfFund';3402 }34033404 /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (437) */3405 interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {3406 readonly isDisabled: boolean;3407 readonly isUnconfirmed: boolean;3408 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3409 readonly isConfirmed: boolean;3410 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3411 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3412 }34133414 /** @name PalletEvmContractHelpersSponsoringModeT (438) */3415 interface PalletEvmContractHelpersSponsoringModeT extends Enum {3416 readonly isDisabled: boolean;3417 readonly isAllowlisted: boolean;3418 readonly isGenerous: boolean;3419 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';3420 }34213422 /** @name PalletEvmContractHelpersError (440) */3423 interface PalletEvmContractHelpersError extends Enum {3424 readonly isNoPermission: boolean;3425 readonly isNoPendingSponsor: boolean;3426 readonly type: 'NoPermission' | 'NoPendingSponsor';3427 }34283429 /** @name PalletEvmMigrationError (441) */3430 interface PalletEvmMigrationError extends Enum {3431 readonly isAccountNotEmpty: boolean;3432 readonly isAccountIsNotMigrating: boolean;3433 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';3434 }34353436 /** @name SpRuntimeMultiSignature (443) */3437 interface SpRuntimeMultiSignature extends Enum {3438 readonly isEd25519: boolean;3439 readonly asEd25519: SpCoreEd25519Signature;3440 readonly isSr25519: boolean;3441 readonly asSr25519: SpCoreSr25519Signature;3442 readonly isEcdsa: boolean;3443 readonly asEcdsa: SpCoreEcdsaSignature;3444 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';3445 }34463447 /** @name SpCoreEd25519Signature (444) */3448 interface SpCoreEd25519Signature extends U8aFixed {}34493450 /** @name SpCoreSr25519Signature (446) */3451 interface SpCoreSr25519Signature extends U8aFixed {}34523453 /** @name SpCoreEcdsaSignature (447) */3454 interface SpCoreEcdsaSignature extends U8aFixed {}34553456 /** @name FrameSystemExtensionsCheckSpecVersion (450) */3457 type FrameSystemExtensionsCheckSpecVersion = Null;34583459 /** @name FrameSystemExtensionsCheckGenesis (451) */3460 type FrameSystemExtensionsCheckGenesis = Null;34613462 /** @name FrameSystemExtensionsCheckNonce (454) */3463 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}34643465 /** @name FrameSystemExtensionsCheckWeight (455) */3466 type FrameSystemExtensionsCheckWeight = Null;34673468 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (456) */3469 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}34703471 /** @name OpalRuntimeRuntime (457) */3472 type OpalRuntimeRuntime = Null;34733474 /** @name PalletEthereumFakeTransactionFinalizer (458) */3475 type PalletEthereumFakeTransactionFinalizer = Null;34763477} // declare module1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/types/lookup';78import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';9import type { ITuple } from '@polkadot/types-codec/types';10import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';11import type { Event } from '@polkadot/types/interfaces/system';1213declare module '@polkadot/types/lookup' {14 /** @name FrameSystemAccountInfo (3) */15 interface FrameSystemAccountInfo extends Struct {16 readonly nonce: u32;17 readonly consumers: u32;18 readonly providers: u32;19 readonly sufficients: u32;20 readonly data: PalletBalancesAccountData;21 }2223 /** @name PalletBalancesAccountData (5) */24 interface PalletBalancesAccountData extends Struct {25 readonly free: u128;26 readonly reserved: u128;27 readonly miscFrozen: u128;28 readonly feeFrozen: u128;29 }3031 /** @name FrameSupportWeightsPerDispatchClassU64 (7) */32 interface FrameSupportWeightsPerDispatchClassU64 extends Struct {33 readonly normal: u64;34 readonly operational: u64;35 readonly mandatory: u64;36 }3738 /** @name SpRuntimeDigest (11) */39 interface SpRuntimeDigest extends Struct {40 readonly logs: Vec<SpRuntimeDigestDigestItem>;41 }4243 /** @name SpRuntimeDigestDigestItem (13) */44 interface SpRuntimeDigestDigestItem extends Enum {45 readonly isOther: boolean;46 readonly asOther: Bytes;47 readonly isConsensus: boolean;48 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;49 readonly isSeal: boolean;50 readonly asSeal: ITuple<[U8aFixed, Bytes]>;51 readonly isPreRuntime: boolean;52 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;53 readonly isRuntimeEnvironmentUpdated: boolean;54 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';55 }5657 /** @name FrameSystemEventRecord (16) */58 interface FrameSystemEventRecord extends Struct {59 readonly phase: FrameSystemPhase;60 readonly event: Event;61 readonly topics: Vec<H256>;62 }6364 /** @name FrameSystemEvent (18) */65 interface FrameSystemEvent extends Enum {66 readonly isExtrinsicSuccess: boolean;67 readonly asExtrinsicSuccess: {68 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;69 } & Struct;70 readonly isExtrinsicFailed: boolean;71 readonly asExtrinsicFailed: {72 readonly dispatchError: SpRuntimeDispatchError;73 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;74 } & Struct;75 readonly isCodeUpdated: boolean;76 readonly isNewAccount: boolean;77 readonly asNewAccount: {78 readonly account: AccountId32;79 } & Struct;80 readonly isKilledAccount: boolean;81 readonly asKilledAccount: {82 readonly account: AccountId32;83 } & Struct;84 readonly isRemarked: boolean;85 readonly asRemarked: {86 readonly sender: AccountId32;87 readonly hash_: H256;88 } & Struct;89 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';90 }9192 /** @name FrameSupportWeightsDispatchInfo (19) */93 interface FrameSupportWeightsDispatchInfo extends Struct {94 readonly weight: u64;95 readonly class: FrameSupportWeightsDispatchClass;96 readonly paysFee: FrameSupportWeightsPays;97 }9899 /** @name FrameSupportWeightsDispatchClass (20) */100 interface FrameSupportWeightsDispatchClass extends Enum {101 readonly isNormal: boolean;102 readonly isOperational: boolean;103 readonly isMandatory: boolean;104 readonly type: 'Normal' | 'Operational' | 'Mandatory';105 }106107 /** @name FrameSupportWeightsPays (21) */108 interface FrameSupportWeightsPays extends Enum {109 readonly isYes: boolean;110 readonly isNo: boolean;111 readonly type: 'Yes' | 'No';112 }113114 /** @name SpRuntimeDispatchError (22) */115 interface SpRuntimeDispatchError extends Enum {116 readonly isOther: boolean;117 readonly isCannotLookup: boolean;118 readonly isBadOrigin: boolean;119 readonly isModule: boolean;120 readonly asModule: SpRuntimeModuleError;121 readonly isConsumerRemaining: boolean;122 readonly isNoProviders: boolean;123 readonly isTooManyConsumers: boolean;124 readonly isToken: boolean;125 readonly asToken: SpRuntimeTokenError;126 readonly isArithmetic: boolean;127 readonly asArithmetic: SpRuntimeArithmeticError;128 readonly isTransactional: boolean;129 readonly asTransactional: SpRuntimeTransactionalError;130 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';131 }132133 /** @name SpRuntimeModuleError (23) */134 interface SpRuntimeModuleError extends Struct {135 readonly index: u8;136 readonly error: U8aFixed;137 }138139 /** @name SpRuntimeTokenError (24) */140 interface SpRuntimeTokenError extends Enum {141 readonly isNoFunds: boolean;142 readonly isWouldDie: boolean;143 readonly isBelowMinimum: boolean;144 readonly isCannotCreate: boolean;145 readonly isUnknownAsset: boolean;146 readonly isFrozen: boolean;147 readonly isUnsupported: boolean;148 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';149 }150151 /** @name SpRuntimeArithmeticError (25) */152 interface SpRuntimeArithmeticError extends Enum {153 readonly isUnderflow: boolean;154 readonly isOverflow: boolean;155 readonly isDivisionByZero: boolean;156 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';157 }158159 /** @name SpRuntimeTransactionalError (26) */160 interface SpRuntimeTransactionalError extends Enum {161 readonly isLimitReached: boolean;162 readonly isNoLayer: boolean;163 readonly type: 'LimitReached' | 'NoLayer';164 }165166 /** @name CumulusPalletParachainSystemEvent (27) */167 interface CumulusPalletParachainSystemEvent extends Enum {168 readonly isValidationFunctionStored: boolean;169 readonly isValidationFunctionApplied: boolean;170 readonly asValidationFunctionApplied: {171 readonly relayChainBlockNum: u32;172 } & Struct;173 readonly isValidationFunctionDiscarded: boolean;174 readonly isUpgradeAuthorized: boolean;175 readonly asUpgradeAuthorized: {176 readonly codeHash: H256;177 } & Struct;178 readonly isDownwardMessagesReceived: boolean;179 readonly asDownwardMessagesReceived: {180 readonly count: u32;181 } & Struct;182 readonly isDownwardMessagesProcessed: boolean;183 readonly asDownwardMessagesProcessed: {184 readonly weightUsed: u64;185 readonly dmqHead: H256;186 } & Struct;187 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';188 }189190 /** @name PalletBalancesEvent (28) */191 interface PalletBalancesEvent extends Enum {192 readonly isEndowed: boolean;193 readonly asEndowed: {194 readonly account: AccountId32;195 readonly freeBalance: u128;196 } & Struct;197 readonly isDustLost: boolean;198 readonly asDustLost: {199 readonly account: AccountId32;200 readonly amount: u128;201 } & Struct;202 readonly isTransfer: boolean;203 readonly asTransfer: {204 readonly from: AccountId32;205 readonly to: AccountId32;206 readonly amount: u128;207 } & Struct;208 readonly isBalanceSet: boolean;209 readonly asBalanceSet: {210 readonly who: AccountId32;211 readonly free: u128;212 readonly reserved: u128;213 } & Struct;214 readonly isReserved: boolean;215 readonly asReserved: {216 readonly who: AccountId32;217 readonly amount: u128;218 } & Struct;219 readonly isUnreserved: boolean;220 readonly asUnreserved: {221 readonly who: AccountId32;222 readonly amount: u128;223 } & Struct;224 readonly isReserveRepatriated: boolean;225 readonly asReserveRepatriated: {226 readonly from: AccountId32;227 readonly to: AccountId32;228 readonly amount: u128;229 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;230 } & Struct;231 readonly isDeposit: boolean;232 readonly asDeposit: {233 readonly who: AccountId32;234 readonly amount: u128;235 } & Struct;236 readonly isWithdraw: boolean;237 readonly asWithdraw: {238 readonly who: AccountId32;239 readonly amount: u128;240 } & Struct;241 readonly isSlashed: boolean;242 readonly asSlashed: {243 readonly who: AccountId32;244 readonly amount: u128;245 } & Struct;246 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';247 }248249 /** @name FrameSupportTokensMiscBalanceStatus (29) */250 interface FrameSupportTokensMiscBalanceStatus extends Enum {251 readonly isFree: boolean;252 readonly isReserved: boolean;253 readonly type: 'Free' | 'Reserved';254 }255256 /** @name PalletTransactionPaymentEvent (30) */257 interface PalletTransactionPaymentEvent extends Enum {258 readonly isTransactionFeePaid: boolean;259 readonly asTransactionFeePaid: {260 readonly who: AccountId32;261 readonly actualFee: u128;262 readonly tip: u128;263 } & Struct;264 readonly type: 'TransactionFeePaid';265 }266267 /** @name PalletTreasuryEvent (31) */268 interface PalletTreasuryEvent extends Enum {269 readonly isProposed: boolean;270 readonly asProposed: {271 readonly proposalIndex: u32;272 } & Struct;273 readonly isSpending: boolean;274 readonly asSpending: {275 readonly budgetRemaining: u128;276 } & Struct;277 readonly isAwarded: boolean;278 readonly asAwarded: {279 readonly proposalIndex: u32;280 readonly award: u128;281 readonly account: AccountId32;282 } & Struct;283 readonly isRejected: boolean;284 readonly asRejected: {285 readonly proposalIndex: u32;286 readonly slashed: u128;287 } & Struct;288 readonly isBurnt: boolean;289 readonly asBurnt: {290 readonly burntFunds: u128;291 } & Struct;292 readonly isRollover: boolean;293 readonly asRollover: {294 readonly rolloverBalance: u128;295 } & Struct;296 readonly isDeposit: boolean;297 readonly asDeposit: {298 readonly value: u128;299 } & Struct;300 readonly isSpendApproved: boolean;301 readonly asSpendApproved: {302 readonly proposalIndex: u32;303 readonly amount: u128;304 readonly beneficiary: AccountId32;305 } & Struct;306 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';307 }308309 /** @name PalletSudoEvent (32) */310 interface PalletSudoEvent extends Enum {311 readonly isSudid: boolean;312 readonly asSudid: {313 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;314 } & Struct;315 readonly isKeyChanged: boolean;316 readonly asKeyChanged: {317 readonly oldSudoer: Option<AccountId32>;318 } & Struct;319 readonly isSudoAsDone: boolean;320 readonly asSudoAsDone: {321 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;322 } & Struct;323 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';324 }325326 /** @name OrmlVestingModuleEvent (36) */327 interface OrmlVestingModuleEvent extends Enum {328 readonly isVestingScheduleAdded: boolean;329 readonly asVestingScheduleAdded: {330 readonly from: AccountId32;331 readonly to: AccountId32;332 readonly vestingSchedule: OrmlVestingVestingSchedule;333 } & Struct;334 readonly isClaimed: boolean;335 readonly asClaimed: {336 readonly who: AccountId32;337 readonly amount: u128;338 } & Struct;339 readonly isVestingSchedulesUpdated: boolean;340 readonly asVestingSchedulesUpdated: {341 readonly who: AccountId32;342 } & Struct;343 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';344 }345346 /** @name OrmlVestingVestingSchedule (37) */347 interface OrmlVestingVestingSchedule extends Struct {348 readonly start: u32;349 readonly period: u32;350 readonly periodCount: u32;351 readonly perPeriod: Compact<u128>;352 }353354 /** @name OrmlXtokensModuleEvent (39) */355 interface OrmlXtokensModuleEvent extends Enum {356 readonly isTransferredMultiAssets: boolean;357 readonly asTransferredMultiAssets: {358 readonly sender: AccountId32;359 readonly assets: XcmV1MultiassetMultiAssets;360 readonly fee: XcmV1MultiAsset;361 readonly dest: XcmV1MultiLocation;362 } & Struct;363 readonly type: 'TransferredMultiAssets';364 }365366 /** @name XcmV1MultiassetMultiAssets (40) */367 interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}368369 /** @name XcmV1MultiAsset (42) */370 interface XcmV1MultiAsset extends Struct {371 readonly id: XcmV1MultiassetAssetId;372 readonly fun: XcmV1MultiassetFungibility;373 }374375 /** @name XcmV1MultiassetAssetId (43) */376 interface XcmV1MultiassetAssetId extends Enum {377 readonly isConcrete: boolean;378 readonly asConcrete: XcmV1MultiLocation;379 readonly isAbstract: boolean;380 readonly asAbstract: Bytes;381 readonly type: 'Concrete' | 'Abstract';382 }383384 /** @name XcmV1MultiLocation (44) */385 interface XcmV1MultiLocation extends Struct {386 readonly parents: u8;387 readonly interior: XcmV1MultilocationJunctions;388 }389390 /** @name XcmV1MultilocationJunctions (45) */391 interface XcmV1MultilocationJunctions extends Enum {392 readonly isHere: boolean;393 readonly isX1: boolean;394 readonly asX1: XcmV1Junction;395 readonly isX2: boolean;396 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;397 readonly isX3: boolean;398 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;399 readonly isX4: boolean;400 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;401 readonly isX5: boolean;402 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;403 readonly isX6: boolean;404 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;405 readonly isX7: boolean;406 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;407 readonly isX8: boolean;408 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;409 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';410 }411412 /** @name XcmV1Junction (46) */413 interface XcmV1Junction extends Enum {414 readonly isParachain: boolean;415 readonly asParachain: Compact<u32>;416 readonly isAccountId32: boolean;417 readonly asAccountId32: {418 readonly network: XcmV0JunctionNetworkId;419 readonly id: U8aFixed;420 } & Struct;421 readonly isAccountIndex64: boolean;422 readonly asAccountIndex64: {423 readonly network: XcmV0JunctionNetworkId;424 readonly index: Compact<u64>;425 } & Struct;426 readonly isAccountKey20: boolean;427 readonly asAccountKey20: {428 readonly network: XcmV0JunctionNetworkId;429 readonly key: U8aFixed;430 } & Struct;431 readonly isPalletInstance: boolean;432 readonly asPalletInstance: u8;433 readonly isGeneralIndex: boolean;434 readonly asGeneralIndex: Compact<u128>;435 readonly isGeneralKey: boolean;436 readonly asGeneralKey: Bytes;437 readonly isOnlyChild: boolean;438 readonly isPlurality: boolean;439 readonly asPlurality: {440 readonly id: XcmV0JunctionBodyId;441 readonly part: XcmV0JunctionBodyPart;442 } & Struct;443 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';444 }445446 /** @name XcmV0JunctionNetworkId (48) */447 interface XcmV0JunctionNetworkId extends Enum {448 readonly isAny: boolean;449 readonly isNamed: boolean;450 readonly asNamed: Bytes;451 readonly isPolkadot: boolean;452 readonly isKusama: boolean;453 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';454 }455456 /** @name XcmV0JunctionBodyId (52) */457 interface XcmV0JunctionBodyId extends Enum {458 readonly isUnit: boolean;459 readonly isNamed: boolean;460 readonly asNamed: Bytes;461 readonly isIndex: boolean;462 readonly asIndex: Compact<u32>;463 readonly isExecutive: boolean;464 readonly isTechnical: boolean;465 readonly isLegislative: boolean;466 readonly isJudicial: boolean;467 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';468 }469470 /** @name XcmV0JunctionBodyPart (53) */471 interface XcmV0JunctionBodyPart extends Enum {472 readonly isVoice: boolean;473 readonly isMembers: boolean;474 readonly asMembers: {475 readonly count: Compact<u32>;476 } & Struct;477 readonly isFraction: boolean;478 readonly asFraction: {479 readonly nom: Compact<u32>;480 readonly denom: Compact<u32>;481 } & Struct;482 readonly isAtLeastProportion: boolean;483 readonly asAtLeastProportion: {484 readonly nom: Compact<u32>;485 readonly denom: Compact<u32>;486 } & Struct;487 readonly isMoreThanProportion: boolean;488 readonly asMoreThanProportion: {489 readonly nom: Compact<u32>;490 readonly denom: Compact<u32>;491 } & Struct;492 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';493 }494495 /** @name XcmV1MultiassetFungibility (54) */496 interface XcmV1MultiassetFungibility extends Enum {497 readonly isFungible: boolean;498 readonly asFungible: Compact<u128>;499 readonly isNonFungible: boolean;500 readonly asNonFungible: XcmV1MultiassetAssetInstance;501 readonly type: 'Fungible' | 'NonFungible';502 }503504 /** @name XcmV1MultiassetAssetInstance (55) */505 interface XcmV1MultiassetAssetInstance extends Enum {506 readonly isUndefined: boolean;507 readonly isIndex: boolean;508 readonly asIndex: Compact<u128>;509 readonly isArray4: boolean;510 readonly asArray4: U8aFixed;511 readonly isArray8: boolean;512 readonly asArray8: U8aFixed;513 readonly isArray16: boolean;514 readonly asArray16: U8aFixed;515 readonly isArray32: boolean;516 readonly asArray32: U8aFixed;517 readonly isBlob: boolean;518 readonly asBlob: Bytes;519 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';520 }521522 /** @name OrmlTokensModuleEvent (58) */523 interface OrmlTokensModuleEvent extends Enum {524 readonly isEndowed: boolean;525 readonly asEndowed: {526 readonly currencyId: PalletForeignAssetsAssetIds;527 readonly who: AccountId32;528 readonly amount: u128;529 } & Struct;530 readonly isDustLost: boolean;531 readonly asDustLost: {532 readonly currencyId: PalletForeignAssetsAssetIds;533 readonly who: AccountId32;534 readonly amount: u128;535 } & Struct;536 readonly isTransfer: boolean;537 readonly asTransfer: {538 readonly currencyId: PalletForeignAssetsAssetIds;539 readonly from: AccountId32;540 readonly to: AccountId32;541 readonly amount: u128;542 } & Struct;543 readonly isReserved: boolean;544 readonly asReserved: {545 readonly currencyId: PalletForeignAssetsAssetIds;546 readonly who: AccountId32;547 readonly amount: u128;548 } & Struct;549 readonly isUnreserved: boolean;550 readonly asUnreserved: {551 readonly currencyId: PalletForeignAssetsAssetIds;552 readonly who: AccountId32;553 readonly amount: u128;554 } & Struct;555 readonly isReserveRepatriated: boolean;556 readonly asReserveRepatriated: {557 readonly currencyId: PalletForeignAssetsAssetIds;558 readonly from: AccountId32;559 readonly to: AccountId32;560 readonly amount: u128;561 readonly status: FrameSupportTokensMiscBalanceStatus;562 } & Struct;563 readonly isBalanceSet: boolean;564 readonly asBalanceSet: {565 readonly currencyId: PalletForeignAssetsAssetIds;566 readonly who: AccountId32;567 readonly free: u128;568 readonly reserved: u128;569 } & Struct;570 readonly isTotalIssuanceSet: boolean;571 readonly asTotalIssuanceSet: {572 readonly currencyId: PalletForeignAssetsAssetIds;573 readonly amount: u128;574 } & Struct;575 readonly isWithdrawn: boolean;576 readonly asWithdrawn: {577 readonly currencyId: PalletForeignAssetsAssetIds;578 readonly who: AccountId32;579 readonly amount: u128;580 } & Struct;581 readonly isSlashed: boolean;582 readonly asSlashed: {583 readonly currencyId: PalletForeignAssetsAssetIds;584 readonly who: AccountId32;585 readonly freeAmount: u128;586 readonly reservedAmount: u128;587 } & Struct;588 readonly isDeposited: boolean;589 readonly asDeposited: {590 readonly currencyId: PalletForeignAssetsAssetIds;591 readonly who: AccountId32;592 readonly amount: u128;593 } & Struct;594 readonly isLockSet: boolean;595 readonly asLockSet: {596 readonly lockId: U8aFixed;597 readonly currencyId: PalletForeignAssetsAssetIds;598 readonly who: AccountId32;599 readonly amount: u128;600 } & Struct;601 readonly isLockRemoved: boolean;602 readonly asLockRemoved: {603 readonly lockId: U8aFixed;604 readonly currencyId: PalletForeignAssetsAssetIds;605 readonly who: AccountId32;606 } & Struct;607 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved';608 }609610 /** @name PalletForeignAssetsAssetIds (59) */611 interface PalletForeignAssetsAssetIds extends Enum {612 readonly isForeignAssetId: boolean;613 readonly asForeignAssetId: u32;614 readonly isNativeAssetId: boolean;615 readonly asNativeAssetId: PalletForeignAssetsNativeCurrency;616 readonly type: 'ForeignAssetId' | 'NativeAssetId';617 }618619 /** @name PalletForeignAssetsNativeCurrency (60) */620 interface PalletForeignAssetsNativeCurrency extends Enum {621 readonly isHere: boolean;622 readonly isParent: boolean;623 readonly type: 'Here' | 'Parent';624 }625626 /** @name CumulusPalletXcmpQueueEvent (61) */627 interface CumulusPalletXcmpQueueEvent extends Enum {628 readonly isSuccess: boolean;629 readonly asSuccess: {630 readonly messageHash: Option<H256>;631 readonly weight: u64;632 } & Struct;633 readonly isFail: boolean;634 readonly asFail: {635 readonly messageHash: Option<H256>;636 readonly error: XcmV2TraitsError;637 readonly weight: u64;638 } & Struct;639 readonly isBadVersion: boolean;640 readonly asBadVersion: {641 readonly messageHash: Option<H256>;642 } & Struct;643 readonly isBadFormat: boolean;644 readonly asBadFormat: {645 readonly messageHash: Option<H256>;646 } & Struct;647 readonly isUpwardMessageSent: boolean;648 readonly asUpwardMessageSent: {649 readonly messageHash: Option<H256>;650 } & Struct;651 readonly isXcmpMessageSent: boolean;652 readonly asXcmpMessageSent: {653 readonly messageHash: Option<H256>;654 } & Struct;655 readonly isOverweightEnqueued: boolean;656 readonly asOverweightEnqueued: {657 readonly sender: u32;658 readonly sentAt: u32;659 readonly index: u64;660 readonly required: u64;661 } & Struct;662 readonly isOverweightServiced: boolean;663 readonly asOverweightServiced: {664 readonly index: u64;665 readonly used: u64;666 } & Struct;667 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';668 }669670 /** @name XcmV2TraitsError (63) */671 interface XcmV2TraitsError extends Enum {672 readonly isOverflow: boolean;673 readonly isUnimplemented: boolean;674 readonly isUntrustedReserveLocation: boolean;675 readonly isUntrustedTeleportLocation: boolean;676 readonly isMultiLocationFull: boolean;677 readonly isMultiLocationNotInvertible: boolean;678 readonly isBadOrigin: boolean;679 readonly isInvalidLocation: boolean;680 readonly isAssetNotFound: boolean;681 readonly isFailedToTransactAsset: boolean;682 readonly isNotWithdrawable: boolean;683 readonly isLocationCannotHold: boolean;684 readonly isExceedsMaxMessageSize: boolean;685 readonly isDestinationUnsupported: boolean;686 readonly isTransport: boolean;687 readonly isUnroutable: boolean;688 readonly isUnknownClaim: boolean;689 readonly isFailedToDecode: boolean;690 readonly isMaxWeightInvalid: boolean;691 readonly isNotHoldingFees: boolean;692 readonly isTooExpensive: boolean;693 readonly isTrap: boolean;694 readonly asTrap: u64;695 readonly isUnhandledXcmVersion: boolean;696 readonly isWeightLimitReached: boolean;697 readonly asWeightLimitReached: u64;698 readonly isBarrier: boolean;699 readonly isWeightNotComputable: boolean;700 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';701 }702703 /** @name PalletXcmEvent (65) */704 interface PalletXcmEvent extends Enum {705 readonly isAttempted: boolean;706 readonly asAttempted: XcmV2TraitsOutcome;707 readonly isSent: boolean;708 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;709 readonly isUnexpectedResponse: boolean;710 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;711 readonly isResponseReady: boolean;712 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;713 readonly isNotified: boolean;714 readonly asNotified: ITuple<[u64, u8, u8]>;715 readonly isNotifyOverweight: boolean;716 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;717 readonly isNotifyDispatchError: boolean;718 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;719 readonly isNotifyDecodeFailed: boolean;720 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;721 readonly isInvalidResponder: boolean;722 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;723 readonly isInvalidResponderVersion: boolean;724 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;725 readonly isResponseTaken: boolean;726 readonly asResponseTaken: u64;727 readonly isAssetsTrapped: boolean;728 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;729 readonly isVersionChangeNotified: boolean;730 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;731 readonly isSupportedVersionChanged: boolean;732 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;733 readonly isNotifyTargetSendFail: boolean;734 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;735 readonly isNotifyTargetMigrationFail: boolean;736 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;737 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';738 }739740 /** @name XcmV2TraitsOutcome (66) */741 interface XcmV2TraitsOutcome extends Enum {742 readonly isComplete: boolean;743 readonly asComplete: u64;744 readonly isIncomplete: boolean;745 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;746 readonly isError: boolean;747 readonly asError: XcmV2TraitsError;748 readonly type: 'Complete' | 'Incomplete' | 'Error';749 }750751 /** @name XcmV2Xcm (67) */752 interface XcmV2Xcm extends Vec<XcmV2Instruction> {}753754 /** @name XcmV2Instruction (69) */755 interface XcmV2Instruction extends Enum {756 readonly isWithdrawAsset: boolean;757 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;758 readonly isReserveAssetDeposited: boolean;759 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;760 readonly isReceiveTeleportedAsset: boolean;761 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;762 readonly isQueryResponse: boolean;763 readonly asQueryResponse: {764 readonly queryId: Compact<u64>;765 readonly response: XcmV2Response;766 readonly maxWeight: Compact<u64>;767 } & Struct;768 readonly isTransferAsset: boolean;769 readonly asTransferAsset: {770 readonly assets: XcmV1MultiassetMultiAssets;771 readonly beneficiary: XcmV1MultiLocation;772 } & Struct;773 readonly isTransferReserveAsset: boolean;774 readonly asTransferReserveAsset: {775 readonly assets: XcmV1MultiassetMultiAssets;776 readonly dest: XcmV1MultiLocation;777 readonly xcm: XcmV2Xcm;778 } & Struct;779 readonly isTransact: boolean;780 readonly asTransact: {781 readonly originType: XcmV0OriginKind;782 readonly requireWeightAtMost: Compact<u64>;783 readonly call: XcmDoubleEncoded;784 } & Struct;785 readonly isHrmpNewChannelOpenRequest: boolean;786 readonly asHrmpNewChannelOpenRequest: {787 readonly sender: Compact<u32>;788 readonly maxMessageSize: Compact<u32>;789 readonly maxCapacity: Compact<u32>;790 } & Struct;791 readonly isHrmpChannelAccepted: boolean;792 readonly asHrmpChannelAccepted: {793 readonly recipient: Compact<u32>;794 } & Struct;795 readonly isHrmpChannelClosing: boolean;796 readonly asHrmpChannelClosing: {797 readonly initiator: Compact<u32>;798 readonly sender: Compact<u32>;799 readonly recipient: Compact<u32>;800 } & Struct;801 readonly isClearOrigin: boolean;802 readonly isDescendOrigin: boolean;803 readonly asDescendOrigin: XcmV1MultilocationJunctions;804 readonly isReportError: boolean;805 readonly asReportError: {806 readonly queryId: Compact<u64>;807 readonly dest: XcmV1MultiLocation;808 readonly maxResponseWeight: Compact<u64>;809 } & Struct;810 readonly isDepositAsset: boolean;811 readonly asDepositAsset: {812 readonly assets: XcmV1MultiassetMultiAssetFilter;813 readonly maxAssets: Compact<u32>;814 readonly beneficiary: XcmV1MultiLocation;815 } & Struct;816 readonly isDepositReserveAsset: boolean;817 readonly asDepositReserveAsset: {818 readonly assets: XcmV1MultiassetMultiAssetFilter;819 readonly maxAssets: Compact<u32>;820 readonly dest: XcmV1MultiLocation;821 readonly xcm: XcmV2Xcm;822 } & Struct;823 readonly isExchangeAsset: boolean;824 readonly asExchangeAsset: {825 readonly give: XcmV1MultiassetMultiAssetFilter;826 readonly receive: XcmV1MultiassetMultiAssets;827 } & Struct;828 readonly isInitiateReserveWithdraw: boolean;829 readonly asInitiateReserveWithdraw: {830 readonly assets: XcmV1MultiassetMultiAssetFilter;831 readonly reserve: XcmV1MultiLocation;832 readonly xcm: XcmV2Xcm;833 } & Struct;834 readonly isInitiateTeleport: boolean;835 readonly asInitiateTeleport: {836 readonly assets: XcmV1MultiassetMultiAssetFilter;837 readonly dest: XcmV1MultiLocation;838 readonly xcm: XcmV2Xcm;839 } & Struct;840 readonly isQueryHolding: boolean;841 readonly asQueryHolding: {842 readonly queryId: Compact<u64>;843 readonly dest: XcmV1MultiLocation;844 readonly assets: XcmV1MultiassetMultiAssetFilter;845 readonly maxResponseWeight: Compact<u64>;846 } & Struct;847 readonly isBuyExecution: boolean;848 readonly asBuyExecution: {849 readonly fees: XcmV1MultiAsset;850 readonly weightLimit: XcmV2WeightLimit;851 } & Struct;852 readonly isRefundSurplus: boolean;853 readonly isSetErrorHandler: boolean;854 readonly asSetErrorHandler: XcmV2Xcm;855 readonly isSetAppendix: boolean;856 readonly asSetAppendix: XcmV2Xcm;857 readonly isClearError: boolean;858 readonly isClaimAsset: boolean;859 readonly asClaimAsset: {860 readonly assets: XcmV1MultiassetMultiAssets;861 readonly ticket: XcmV1MultiLocation;862 } & Struct;863 readonly isTrap: boolean;864 readonly asTrap: Compact<u64>;865 readonly isSubscribeVersion: boolean;866 readonly asSubscribeVersion: {867 readonly queryId: Compact<u64>;868 readonly maxResponseWeight: Compact<u64>;869 } & Struct;870 readonly isUnsubscribeVersion: boolean;871 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';872 }873874 /** @name XcmV2Response (70) */875 interface XcmV2Response extends Enum {876 readonly isNull: boolean;877 readonly isAssets: boolean;878 readonly asAssets: XcmV1MultiassetMultiAssets;879 readonly isExecutionResult: boolean;880 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;881 readonly isVersion: boolean;882 readonly asVersion: u32;883 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';884 }885886 /** @name XcmV0OriginKind (73) */887 interface XcmV0OriginKind extends Enum {888 readonly isNative: boolean;889 readonly isSovereignAccount: boolean;890 readonly isSuperuser: boolean;891 readonly isXcm: boolean;892 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';893 }894895 /** @name XcmDoubleEncoded (74) */896 interface XcmDoubleEncoded extends Struct {897 readonly encoded: Bytes;898 }899900 /** @name XcmV1MultiassetMultiAssetFilter (75) */901 interface XcmV1MultiassetMultiAssetFilter extends Enum {902 readonly isDefinite: boolean;903 readonly asDefinite: XcmV1MultiassetMultiAssets;904 readonly isWild: boolean;905 readonly asWild: XcmV1MultiassetWildMultiAsset;906 readonly type: 'Definite' | 'Wild';907 }908909 /** @name XcmV1MultiassetWildMultiAsset (76) */910 interface XcmV1MultiassetWildMultiAsset extends Enum {911 readonly isAll: boolean;912 readonly isAllOf: boolean;913 readonly asAllOf: {914 readonly id: XcmV1MultiassetAssetId;915 readonly fun: XcmV1MultiassetWildFungibility;916 } & Struct;917 readonly type: 'All' | 'AllOf';918 }919920 /** @name XcmV1MultiassetWildFungibility (77) */921 interface XcmV1MultiassetWildFungibility extends Enum {922 readonly isFungible: boolean;923 readonly isNonFungible: boolean;924 readonly type: 'Fungible' | 'NonFungible';925 }926927 /** @name XcmV2WeightLimit (78) */928 interface XcmV2WeightLimit extends Enum {929 readonly isUnlimited: boolean;930 readonly isLimited: boolean;931 readonly asLimited: Compact<u64>;932 readonly type: 'Unlimited' | 'Limited';933 }934935 /** @name XcmVersionedMultiAssets (80) */936 interface XcmVersionedMultiAssets extends Enum {937 readonly isV0: boolean;938 readonly asV0: Vec<XcmV0MultiAsset>;939 readonly isV1: boolean;940 readonly asV1: XcmV1MultiassetMultiAssets;941 readonly type: 'V0' | 'V1';942 }943944 /** @name XcmV0MultiAsset (82) */945 interface XcmV0MultiAsset extends Enum {946 readonly isNone: boolean;947 readonly isAll: boolean;948 readonly isAllFungible: boolean;949 readonly isAllNonFungible: boolean;950 readonly isAllAbstractFungible: boolean;951 readonly asAllAbstractFungible: {952 readonly id: Bytes;953 } & Struct;954 readonly isAllAbstractNonFungible: boolean;955 readonly asAllAbstractNonFungible: {956 readonly class: Bytes;957 } & Struct;958 readonly isAllConcreteFungible: boolean;959 readonly asAllConcreteFungible: {960 readonly id: XcmV0MultiLocation;961 } & Struct;962 readonly isAllConcreteNonFungible: boolean;963 readonly asAllConcreteNonFungible: {964 readonly class: XcmV0MultiLocation;965 } & Struct;966 readonly isAbstractFungible: boolean;967 readonly asAbstractFungible: {968 readonly id: Bytes;969 readonly amount: Compact<u128>;970 } & Struct;971 readonly isAbstractNonFungible: boolean;972 readonly asAbstractNonFungible: {973 readonly class: Bytes;974 readonly instance: XcmV1MultiassetAssetInstance;975 } & Struct;976 readonly isConcreteFungible: boolean;977 readonly asConcreteFungible: {978 readonly id: XcmV0MultiLocation;979 readonly amount: Compact<u128>;980 } & Struct;981 readonly isConcreteNonFungible: boolean;982 readonly asConcreteNonFungible: {983 readonly class: XcmV0MultiLocation;984 readonly instance: XcmV1MultiassetAssetInstance;985 } & Struct;986 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';987 }988989 /** @name XcmV0MultiLocation (83) */990 interface XcmV0MultiLocation extends Enum {991 readonly isNull: boolean;992 readonly isX1: boolean;993 readonly asX1: XcmV0Junction;994 readonly isX2: boolean;995 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;996 readonly isX3: boolean;997 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;998 readonly isX4: boolean;999 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;1000 readonly isX5: boolean;1001 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;1002 readonly isX6: boolean;1003 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;1004 readonly isX7: boolean;1005 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;1006 readonly isX8: boolean;1007 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;1008 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';1009 }10101011 /** @name XcmV0Junction (84) */1012 interface XcmV0Junction extends Enum {1013 readonly isParent: boolean;1014 readonly isParachain: boolean;1015 readonly asParachain: Compact<u32>;1016 readonly isAccountId32: boolean;1017 readonly asAccountId32: {1018 readonly network: XcmV0JunctionNetworkId;1019 readonly id: U8aFixed;1020 } & Struct;1021 readonly isAccountIndex64: boolean;1022 readonly asAccountIndex64: {1023 readonly network: XcmV0JunctionNetworkId;1024 readonly index: Compact<u64>;1025 } & Struct;1026 readonly isAccountKey20: boolean;1027 readonly asAccountKey20: {1028 readonly network: XcmV0JunctionNetworkId;1029 readonly key: U8aFixed;1030 } & Struct;1031 readonly isPalletInstance: boolean;1032 readonly asPalletInstance: u8;1033 readonly isGeneralIndex: boolean;1034 readonly asGeneralIndex: Compact<u128>;1035 readonly isGeneralKey: boolean;1036 readonly asGeneralKey: Bytes;1037 readonly isOnlyChild: boolean;1038 readonly isPlurality: boolean;1039 readonly asPlurality: {1040 readonly id: XcmV0JunctionBodyId;1041 readonly part: XcmV0JunctionBodyPart;1042 } & Struct;1043 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';1044 }10451046 /** @name XcmVersionedMultiLocation (85) */1047 interface XcmVersionedMultiLocation extends Enum {1048 readonly isV0: boolean;1049 readonly asV0: XcmV0MultiLocation;1050 readonly isV1: boolean;1051 readonly asV1: XcmV1MultiLocation;1052 readonly type: 'V0' | 'V1';1053 }10541055 /** @name CumulusPalletXcmEvent (86) */1056 interface CumulusPalletXcmEvent extends Enum {1057 readonly isInvalidFormat: boolean;1058 readonly asInvalidFormat: U8aFixed;1059 readonly isUnsupportedVersion: boolean;1060 readonly asUnsupportedVersion: U8aFixed;1061 readonly isExecutedDownward: boolean;1062 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;1063 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';1064 }10651066 /** @name CumulusPalletDmpQueueEvent (87) */1067 interface CumulusPalletDmpQueueEvent extends Enum {1068 readonly isInvalidFormat: boolean;1069 readonly asInvalidFormat: {1070 readonly messageId: U8aFixed;1071 } & Struct;1072 readonly isUnsupportedVersion: boolean;1073 readonly asUnsupportedVersion: {1074 readonly messageId: U8aFixed;1075 } & Struct;1076 readonly isExecutedDownward: boolean;1077 readonly asExecutedDownward: {1078 readonly messageId: U8aFixed;1079 readonly outcome: XcmV2TraitsOutcome;1080 } & Struct;1081 readonly isWeightExhausted: boolean;1082 readonly asWeightExhausted: {1083 readonly messageId: U8aFixed;1084 readonly remainingWeight: u64;1085 readonly requiredWeight: u64;1086 } & Struct;1087 readonly isOverweightEnqueued: boolean;1088 readonly asOverweightEnqueued: {1089 readonly messageId: U8aFixed;1090 readonly overweightIndex: u64;1091 readonly requiredWeight: u64;1092 } & Struct;1093 readonly isOverweightServiced: boolean;1094 readonly asOverweightServiced: {1095 readonly overweightIndex: u64;1096 readonly weightUsed: u64;1097 } & Struct;1098 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';1099 }11001101 /** @name PalletUniqueRawEvent (88) */1102 interface PalletUniqueRawEvent extends Enum {1103 readonly isCollectionSponsorRemoved: boolean;1104 readonly asCollectionSponsorRemoved: u32;1105 readonly isCollectionAdminAdded: boolean;1106 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1107 readonly isCollectionOwnedChanged: boolean;1108 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;1109 readonly isCollectionSponsorSet: boolean;1110 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;1111 readonly isSponsorshipConfirmed: boolean;1112 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;1113 readonly isCollectionAdminRemoved: boolean;1114 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1115 readonly isAllowListAddressRemoved: boolean;1116 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1117 readonly isAllowListAddressAdded: boolean;1118 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1119 readonly isCollectionLimitSet: boolean;1120 readonly asCollectionLimitSet: u32;1121 readonly isCollectionPermissionSet: boolean;1122 readonly asCollectionPermissionSet: u32;1123 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';1124 }11251126 /** @name PalletEvmAccountBasicCrossAccountIdRepr (89) */1127 interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1128 readonly isSubstrate: boolean;1129 readonly asSubstrate: AccountId32;1130 readonly isEthereum: boolean;1131 readonly asEthereum: H160;1132 readonly type: 'Substrate' | 'Ethereum';1133 }11341135 /** @name PalletUniqueSchedulerEvent (92) */1136 interface PalletUniqueSchedulerEvent extends Enum {1137 readonly isScheduled: boolean;1138 readonly asScheduled: {1139 readonly when: u32;1140 readonly index: u32;1141 } & Struct;1142 readonly isCanceled: boolean;1143 readonly asCanceled: {1144 readonly when: u32;1145 readonly index: u32;1146 } & Struct;1147 readonly isDispatched: boolean;1148 readonly asDispatched: {1149 readonly task: ITuple<[u32, u32]>;1150 readonly id: Option<U8aFixed>;1151 readonly result: Result<Null, SpRuntimeDispatchError>;1152 } & Struct;1153 readonly isCallLookupFailed: boolean;1154 readonly asCallLookupFailed: {1155 readonly task: ITuple<[u32, u32]>;1156 readonly id: Option<U8aFixed>;1157 readonly error: FrameSupportScheduleLookupError;1158 } & Struct;1159 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';1160 }11611162 /** @name FrameSupportScheduleLookupError (95) */1163 interface FrameSupportScheduleLookupError extends Enum {1164 readonly isUnknown: boolean;1165 readonly isBadFormat: boolean;1166 readonly type: 'Unknown' | 'BadFormat';1167 }11681169 /** @name PalletCommonEvent (96) */1170 interface PalletCommonEvent extends Enum {1171 readonly isCollectionCreated: boolean;1172 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1173 readonly isCollectionDestroyed: boolean;1174 readonly asCollectionDestroyed: u32;1175 readonly isItemCreated: boolean;1176 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1177 readonly isItemDestroyed: boolean;1178 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1179 readonly isTransfer: boolean;1180 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1181 readonly isApproved: boolean;1182 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1183 readonly isCollectionPropertySet: boolean;1184 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1185 readonly isCollectionPropertyDeleted: boolean;1186 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1187 readonly isTokenPropertySet: boolean;1188 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1189 readonly isTokenPropertyDeleted: boolean;1190 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1191 readonly isPropertyPermissionSet: boolean;1192 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1193 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1194 }11951196 /** @name PalletStructureEvent (99) */1197 interface PalletStructureEvent extends Enum {1198 readonly isExecuted: boolean;1199 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1200 readonly type: 'Executed';1201 }12021203 /** @name PalletRmrkCoreEvent (100) */1204 interface PalletRmrkCoreEvent extends Enum {1205 readonly isCollectionCreated: boolean;1206 readonly asCollectionCreated: {1207 readonly issuer: AccountId32;1208 readonly collectionId: u32;1209 } & Struct;1210 readonly isCollectionDestroyed: boolean;1211 readonly asCollectionDestroyed: {1212 readonly issuer: AccountId32;1213 readonly collectionId: u32;1214 } & Struct;1215 readonly isIssuerChanged: boolean;1216 readonly asIssuerChanged: {1217 readonly oldIssuer: AccountId32;1218 readonly newIssuer: AccountId32;1219 readonly collectionId: u32;1220 } & Struct;1221 readonly isCollectionLocked: boolean;1222 readonly asCollectionLocked: {1223 readonly issuer: AccountId32;1224 readonly collectionId: u32;1225 } & Struct;1226 readonly isNftMinted: boolean;1227 readonly asNftMinted: {1228 readonly owner: AccountId32;1229 readonly collectionId: u32;1230 readonly nftId: u32;1231 } & Struct;1232 readonly isNftBurned: boolean;1233 readonly asNftBurned: {1234 readonly owner: AccountId32;1235 readonly nftId: u32;1236 } & Struct;1237 readonly isNftSent: boolean;1238 readonly asNftSent: {1239 readonly sender: AccountId32;1240 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1241 readonly collectionId: u32;1242 readonly nftId: u32;1243 readonly approvalRequired: bool;1244 } & Struct;1245 readonly isNftAccepted: boolean;1246 readonly asNftAccepted: {1247 readonly sender: AccountId32;1248 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1249 readonly collectionId: u32;1250 readonly nftId: u32;1251 } & Struct;1252 readonly isNftRejected: boolean;1253 readonly asNftRejected: {1254 readonly sender: AccountId32;1255 readonly collectionId: u32;1256 readonly nftId: u32;1257 } & Struct;1258 readonly isPropertySet: boolean;1259 readonly asPropertySet: {1260 readonly collectionId: u32;1261 readonly maybeNftId: Option<u32>;1262 readonly key: Bytes;1263 readonly value: Bytes;1264 } & Struct;1265 readonly isResourceAdded: boolean;1266 readonly asResourceAdded: {1267 readonly nftId: u32;1268 readonly resourceId: u32;1269 } & Struct;1270 readonly isResourceRemoval: boolean;1271 readonly asResourceRemoval: {1272 readonly nftId: u32;1273 readonly resourceId: u32;1274 } & Struct;1275 readonly isResourceAccepted: boolean;1276 readonly asResourceAccepted: {1277 readonly nftId: u32;1278 readonly resourceId: u32;1279 } & Struct;1280 readonly isResourceRemovalAccepted: boolean;1281 readonly asResourceRemovalAccepted: {1282 readonly nftId: u32;1283 readonly resourceId: u32;1284 } & Struct;1285 readonly isPrioritySet: boolean;1286 readonly asPrioritySet: {1287 readonly collectionId: u32;1288 readonly nftId: u32;1289 } & Struct;1290 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1291 }12921293 /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */1294 interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {1295 readonly isAccountId: boolean;1296 readonly asAccountId: AccountId32;1297 readonly isCollectionAndNftTuple: boolean;1298 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;1299 readonly type: 'AccountId' | 'CollectionAndNftTuple';1300 }13011302 /** @name PalletRmrkEquipEvent (106) */1303 interface PalletRmrkEquipEvent extends Enum {1304 readonly isBaseCreated: boolean;1305 readonly asBaseCreated: {1306 readonly issuer: AccountId32;1307 readonly baseId: u32;1308 } & Struct;1309 readonly isEquippablesUpdated: boolean;1310 readonly asEquippablesUpdated: {1311 readonly baseId: u32;1312 readonly slotId: u32;1313 } & Struct;1314 readonly type: 'BaseCreated' | 'EquippablesUpdated';1315 }13161317 /** @name PalletAppPromotionEvent (107) */1318 interface PalletAppPromotionEvent extends Enum {1319 readonly isStakingRecalculation: boolean;1320 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;1321 readonly isStake: boolean;1322 readonly asStake: ITuple<[AccountId32, u128]>;1323 readonly isUnstake: boolean;1324 readonly asUnstake: ITuple<[AccountId32, u128]>;1325 readonly isSetAdmin: boolean;1326 readonly asSetAdmin: AccountId32;1327 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';1328 }13291330 /** @name PalletForeignAssetsModuleEvent (108) */1331 interface PalletForeignAssetsModuleEvent extends Enum {1332 readonly isForeignAssetRegistered: boolean;1333 readonly asForeignAssetRegistered: {1334 readonly assetId: u32;1335 readonly assetAddress: XcmV1MultiLocation;1336 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1337 } & Struct;1338 readonly isForeignAssetUpdated: boolean;1339 readonly asForeignAssetUpdated: {1340 readonly assetId: u32;1341 readonly assetAddress: XcmV1MultiLocation;1342 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1343 } & Struct;1344 readonly isAssetRegistered: boolean;1345 readonly asAssetRegistered: {1346 readonly assetId: PalletForeignAssetsAssetIds;1347 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1348 } & Struct;1349 readonly isAssetUpdated: boolean;1350 readonly asAssetUpdated: {1351 readonly assetId: PalletForeignAssetsAssetIds;1352 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1353 } & Struct;1354 readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated';1355 }13561357 /** @name PalletForeignAssetsModuleAssetMetadata (109) */1358 interface PalletForeignAssetsModuleAssetMetadata extends Struct {1359 readonly name: Bytes;1360 readonly symbol: Bytes;1361 readonly decimals: u8;1362 readonly minimalBalance: u128;1363 }13641365 /** @name PalletEvmEvent (110) */1366 interface PalletEvmEvent extends Enum {1367 readonly isLog: boolean;1368 readonly asLog: EthereumLog;1369 readonly isCreated: boolean;1370 readonly asCreated: H160;1371 readonly isCreatedFailed: boolean;1372 readonly asCreatedFailed: H160;1373 readonly isExecuted: boolean;1374 readonly asExecuted: H160;1375 readonly isExecutedFailed: boolean;1376 readonly asExecutedFailed: H160;1377 readonly isBalanceDeposit: boolean;1378 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1379 readonly isBalanceWithdraw: boolean;1380 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1381 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1382 }13831384 /** @name EthereumLog (111) */1385 interface EthereumLog extends Struct {1386 readonly address: H160;1387 readonly topics: Vec<H256>;1388 readonly data: Bytes;1389 }13901391 /** @name PalletEthereumEvent (115) */1392 interface PalletEthereumEvent extends Enum {1393 readonly isExecuted: boolean;1394 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1395 readonly type: 'Executed';1396 }13971398 /** @name EvmCoreErrorExitReason (116) */1399 interface EvmCoreErrorExitReason extends Enum {1400 readonly isSucceed: boolean;1401 readonly asSucceed: EvmCoreErrorExitSucceed;1402 readonly isError: boolean;1403 readonly asError: EvmCoreErrorExitError;1404 readonly isRevert: boolean;1405 readonly asRevert: EvmCoreErrorExitRevert;1406 readonly isFatal: boolean;1407 readonly asFatal: EvmCoreErrorExitFatal;1408 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';1409 }14101411 /** @name EvmCoreErrorExitSucceed (117) */1412 interface EvmCoreErrorExitSucceed extends Enum {1413 readonly isStopped: boolean;1414 readonly isReturned: boolean;1415 readonly isSuicided: boolean;1416 readonly type: 'Stopped' | 'Returned' | 'Suicided';1417 }14181419 /** @name EvmCoreErrorExitError (118) */1420 interface EvmCoreErrorExitError extends Enum {1421 readonly isStackUnderflow: boolean;1422 readonly isStackOverflow: boolean;1423 readonly isInvalidJump: boolean;1424 readonly isInvalidRange: boolean;1425 readonly isDesignatedInvalid: boolean;1426 readonly isCallTooDeep: boolean;1427 readonly isCreateCollision: boolean;1428 readonly isCreateContractLimit: boolean;1429 readonly isOutOfOffset: boolean;1430 readonly isOutOfGas: boolean;1431 readonly isOutOfFund: boolean;1432 readonly isPcUnderflow: boolean;1433 readonly isCreateEmpty: boolean;1434 readonly isOther: boolean;1435 readonly asOther: Text;1436 readonly isInvalidCode: boolean;1437 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';1438 }14391440 /** @name EvmCoreErrorExitRevert (121) */1441 interface EvmCoreErrorExitRevert extends Enum {1442 readonly isReverted: boolean;1443 readonly type: 'Reverted';1444 }14451446 /** @name EvmCoreErrorExitFatal (122) */1447 interface EvmCoreErrorExitFatal extends Enum {1448 readonly isNotSupported: boolean;1449 readonly isUnhandledInterrupt: boolean;1450 readonly isCallErrorAsFatal: boolean;1451 readonly asCallErrorAsFatal: EvmCoreErrorExitError;1452 readonly isOther: boolean;1453 readonly asOther: Text;1454 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';1455 }14561457 /** @name PalletEvmContractHelpersEvent (123) */1458 interface PalletEvmContractHelpersEvent extends Enum {1459 readonly isContractSponsorSet: boolean;1460 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1461 readonly isContractSponsorshipConfirmed: boolean;1462 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1463 readonly isContractSponsorRemoved: boolean;1464 readonly asContractSponsorRemoved: H160;1465 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1466 }14671468 /** @name FrameSystemPhase (124) */1469 interface FrameSystemPhase extends Enum {1470 readonly isApplyExtrinsic: boolean;1471 readonly asApplyExtrinsic: u32;1472 readonly isFinalization: boolean;1473 readonly isInitialization: boolean;1474 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';1475 }14761477 /** @name FrameSystemLastRuntimeUpgradeInfo (126) */1478 interface FrameSystemLastRuntimeUpgradeInfo extends Struct {1479 readonly specVersion: Compact<u32>;1480 readonly specName: Text;1481 }14821483 /** @name FrameSystemCall (127) */1484 interface FrameSystemCall extends Enum {1485 readonly isFillBlock: boolean;1486 readonly asFillBlock: {1487 readonly ratio: Perbill;1488 } & Struct;1489 readonly isRemark: boolean;1490 readonly asRemark: {1491 readonly remark: Bytes;1492 } & Struct;1493 readonly isSetHeapPages: boolean;1494 readonly asSetHeapPages: {1495 readonly pages: u64;1496 } & Struct;1497 readonly isSetCode: boolean;1498 readonly asSetCode: {1499 readonly code: Bytes;1500 } & Struct;1501 readonly isSetCodeWithoutChecks: boolean;1502 readonly asSetCodeWithoutChecks: {1503 readonly code: Bytes;1504 } & Struct;1505 readonly isSetStorage: boolean;1506 readonly asSetStorage: {1507 readonly items: Vec<ITuple<[Bytes, Bytes]>>;1508 } & Struct;1509 readonly isKillStorage: boolean;1510 readonly asKillStorage: {1511 readonly keys_: Vec<Bytes>;1512 } & Struct;1513 readonly isKillPrefix: boolean;1514 readonly asKillPrefix: {1515 readonly prefix: Bytes;1516 readonly subkeys: u32;1517 } & Struct;1518 readonly isRemarkWithEvent: boolean;1519 readonly asRemarkWithEvent: {1520 readonly remark: Bytes;1521 } & Struct;1522 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';1523 }15241525 /** @name FrameSystemLimitsBlockWeights (132) */1526 interface FrameSystemLimitsBlockWeights extends Struct {1527 readonly baseBlock: u64;1528 readonly maxBlock: u64;1529 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;1530 }15311532 /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (133) */1533 interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {1534 readonly normal: FrameSystemLimitsWeightsPerClass;1535 readonly operational: FrameSystemLimitsWeightsPerClass;1536 readonly mandatory: FrameSystemLimitsWeightsPerClass;1537 }15381539 /** @name FrameSystemLimitsWeightsPerClass (134) */1540 interface FrameSystemLimitsWeightsPerClass extends Struct {1541 readonly baseExtrinsic: u64;1542 readonly maxExtrinsic: Option<u64>;1543 readonly maxTotal: Option<u64>;1544 readonly reserved: Option<u64>;1545 }15461547 /** @name FrameSystemLimitsBlockLength (136) */1548 interface FrameSystemLimitsBlockLength extends Struct {1549 readonly max: FrameSupportWeightsPerDispatchClassU32;1550 }15511552 /** @name FrameSupportWeightsPerDispatchClassU32 (137) */1553 interface FrameSupportWeightsPerDispatchClassU32 extends Struct {1554 readonly normal: u32;1555 readonly operational: u32;1556 readonly mandatory: u32;1557 }15581559 /** @name FrameSupportWeightsRuntimeDbWeight (138) */1560 interface FrameSupportWeightsRuntimeDbWeight extends Struct {1561 readonly read: u64;1562 readonly write: u64;1563 }15641565 /** @name SpVersionRuntimeVersion (139) */1566 interface SpVersionRuntimeVersion extends Struct {1567 readonly specName: Text;1568 readonly implName: Text;1569 readonly authoringVersion: u32;1570 readonly specVersion: u32;1571 readonly implVersion: u32;1572 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;1573 readonly transactionVersion: u32;1574 readonly stateVersion: u8;1575 }15761577 /** @name FrameSystemError (144) */1578 interface FrameSystemError extends Enum {1579 readonly isInvalidSpecName: boolean;1580 readonly isSpecVersionNeedsToIncrease: boolean;1581 readonly isFailedToExtractRuntimeVersion: boolean;1582 readonly isNonDefaultComposite: boolean;1583 readonly isNonZeroRefCount: boolean;1584 readonly isCallFiltered: boolean;1585 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';1586 }15871588 /** @name PolkadotPrimitivesV2PersistedValidationData (145) */1589 interface PolkadotPrimitivesV2PersistedValidationData extends Struct {1590 readonly parentHead: Bytes;1591 readonly relayParentNumber: u32;1592 readonly relayParentStorageRoot: H256;1593 readonly maxPovSize: u32;1594 }15951596 /** @name PolkadotPrimitivesV2UpgradeRestriction (148) */1597 interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {1598 readonly isPresent: boolean;1599 readonly type: 'Present';1600 }16011602 /** @name SpTrieStorageProof (149) */1603 interface SpTrieStorageProof extends Struct {1604 readonly trieNodes: BTreeSet<Bytes>;1605 }16061607 /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (151) */1608 interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {1609 readonly dmqMqcHead: H256;1610 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;1611 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1612 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1613 }16141615 /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (154) */1616 interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {1617 readonly maxCapacity: u32;1618 readonly maxTotalSize: u32;1619 readonly maxMessageSize: u32;1620 readonly msgCount: u32;1621 readonly totalSize: u32;1622 readonly mqcHead: Option<H256>;1623 }16241625 /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (155) */1626 interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {1627 readonly maxCodeSize: u32;1628 readonly maxHeadDataSize: u32;1629 readonly maxUpwardQueueCount: u32;1630 readonly maxUpwardQueueSize: u32;1631 readonly maxUpwardMessageSize: u32;1632 readonly maxUpwardMessageNumPerCandidate: u32;1633 readonly hrmpMaxMessageNumPerCandidate: u32;1634 readonly validationUpgradeCooldown: u32;1635 readonly validationUpgradeDelay: u32;1636 }16371638 /** @name PolkadotCorePrimitivesOutboundHrmpMessage (161) */1639 interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {1640 readonly recipient: u32;1641 readonly data: Bytes;1642 }16431644 /** @name CumulusPalletParachainSystemCall (162) */1645 interface CumulusPalletParachainSystemCall extends Enum {1646 readonly isSetValidationData: boolean;1647 readonly asSetValidationData: {1648 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;1649 } & Struct;1650 readonly isSudoSendUpwardMessage: boolean;1651 readonly asSudoSendUpwardMessage: {1652 readonly message: Bytes;1653 } & Struct;1654 readonly isAuthorizeUpgrade: boolean;1655 readonly asAuthorizeUpgrade: {1656 readonly codeHash: H256;1657 } & Struct;1658 readonly isEnactAuthorizedUpgrade: boolean;1659 readonly asEnactAuthorizedUpgrade: {1660 readonly code: Bytes;1661 } & Struct;1662 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';1663 }16641665 /** @name CumulusPrimitivesParachainInherentParachainInherentData (163) */1666 interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {1667 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;1668 readonly relayChainState: SpTrieStorageProof;1669 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;1670 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;1671 }16721673 /** @name PolkadotCorePrimitivesInboundDownwardMessage (165) */1674 interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {1675 readonly sentAt: u32;1676 readonly msg: Bytes;1677 }16781679 /** @name PolkadotCorePrimitivesInboundHrmpMessage (168) */1680 interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {1681 readonly sentAt: u32;1682 readonly data: Bytes;1683 }16841685 /** @name CumulusPalletParachainSystemError (171) */1686 interface CumulusPalletParachainSystemError extends Enum {1687 readonly isOverlappingUpgrades: boolean;1688 readonly isProhibitedByPolkadot: boolean;1689 readonly isTooBig: boolean;1690 readonly isValidationDataNotAvailable: boolean;1691 readonly isHostConfigurationNotAvailable: boolean;1692 readonly isNotScheduled: boolean;1693 readonly isNothingAuthorized: boolean;1694 readonly isUnauthorized: boolean;1695 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';1696 }16971698 /** @name PalletBalancesBalanceLock (173) */1699 interface PalletBalancesBalanceLock extends Struct {1700 readonly id: U8aFixed;1701 readonly amount: u128;1702 readonly reasons: PalletBalancesReasons;1703 }17041705 /** @name PalletBalancesReasons (174) */1706 interface PalletBalancesReasons extends Enum {1707 readonly isFee: boolean;1708 readonly isMisc: boolean;1709 readonly isAll: boolean;1710 readonly type: 'Fee' | 'Misc' | 'All';1711 }17121713 /** @name PalletBalancesReserveData (177) */1714 interface PalletBalancesReserveData extends Struct {1715 readonly id: U8aFixed;1716 readonly amount: u128;1717 }17181719 /** @name PalletBalancesReleases (179) */1720 interface PalletBalancesReleases extends Enum {1721 readonly isV100: boolean;1722 readonly isV200: boolean;1723 readonly type: 'V100' | 'V200';1724 }17251726 /** @name PalletBalancesCall (180) */1727 interface PalletBalancesCall extends Enum {1728 readonly isTransfer: boolean;1729 readonly asTransfer: {1730 readonly dest: MultiAddress;1731 readonly value: Compact<u128>;1732 } & Struct;1733 readonly isSetBalance: boolean;1734 readonly asSetBalance: {1735 readonly who: MultiAddress;1736 readonly newFree: Compact<u128>;1737 readonly newReserved: Compact<u128>;1738 } & Struct;1739 readonly isForceTransfer: boolean;1740 readonly asForceTransfer: {1741 readonly source: MultiAddress;1742 readonly dest: MultiAddress;1743 readonly value: Compact<u128>;1744 } & Struct;1745 readonly isTransferKeepAlive: boolean;1746 readonly asTransferKeepAlive: {1747 readonly dest: MultiAddress;1748 readonly value: Compact<u128>;1749 } & Struct;1750 readonly isTransferAll: boolean;1751 readonly asTransferAll: {1752 readonly dest: MultiAddress;1753 readonly keepAlive: bool;1754 } & Struct;1755 readonly isForceUnreserve: boolean;1756 readonly asForceUnreserve: {1757 readonly who: MultiAddress;1758 readonly amount: u128;1759 } & Struct;1760 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';1761 }17621763 /** @name PalletBalancesError (183) */1764 interface PalletBalancesError extends Enum {1765 readonly isVestingBalance: boolean;1766 readonly isLiquidityRestrictions: boolean;1767 readonly isInsufficientBalance: boolean;1768 readonly isExistentialDeposit: boolean;1769 readonly isKeepAlive: boolean;1770 readonly isExistingVestingSchedule: boolean;1771 readonly isDeadAccount: boolean;1772 readonly isTooManyReserves: boolean;1773 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';1774 }17751776 /** @name PalletTimestampCall (185) */1777 interface PalletTimestampCall extends Enum {1778 readonly isSet: boolean;1779 readonly asSet: {1780 readonly now: Compact<u64>;1781 } & Struct;1782 readonly type: 'Set';1783 }17841785 /** @name PalletTransactionPaymentReleases (187) */1786 interface PalletTransactionPaymentReleases extends Enum {1787 readonly isV1Ancient: boolean;1788 readonly isV2: boolean;1789 readonly type: 'V1Ancient' | 'V2';1790 }17911792 /** @name PalletTreasuryProposal (188) */1793 interface PalletTreasuryProposal extends Struct {1794 readonly proposer: AccountId32;1795 readonly value: u128;1796 readonly beneficiary: AccountId32;1797 readonly bond: u128;1798 }17991800 /** @name PalletTreasuryCall (191) */1801 interface PalletTreasuryCall extends Enum {1802 readonly isProposeSpend: boolean;1803 readonly asProposeSpend: {1804 readonly value: Compact<u128>;1805 readonly beneficiary: MultiAddress;1806 } & Struct;1807 readonly isRejectProposal: boolean;1808 readonly asRejectProposal: {1809 readonly proposalId: Compact<u32>;1810 } & Struct;1811 readonly isApproveProposal: boolean;1812 readonly asApproveProposal: {1813 readonly proposalId: Compact<u32>;1814 } & Struct;1815 readonly isSpend: boolean;1816 readonly asSpend: {1817 readonly amount: Compact<u128>;1818 readonly beneficiary: MultiAddress;1819 } & Struct;1820 readonly isRemoveApproval: boolean;1821 readonly asRemoveApproval: {1822 readonly proposalId: Compact<u32>;1823 } & Struct;1824 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';1825 }18261827 /** @name FrameSupportPalletId (194) */1828 interface FrameSupportPalletId extends U8aFixed {}18291830 /** @name PalletTreasuryError (195) */1831 interface PalletTreasuryError extends Enum {1832 readonly isInsufficientProposersBalance: boolean;1833 readonly isInvalidIndex: boolean;1834 readonly isTooManyApprovals: boolean;1835 readonly isInsufficientPermission: boolean;1836 readonly isProposalNotApproved: boolean;1837 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';1838 }18391840 /** @name PalletSudoCall (196) */1841 interface PalletSudoCall extends Enum {1842 readonly isSudo: boolean;1843 readonly asSudo: {1844 readonly call: Call;1845 } & Struct;1846 readonly isSudoUncheckedWeight: boolean;1847 readonly asSudoUncheckedWeight: {1848 readonly call: Call;1849 readonly weight: u64;1850 } & Struct;1851 readonly isSetKey: boolean;1852 readonly asSetKey: {1853 readonly new_: MultiAddress;1854 } & Struct;1855 readonly isSudoAs: boolean;1856 readonly asSudoAs: {1857 readonly who: MultiAddress;1858 readonly call: Call;1859 } & Struct;1860 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1861 }18621863 /** @name OrmlVestingModuleCall (198) */1864 interface OrmlVestingModuleCall extends Enum {1865 readonly isClaim: boolean;1866 readonly isVestedTransfer: boolean;1867 readonly asVestedTransfer: {1868 readonly dest: MultiAddress;1869 readonly schedule: OrmlVestingVestingSchedule;1870 } & Struct;1871 readonly isUpdateVestingSchedules: boolean;1872 readonly asUpdateVestingSchedules: {1873 readonly who: MultiAddress;1874 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;1875 } & Struct;1876 readonly isClaimFor: boolean;1877 readonly asClaimFor: {1878 readonly dest: MultiAddress;1879 } & Struct;1880 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';1881 }18821883 /** @name OrmlXtokensModuleCall (200) */1884 interface OrmlXtokensModuleCall extends Enum {1885 readonly isTransfer: boolean;1886 readonly asTransfer: {1887 readonly currencyId: PalletForeignAssetsAssetIds;1888 readonly amount: u128;1889 readonly dest: XcmVersionedMultiLocation;1890 readonly destWeight: u64;1891 } & Struct;1892 readonly isTransferMultiasset: boolean;1893 readonly asTransferMultiasset: {1894 readonly asset: XcmVersionedMultiAsset;1895 readonly dest: XcmVersionedMultiLocation;1896 readonly destWeight: u64;1897 } & Struct;1898 readonly isTransferWithFee: boolean;1899 readonly asTransferWithFee: {1900 readonly currencyId: PalletForeignAssetsAssetIds;1901 readonly amount: u128;1902 readonly fee: u128;1903 readonly dest: XcmVersionedMultiLocation;1904 readonly destWeight: u64;1905 } & Struct;1906 readonly isTransferMultiassetWithFee: boolean;1907 readonly asTransferMultiassetWithFee: {1908 readonly asset: XcmVersionedMultiAsset;1909 readonly fee: XcmVersionedMultiAsset;1910 readonly dest: XcmVersionedMultiLocation;1911 readonly destWeight: u64;1912 } & Struct;1913 readonly isTransferMulticurrencies: boolean;1914 readonly asTransferMulticurrencies: {1915 readonly currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>;1916 readonly feeItem: u32;1917 readonly dest: XcmVersionedMultiLocation;1918 readonly destWeight: u64;1919 } & Struct;1920 readonly isTransferMultiassets: boolean;1921 readonly asTransferMultiassets: {1922 readonly assets: XcmVersionedMultiAssets;1923 readonly feeItem: u32;1924 readonly dest: XcmVersionedMultiLocation;1925 readonly destWeight: u64;1926 } & Struct;1927 readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets';1928 }19291930 /** @name XcmVersionedMultiAsset (201) */1931 interface XcmVersionedMultiAsset extends Enum {1932 readonly isV0: boolean;1933 readonly asV0: XcmV0MultiAsset;1934 readonly isV1: boolean;1935 readonly asV1: XcmV1MultiAsset;1936 readonly type: 'V0' | 'V1';1937 }19381939 /** @name OrmlTokensModuleCall (204) */1940 interface OrmlTokensModuleCall extends Enum {1941 readonly isTransfer: boolean;1942 readonly asTransfer: {1943 readonly dest: MultiAddress;1944 readonly currencyId: PalletForeignAssetsAssetIds;1945 readonly amount: Compact<u128>;1946 } & Struct;1947 readonly isTransferAll: boolean;1948 readonly asTransferAll: {1949 readonly dest: MultiAddress;1950 readonly currencyId: PalletForeignAssetsAssetIds;1951 readonly keepAlive: bool;1952 } & Struct;1953 readonly isTransferKeepAlive: boolean;1954 readonly asTransferKeepAlive: {1955 readonly dest: MultiAddress;1956 readonly currencyId: PalletForeignAssetsAssetIds;1957 readonly amount: Compact<u128>;1958 } & Struct;1959 readonly isForceTransfer: boolean;1960 readonly asForceTransfer: {1961 readonly source: MultiAddress;1962 readonly dest: MultiAddress;1963 readonly currencyId: PalletForeignAssetsAssetIds;1964 readonly amount: Compact<u128>;1965 } & Struct;1966 readonly isSetBalance: boolean;1967 readonly asSetBalance: {1968 readonly who: MultiAddress;1969 readonly currencyId: PalletForeignAssetsAssetIds;1970 readonly newFree: Compact<u128>;1971 readonly newReserved: Compact<u128>;1972 } & Struct;1973 readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance';1974 }19751976 /** @name CumulusPalletXcmpQueueCall (205) */1977 interface CumulusPalletXcmpQueueCall extends Enum {1978 readonly isServiceOverweight: boolean;1979 readonly asServiceOverweight: {1980 readonly index: u64;1981 readonly weightLimit: u64;1982 } & Struct;1983 readonly isSuspendXcmExecution: boolean;1984 readonly isResumeXcmExecution: boolean;1985 readonly isUpdateSuspendThreshold: boolean;1986 readonly asUpdateSuspendThreshold: {1987 readonly new_: u32;1988 } & Struct;1989 readonly isUpdateDropThreshold: boolean;1990 readonly asUpdateDropThreshold: {1991 readonly new_: u32;1992 } & Struct;1993 readonly isUpdateResumeThreshold: boolean;1994 readonly asUpdateResumeThreshold: {1995 readonly new_: u32;1996 } & Struct;1997 readonly isUpdateThresholdWeight: boolean;1998 readonly asUpdateThresholdWeight: {1999 readonly new_: u64;2000 } & Struct;2001 readonly isUpdateWeightRestrictDecay: boolean;2002 readonly asUpdateWeightRestrictDecay: {2003 readonly new_: u64;2004 } & Struct;2005 readonly isUpdateXcmpMaxIndividualWeight: boolean;2006 readonly asUpdateXcmpMaxIndividualWeight: {2007 readonly new_: u64;2008 } & Struct;2009 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';2010 }20112012 /** @name PalletXcmCall (206) */2013 interface PalletXcmCall extends Enum {2014 readonly isSend: boolean;2015 readonly asSend: {2016 readonly dest: XcmVersionedMultiLocation;2017 readonly message: XcmVersionedXcm;2018 } & Struct;2019 readonly isTeleportAssets: boolean;2020 readonly asTeleportAssets: {2021 readonly dest: XcmVersionedMultiLocation;2022 readonly beneficiary: XcmVersionedMultiLocation;2023 readonly assets: XcmVersionedMultiAssets;2024 readonly feeAssetItem: u32;2025 } & Struct;2026 readonly isReserveTransferAssets: boolean;2027 readonly asReserveTransferAssets: {2028 readonly dest: XcmVersionedMultiLocation;2029 readonly beneficiary: XcmVersionedMultiLocation;2030 readonly assets: XcmVersionedMultiAssets;2031 readonly feeAssetItem: u32;2032 } & Struct;2033 readonly isExecute: boolean;2034 readonly asExecute: {2035 readonly message: XcmVersionedXcm;2036 readonly maxWeight: u64;2037 } & Struct;2038 readonly isForceXcmVersion: boolean;2039 readonly asForceXcmVersion: {2040 readonly location: XcmV1MultiLocation;2041 readonly xcmVersion: u32;2042 } & Struct;2043 readonly isForceDefaultXcmVersion: boolean;2044 readonly asForceDefaultXcmVersion: {2045 readonly maybeXcmVersion: Option<u32>;2046 } & Struct;2047 readonly isForceSubscribeVersionNotify: boolean;2048 readonly asForceSubscribeVersionNotify: {2049 readonly location: XcmVersionedMultiLocation;2050 } & Struct;2051 readonly isForceUnsubscribeVersionNotify: boolean;2052 readonly asForceUnsubscribeVersionNotify: {2053 readonly location: XcmVersionedMultiLocation;2054 } & Struct;2055 readonly isLimitedReserveTransferAssets: boolean;2056 readonly asLimitedReserveTransferAssets: {2057 readonly dest: XcmVersionedMultiLocation;2058 readonly beneficiary: XcmVersionedMultiLocation;2059 readonly assets: XcmVersionedMultiAssets;2060 readonly feeAssetItem: u32;2061 readonly weightLimit: XcmV2WeightLimit;2062 } & Struct;2063 readonly isLimitedTeleportAssets: boolean;2064 readonly asLimitedTeleportAssets: {2065 readonly dest: XcmVersionedMultiLocation;2066 readonly beneficiary: XcmVersionedMultiLocation;2067 readonly assets: XcmVersionedMultiAssets;2068 readonly feeAssetItem: u32;2069 readonly weightLimit: XcmV2WeightLimit;2070 } & Struct;2071 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';2072 }20732074 /** @name XcmVersionedXcm (207) */2075 interface XcmVersionedXcm extends Enum {2076 readonly isV0: boolean;2077 readonly asV0: XcmV0Xcm;2078 readonly isV1: boolean;2079 readonly asV1: XcmV1Xcm;2080 readonly isV2: boolean;2081 readonly asV2: XcmV2Xcm;2082 readonly type: 'V0' | 'V1' | 'V2';2083 }20842085 /** @name XcmV0Xcm (208) */2086 interface XcmV0Xcm extends Enum {2087 readonly isWithdrawAsset: boolean;2088 readonly asWithdrawAsset: {2089 readonly assets: Vec<XcmV0MultiAsset>;2090 readonly effects: Vec<XcmV0Order>;2091 } & Struct;2092 readonly isReserveAssetDeposit: boolean;2093 readonly asReserveAssetDeposit: {2094 readonly assets: Vec<XcmV0MultiAsset>;2095 readonly effects: Vec<XcmV0Order>;2096 } & Struct;2097 readonly isTeleportAsset: boolean;2098 readonly asTeleportAsset: {2099 readonly assets: Vec<XcmV0MultiAsset>;2100 readonly effects: Vec<XcmV0Order>;2101 } & Struct;2102 readonly isQueryResponse: boolean;2103 readonly asQueryResponse: {2104 readonly queryId: Compact<u64>;2105 readonly response: XcmV0Response;2106 } & Struct;2107 readonly isTransferAsset: boolean;2108 readonly asTransferAsset: {2109 readonly assets: Vec<XcmV0MultiAsset>;2110 readonly dest: XcmV0MultiLocation;2111 } & Struct;2112 readonly isTransferReserveAsset: boolean;2113 readonly asTransferReserveAsset: {2114 readonly assets: Vec<XcmV0MultiAsset>;2115 readonly dest: XcmV0MultiLocation;2116 readonly effects: Vec<XcmV0Order>;2117 } & Struct;2118 readonly isTransact: boolean;2119 readonly asTransact: {2120 readonly originType: XcmV0OriginKind;2121 readonly requireWeightAtMost: u64;2122 readonly call: XcmDoubleEncoded;2123 } & Struct;2124 readonly isHrmpNewChannelOpenRequest: boolean;2125 readonly asHrmpNewChannelOpenRequest: {2126 readonly sender: Compact<u32>;2127 readonly maxMessageSize: Compact<u32>;2128 readonly maxCapacity: Compact<u32>;2129 } & Struct;2130 readonly isHrmpChannelAccepted: boolean;2131 readonly asHrmpChannelAccepted: {2132 readonly recipient: Compact<u32>;2133 } & Struct;2134 readonly isHrmpChannelClosing: boolean;2135 readonly asHrmpChannelClosing: {2136 readonly initiator: Compact<u32>;2137 readonly sender: Compact<u32>;2138 readonly recipient: Compact<u32>;2139 } & Struct;2140 readonly isRelayedFrom: boolean;2141 readonly asRelayedFrom: {2142 readonly who: XcmV0MultiLocation;2143 readonly message: XcmV0Xcm;2144 } & Struct;2145 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';2146 }21472148 /** @name XcmV0Order (210) */2149 interface XcmV0Order extends Enum {2150 readonly isNull: boolean;2151 readonly isDepositAsset: boolean;2152 readonly asDepositAsset: {2153 readonly assets: Vec<XcmV0MultiAsset>;2154 readonly dest: XcmV0MultiLocation;2155 } & Struct;2156 readonly isDepositReserveAsset: boolean;2157 readonly asDepositReserveAsset: {2158 readonly assets: Vec<XcmV0MultiAsset>;2159 readonly dest: XcmV0MultiLocation;2160 readonly effects: Vec<XcmV0Order>;2161 } & Struct;2162 readonly isExchangeAsset: boolean;2163 readonly asExchangeAsset: {2164 readonly give: Vec<XcmV0MultiAsset>;2165 readonly receive: Vec<XcmV0MultiAsset>;2166 } & Struct;2167 readonly isInitiateReserveWithdraw: boolean;2168 readonly asInitiateReserveWithdraw: {2169 readonly assets: Vec<XcmV0MultiAsset>;2170 readonly reserve: XcmV0MultiLocation;2171 readonly effects: Vec<XcmV0Order>;2172 } & Struct;2173 readonly isInitiateTeleport: boolean;2174 readonly asInitiateTeleport: {2175 readonly assets: Vec<XcmV0MultiAsset>;2176 readonly dest: XcmV0MultiLocation;2177 readonly effects: Vec<XcmV0Order>;2178 } & Struct;2179 readonly isQueryHolding: boolean;2180 readonly asQueryHolding: {2181 readonly queryId: Compact<u64>;2182 readonly dest: XcmV0MultiLocation;2183 readonly assets: Vec<XcmV0MultiAsset>;2184 } & Struct;2185 readonly isBuyExecution: boolean;2186 readonly asBuyExecution: {2187 readonly fees: XcmV0MultiAsset;2188 readonly weight: u64;2189 readonly debt: u64;2190 readonly haltOnError: bool;2191 readonly xcm: Vec<XcmV0Xcm>;2192 } & Struct;2193 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2194 }21952196 /** @name XcmV0Response (212) */2197 interface XcmV0Response extends Enum {2198 readonly isAssets: boolean;2199 readonly asAssets: Vec<XcmV0MultiAsset>;2200 readonly type: 'Assets';2201 }22022203 /** @name XcmV1Xcm (213) */2204 interface XcmV1Xcm extends Enum {2205 readonly isWithdrawAsset: boolean;2206 readonly asWithdrawAsset: {2207 readonly assets: XcmV1MultiassetMultiAssets;2208 readonly effects: Vec<XcmV1Order>;2209 } & Struct;2210 readonly isReserveAssetDeposited: boolean;2211 readonly asReserveAssetDeposited: {2212 readonly assets: XcmV1MultiassetMultiAssets;2213 readonly effects: Vec<XcmV1Order>;2214 } & Struct;2215 readonly isReceiveTeleportedAsset: boolean;2216 readonly asReceiveTeleportedAsset: {2217 readonly assets: XcmV1MultiassetMultiAssets;2218 readonly effects: Vec<XcmV1Order>;2219 } & Struct;2220 readonly isQueryResponse: boolean;2221 readonly asQueryResponse: {2222 readonly queryId: Compact<u64>;2223 readonly response: XcmV1Response;2224 } & Struct;2225 readonly isTransferAsset: boolean;2226 readonly asTransferAsset: {2227 readonly assets: XcmV1MultiassetMultiAssets;2228 readonly beneficiary: XcmV1MultiLocation;2229 } & Struct;2230 readonly isTransferReserveAsset: boolean;2231 readonly asTransferReserveAsset: {2232 readonly assets: XcmV1MultiassetMultiAssets;2233 readonly dest: XcmV1MultiLocation;2234 readonly effects: Vec<XcmV1Order>;2235 } & Struct;2236 readonly isTransact: boolean;2237 readonly asTransact: {2238 readonly originType: XcmV0OriginKind;2239 readonly requireWeightAtMost: u64;2240 readonly call: XcmDoubleEncoded;2241 } & Struct;2242 readonly isHrmpNewChannelOpenRequest: boolean;2243 readonly asHrmpNewChannelOpenRequest: {2244 readonly sender: Compact<u32>;2245 readonly maxMessageSize: Compact<u32>;2246 readonly maxCapacity: Compact<u32>;2247 } & Struct;2248 readonly isHrmpChannelAccepted: boolean;2249 readonly asHrmpChannelAccepted: {2250 readonly recipient: Compact<u32>;2251 } & Struct;2252 readonly isHrmpChannelClosing: boolean;2253 readonly asHrmpChannelClosing: {2254 readonly initiator: Compact<u32>;2255 readonly sender: Compact<u32>;2256 readonly recipient: Compact<u32>;2257 } & Struct;2258 readonly isRelayedFrom: boolean;2259 readonly asRelayedFrom: {2260 readonly who: XcmV1MultilocationJunctions;2261 readonly message: XcmV1Xcm;2262 } & Struct;2263 readonly isSubscribeVersion: boolean;2264 readonly asSubscribeVersion: {2265 readonly queryId: Compact<u64>;2266 readonly maxResponseWeight: Compact<u64>;2267 } & Struct;2268 readonly isUnsubscribeVersion: boolean;2269 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';2270 }22712272 /** @name XcmV1Order (215) */2273 interface XcmV1Order extends Enum {2274 readonly isNoop: boolean;2275 readonly isDepositAsset: boolean;2276 readonly asDepositAsset: {2277 readonly assets: XcmV1MultiassetMultiAssetFilter;2278 readonly maxAssets: u32;2279 readonly beneficiary: XcmV1MultiLocation;2280 } & Struct;2281 readonly isDepositReserveAsset: boolean;2282 readonly asDepositReserveAsset: {2283 readonly assets: XcmV1MultiassetMultiAssetFilter;2284 readonly maxAssets: u32;2285 readonly dest: XcmV1MultiLocation;2286 readonly effects: Vec<XcmV1Order>;2287 } & Struct;2288 readonly isExchangeAsset: boolean;2289 readonly asExchangeAsset: {2290 readonly give: XcmV1MultiassetMultiAssetFilter;2291 readonly receive: XcmV1MultiassetMultiAssets;2292 } & Struct;2293 readonly isInitiateReserveWithdraw: boolean;2294 readonly asInitiateReserveWithdraw: {2295 readonly assets: XcmV1MultiassetMultiAssetFilter;2296 readonly reserve: XcmV1MultiLocation;2297 readonly effects: Vec<XcmV1Order>;2298 } & Struct;2299 readonly isInitiateTeleport: boolean;2300 readonly asInitiateTeleport: {2301 readonly assets: XcmV1MultiassetMultiAssetFilter;2302 readonly dest: XcmV1MultiLocation;2303 readonly effects: Vec<XcmV1Order>;2304 } & Struct;2305 readonly isQueryHolding: boolean;2306 readonly asQueryHolding: {2307 readonly queryId: Compact<u64>;2308 readonly dest: XcmV1MultiLocation;2309 readonly assets: XcmV1MultiassetMultiAssetFilter;2310 } & Struct;2311 readonly isBuyExecution: boolean;2312 readonly asBuyExecution: {2313 readonly fees: XcmV1MultiAsset;2314 readonly weight: u64;2315 readonly debt: u64;2316 readonly haltOnError: bool;2317 readonly instructions: Vec<XcmV1Xcm>;2318 } & Struct;2319 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2320 }23212322 /** @name XcmV1Response (217) */2323 interface XcmV1Response extends Enum {2324 readonly isAssets: boolean;2325 readonly asAssets: XcmV1MultiassetMultiAssets;2326 readonly isVersion: boolean;2327 readonly asVersion: u32;2328 readonly type: 'Assets' | 'Version';2329 }23302331 /** @name CumulusPalletXcmCall (231) */2332 type CumulusPalletXcmCall = Null;23332334 /** @name CumulusPalletDmpQueueCall (232) */2335 interface CumulusPalletDmpQueueCall extends Enum {2336 readonly isServiceOverweight: boolean;2337 readonly asServiceOverweight: {2338 readonly index: u64;2339 readonly weightLimit: u64;2340 } & Struct;2341 readonly type: 'ServiceOverweight';2342 }23432344 /** @name PalletInflationCall (233) */2345 interface PalletInflationCall extends Enum {2346 readonly isStartInflation: boolean;2347 readonly asStartInflation: {2348 readonly inflationStartRelayBlock: u32;2349 } & Struct;2350 readonly type: 'StartInflation';2351 }23522353 /** @name PalletUniqueCall (234) */2354 interface PalletUniqueCall extends Enum {2355 readonly isCreateCollection: boolean;2356 readonly asCreateCollection: {2357 readonly collectionName: Vec<u16>;2358 readonly collectionDescription: Vec<u16>;2359 readonly tokenPrefix: Bytes;2360 readonly mode: UpDataStructsCollectionMode;2361 } & Struct;2362 readonly isCreateCollectionEx: boolean;2363 readonly asCreateCollectionEx: {2364 readonly data: UpDataStructsCreateCollectionData;2365 } & Struct;2366 readonly isDestroyCollection: boolean;2367 readonly asDestroyCollection: {2368 readonly collectionId: u32;2369 } & Struct;2370 readonly isAddToAllowList: boolean;2371 readonly asAddToAllowList: {2372 readonly collectionId: u32;2373 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2374 } & Struct;2375 readonly isRemoveFromAllowList: boolean;2376 readonly asRemoveFromAllowList: {2377 readonly collectionId: u32;2378 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2379 } & Struct;2380 readonly isChangeCollectionOwner: boolean;2381 readonly asChangeCollectionOwner: {2382 readonly collectionId: u32;2383 readonly newOwner: AccountId32;2384 } & Struct;2385 readonly isAddCollectionAdmin: boolean;2386 readonly asAddCollectionAdmin: {2387 readonly collectionId: u32;2388 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2389 } & Struct;2390 readonly isRemoveCollectionAdmin: boolean;2391 readonly asRemoveCollectionAdmin: {2392 readonly collectionId: u32;2393 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2394 } & Struct;2395 readonly isSetCollectionSponsor: boolean;2396 readonly asSetCollectionSponsor: {2397 readonly collectionId: u32;2398 readonly newSponsor: AccountId32;2399 } & Struct;2400 readonly isConfirmSponsorship: boolean;2401 readonly asConfirmSponsorship: {2402 readonly collectionId: u32;2403 } & Struct;2404 readonly isRemoveCollectionSponsor: boolean;2405 readonly asRemoveCollectionSponsor: {2406 readonly collectionId: u32;2407 } & Struct;2408 readonly isCreateItem: boolean;2409 readonly asCreateItem: {2410 readonly collectionId: u32;2411 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2412 readonly data: UpDataStructsCreateItemData;2413 } & Struct;2414 readonly isCreateMultipleItems: boolean;2415 readonly asCreateMultipleItems: {2416 readonly collectionId: u32;2417 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2418 readonly itemsData: Vec<UpDataStructsCreateItemData>;2419 } & Struct;2420 readonly isSetCollectionProperties: boolean;2421 readonly asSetCollectionProperties: {2422 readonly collectionId: u32;2423 readonly properties: Vec<UpDataStructsProperty>;2424 } & Struct;2425 readonly isDeleteCollectionProperties: boolean;2426 readonly asDeleteCollectionProperties: {2427 readonly collectionId: u32;2428 readonly propertyKeys: Vec<Bytes>;2429 } & Struct;2430 readonly isSetTokenProperties: boolean;2431 readonly asSetTokenProperties: {2432 readonly collectionId: u32;2433 readonly tokenId: u32;2434 readonly properties: Vec<UpDataStructsProperty>;2435 } & Struct;2436 readonly isDeleteTokenProperties: boolean;2437 readonly asDeleteTokenProperties: {2438 readonly collectionId: u32;2439 readonly tokenId: u32;2440 readonly propertyKeys: Vec<Bytes>;2441 } & Struct;2442 readonly isSetTokenPropertyPermissions: boolean;2443 readonly asSetTokenPropertyPermissions: {2444 readonly collectionId: u32;2445 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2446 } & Struct;2447 readonly isCreateMultipleItemsEx: boolean;2448 readonly asCreateMultipleItemsEx: {2449 readonly collectionId: u32;2450 readonly data: UpDataStructsCreateItemExData;2451 } & Struct;2452 readonly isSetTransfersEnabledFlag: boolean;2453 readonly asSetTransfersEnabledFlag: {2454 readonly collectionId: u32;2455 readonly value: bool;2456 } & Struct;2457 readonly isBurnItem: boolean;2458 readonly asBurnItem: {2459 readonly collectionId: u32;2460 readonly itemId: u32;2461 readonly value: u128;2462 } & Struct;2463 readonly isBurnFrom: boolean;2464 readonly asBurnFrom: {2465 readonly collectionId: u32;2466 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2467 readonly itemId: u32;2468 readonly value: u128;2469 } & Struct;2470 readonly isTransfer: boolean;2471 readonly asTransfer: {2472 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2473 readonly collectionId: u32;2474 readonly itemId: u32;2475 readonly value: u128;2476 } & Struct;2477 readonly isApprove: boolean;2478 readonly asApprove: {2479 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2480 readonly collectionId: u32;2481 readonly itemId: u32;2482 readonly amount: u128;2483 } & Struct;2484 readonly isTransferFrom: boolean;2485 readonly asTransferFrom: {2486 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2487 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2488 readonly collectionId: u32;2489 readonly itemId: u32;2490 readonly value: u128;2491 } & Struct;2492 readonly isSetCollectionLimits: boolean;2493 readonly asSetCollectionLimits: {2494 readonly collectionId: u32;2495 readonly newLimit: UpDataStructsCollectionLimits;2496 } & Struct;2497 readonly isSetCollectionPermissions: boolean;2498 readonly asSetCollectionPermissions: {2499 readonly collectionId: u32;2500 readonly newPermission: UpDataStructsCollectionPermissions;2501 } & Struct;2502 readonly isRepartition: boolean;2503 readonly asRepartition: {2504 readonly collectionId: u32;2505 readonly tokenId: u32;2506 readonly amount: u128;2507 } & Struct;2508 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';2509 }25102511 /** @name UpDataStructsCollectionMode (239) */2512 interface UpDataStructsCollectionMode extends Enum {2513 readonly isNft: boolean;2514 readonly isFungible: boolean;2515 readonly asFungible: u8;2516 readonly isReFungible: boolean;2517 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2518 }25192520 /** @name UpDataStructsCreateCollectionData (240) */2521 interface UpDataStructsCreateCollectionData extends Struct {2522 readonly mode: UpDataStructsCollectionMode;2523 readonly access: Option<UpDataStructsAccessMode>;2524 readonly name: Vec<u16>;2525 readonly description: Vec<u16>;2526 readonly tokenPrefix: Bytes;2527 readonly pendingSponsor: Option<AccountId32>;2528 readonly limits: Option<UpDataStructsCollectionLimits>;2529 readonly permissions: Option<UpDataStructsCollectionPermissions>;2530 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2531 readonly properties: Vec<UpDataStructsProperty>;2532 }25332534 /** @name UpDataStructsAccessMode (242) */2535 interface UpDataStructsAccessMode extends Enum {2536 readonly isNormal: boolean;2537 readonly isAllowList: boolean;2538 readonly type: 'Normal' | 'AllowList';2539 }25402541 /** @name UpDataStructsCollectionLimits (244) */2542 interface UpDataStructsCollectionLimits extends Struct {2543 readonly accountTokenOwnershipLimit: Option<u32>;2544 readonly sponsoredDataSize: Option<u32>;2545 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2546 readonly tokenLimit: Option<u32>;2547 readonly sponsorTransferTimeout: Option<u32>;2548 readonly sponsorApproveTimeout: Option<u32>;2549 readonly ownerCanTransfer: Option<bool>;2550 readonly ownerCanDestroy: Option<bool>;2551 readonly transfersEnabled: Option<bool>;2552 }25532554 /** @name UpDataStructsSponsoringRateLimit (246) */2555 interface UpDataStructsSponsoringRateLimit extends Enum {2556 readonly isSponsoringDisabled: boolean;2557 readonly isBlocks: boolean;2558 readonly asBlocks: u32;2559 readonly type: 'SponsoringDisabled' | 'Blocks';2560 }25612562 /** @name UpDataStructsCollectionPermissions (249) */2563 interface UpDataStructsCollectionPermissions extends Struct {2564 readonly access: Option<UpDataStructsAccessMode>;2565 readonly mintMode: Option<bool>;2566 readonly nesting: Option<UpDataStructsNestingPermissions>;2567 }25682569 /** @name UpDataStructsNestingPermissions (251) */2570 interface UpDataStructsNestingPermissions extends Struct {2571 readonly tokenOwner: bool;2572 readonly collectionAdmin: bool;2573 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2574 }25752576 /** @name UpDataStructsOwnerRestrictedSet (253) */2577 interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}25782579 /** @name UpDataStructsPropertyKeyPermission (258) */2580 interface UpDataStructsPropertyKeyPermission extends Struct {2581 readonly key: Bytes;2582 readonly permission: UpDataStructsPropertyPermission;2583 }25842585 /** @name UpDataStructsPropertyPermission (259) */2586 interface UpDataStructsPropertyPermission extends Struct {2587 readonly mutable: bool;2588 readonly collectionAdmin: bool;2589 readonly tokenOwner: bool;2590 }25912592 /** @name UpDataStructsProperty (262) */2593 interface UpDataStructsProperty extends Struct {2594 readonly key: Bytes;2595 readonly value: Bytes;2596 }25972598 /** @name UpDataStructsCreateItemData (265) */2599 interface UpDataStructsCreateItemData extends Enum {2600 readonly isNft: boolean;2601 readonly asNft: UpDataStructsCreateNftData;2602 readonly isFungible: boolean;2603 readonly asFungible: UpDataStructsCreateFungibleData;2604 readonly isReFungible: boolean;2605 readonly asReFungible: UpDataStructsCreateReFungibleData;2606 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2607 }26082609 /** @name UpDataStructsCreateNftData (266) */2610 interface UpDataStructsCreateNftData extends Struct {2611 readonly properties: Vec<UpDataStructsProperty>;2612 }26132614 /** @name UpDataStructsCreateFungibleData (267) */2615 interface UpDataStructsCreateFungibleData extends Struct {2616 readonly value: u128;2617 }26182619 /** @name UpDataStructsCreateReFungibleData (268) */2620 interface UpDataStructsCreateReFungibleData extends Struct {2621 readonly pieces: u128;2622 readonly properties: Vec<UpDataStructsProperty>;2623 }26242625 /** @name UpDataStructsCreateItemExData (271) */2626 interface UpDataStructsCreateItemExData extends Enum {2627 readonly isNft: boolean;2628 readonly asNft: Vec<UpDataStructsCreateNftExData>;2629 readonly isFungible: boolean;2630 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2631 readonly isRefungibleMultipleItems: boolean;2632 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2633 readonly isRefungibleMultipleOwners: boolean;2634 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2635 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2636 }26372638 /** @name UpDataStructsCreateNftExData (273) */2639 interface UpDataStructsCreateNftExData extends Struct {2640 readonly properties: Vec<UpDataStructsProperty>;2641 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2642 }26432644 /** @name UpDataStructsCreateRefungibleExSingleOwner (280) */2645 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2646 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2647 readonly pieces: u128;2648 readonly properties: Vec<UpDataStructsProperty>;2649 }26502651 /** @name UpDataStructsCreateRefungibleExMultipleOwners (282) */2652 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2653 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2654 readonly properties: Vec<UpDataStructsProperty>;2655 }26562657 /** @name PalletUniqueSchedulerCall (283) */2658 interface PalletUniqueSchedulerCall extends Enum {2659 readonly isScheduleNamed: boolean;2660 readonly asScheduleNamed: {2661 readonly id: U8aFixed;2662 readonly when: u32;2663 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2664 readonly priority: u8;2665 readonly call: FrameSupportScheduleMaybeHashed;2666 } & Struct;2667 readonly isCancelNamed: boolean;2668 readonly asCancelNamed: {2669 readonly id: U8aFixed;2670 } & Struct;2671 readonly isScheduleNamedAfter: boolean;2672 readonly asScheduleNamedAfter: {2673 readonly id: U8aFixed;2674 readonly after: u32;2675 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2676 readonly priority: u8;2677 readonly call: FrameSupportScheduleMaybeHashed;2678 } & Struct;2679 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';2680 }26812682 /** @name FrameSupportScheduleMaybeHashed (285) */2683 interface FrameSupportScheduleMaybeHashed extends Enum {2684 readonly isValue: boolean;2685 readonly asValue: Call;2686 readonly isHash: boolean;2687 readonly asHash: H256;2688 readonly type: 'Value' | 'Hash';2689 }26902691 /** @name PalletConfigurationCall (286) */2692 interface PalletConfigurationCall extends Enum {2693 readonly isSetWeightToFeeCoefficientOverride: boolean;2694 readonly asSetWeightToFeeCoefficientOverride: {2695 readonly coeff: Option<u32>;2696 } & Struct;2697 readonly isSetMinGasPriceOverride: boolean;2698 readonly asSetMinGasPriceOverride: {2699 readonly coeff: Option<u64>;2700 } & Struct;2701 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';2702 }27032704 /** @name PalletTemplateTransactionPaymentCall (287) */2705 type PalletTemplateTransactionPaymentCall = Null;27062707 /** @name PalletStructureCall (288) */2708 type PalletStructureCall = Null;27092710 /** @name PalletRmrkCoreCall (289) */2711 interface PalletRmrkCoreCall extends Enum {2712 readonly isCreateCollection: boolean;2713 readonly asCreateCollection: {2714 readonly metadata: Bytes;2715 readonly max: Option<u32>;2716 readonly symbol: Bytes;2717 } & Struct;2718 readonly isDestroyCollection: boolean;2719 readonly asDestroyCollection: {2720 readonly collectionId: u32;2721 } & Struct;2722 readonly isChangeCollectionIssuer: boolean;2723 readonly asChangeCollectionIssuer: {2724 readonly collectionId: u32;2725 readonly newIssuer: MultiAddress;2726 } & Struct;2727 readonly isLockCollection: boolean;2728 readonly asLockCollection: {2729 readonly collectionId: u32;2730 } & Struct;2731 readonly isMintNft: boolean;2732 readonly asMintNft: {2733 readonly owner: Option<AccountId32>;2734 readonly collectionId: u32;2735 readonly recipient: Option<AccountId32>;2736 readonly royaltyAmount: Option<Permill>;2737 readonly metadata: Bytes;2738 readonly transferable: bool;2739 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;2740 } & Struct;2741 readonly isBurnNft: boolean;2742 readonly asBurnNft: {2743 readonly collectionId: u32;2744 readonly nftId: u32;2745 readonly maxBurns: u32;2746 } & Struct;2747 readonly isSend: boolean;2748 readonly asSend: {2749 readonly rmrkCollectionId: u32;2750 readonly rmrkNftId: u32;2751 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2752 } & Struct;2753 readonly isAcceptNft: boolean;2754 readonly asAcceptNft: {2755 readonly rmrkCollectionId: u32;2756 readonly rmrkNftId: u32;2757 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2758 } & Struct;2759 readonly isRejectNft: boolean;2760 readonly asRejectNft: {2761 readonly rmrkCollectionId: u32;2762 readonly rmrkNftId: u32;2763 } & Struct;2764 readonly isAcceptResource: boolean;2765 readonly asAcceptResource: {2766 readonly rmrkCollectionId: u32;2767 readonly rmrkNftId: u32;2768 readonly resourceId: u32;2769 } & Struct;2770 readonly isAcceptResourceRemoval: boolean;2771 readonly asAcceptResourceRemoval: {2772 readonly rmrkCollectionId: u32;2773 readonly rmrkNftId: u32;2774 readonly resourceId: u32;2775 } & Struct;2776 readonly isSetProperty: boolean;2777 readonly asSetProperty: {2778 readonly rmrkCollectionId: Compact<u32>;2779 readonly maybeNftId: Option<u32>;2780 readonly key: Bytes;2781 readonly value: Bytes;2782 } & Struct;2783 readonly isSetPriority: boolean;2784 readonly asSetPriority: {2785 readonly rmrkCollectionId: u32;2786 readonly rmrkNftId: u32;2787 readonly priorities: Vec<u32>;2788 } & Struct;2789 readonly isAddBasicResource: boolean;2790 readonly asAddBasicResource: {2791 readonly rmrkCollectionId: u32;2792 readonly nftId: u32;2793 readonly resource: RmrkTraitsResourceBasicResource;2794 } & Struct;2795 readonly isAddComposableResource: boolean;2796 readonly asAddComposableResource: {2797 readonly rmrkCollectionId: u32;2798 readonly nftId: u32;2799 readonly resource: RmrkTraitsResourceComposableResource;2800 } & Struct;2801 readonly isAddSlotResource: boolean;2802 readonly asAddSlotResource: {2803 readonly rmrkCollectionId: u32;2804 readonly nftId: u32;2805 readonly resource: RmrkTraitsResourceSlotResource;2806 } & Struct;2807 readonly isRemoveResource: boolean;2808 readonly asRemoveResource: {2809 readonly rmrkCollectionId: u32;2810 readonly nftId: u32;2811 readonly resourceId: u32;2812 } & Struct;2813 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';2814 }28152816 /** @name RmrkTraitsResourceResourceTypes (295) */2817 interface RmrkTraitsResourceResourceTypes extends Enum {2818 readonly isBasic: boolean;2819 readonly asBasic: RmrkTraitsResourceBasicResource;2820 readonly isComposable: boolean;2821 readonly asComposable: RmrkTraitsResourceComposableResource;2822 readonly isSlot: boolean;2823 readonly asSlot: RmrkTraitsResourceSlotResource;2824 readonly type: 'Basic' | 'Composable' | 'Slot';2825 }28262827 /** @name RmrkTraitsResourceBasicResource (297) */2828 interface RmrkTraitsResourceBasicResource extends Struct {2829 readonly src: Option<Bytes>;2830 readonly metadata: Option<Bytes>;2831 readonly license: Option<Bytes>;2832 readonly thumb: Option<Bytes>;2833 }28342835 /** @name RmrkTraitsResourceComposableResource (299) */2836 interface RmrkTraitsResourceComposableResource extends Struct {2837 readonly parts: Vec<u32>;2838 readonly base: u32;2839 readonly src: Option<Bytes>;2840 readonly metadata: Option<Bytes>;2841 readonly license: Option<Bytes>;2842 readonly thumb: Option<Bytes>;2843 }28442845 /** @name RmrkTraitsResourceSlotResource (300) */2846 interface RmrkTraitsResourceSlotResource extends Struct {2847 readonly base: u32;2848 readonly src: Option<Bytes>;2849 readonly metadata: Option<Bytes>;2850 readonly slot: u32;2851 readonly license: Option<Bytes>;2852 readonly thumb: Option<Bytes>;2853 }28542855 /** @name PalletRmrkEquipCall (303) */2856 interface PalletRmrkEquipCall extends Enum {2857 readonly isCreateBase: boolean;2858 readonly asCreateBase: {2859 readonly baseType: Bytes;2860 readonly symbol: Bytes;2861 readonly parts: Vec<RmrkTraitsPartPartType>;2862 } & Struct;2863 readonly isThemeAdd: boolean;2864 readonly asThemeAdd: {2865 readonly baseId: u32;2866 readonly theme: RmrkTraitsTheme;2867 } & Struct;2868 readonly isEquippable: boolean;2869 readonly asEquippable: {2870 readonly baseId: u32;2871 readonly slotId: u32;2872 readonly equippables: RmrkTraitsPartEquippableList;2873 } & Struct;2874 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';2875 }28762877 /** @name RmrkTraitsPartPartType (306) */2878 interface RmrkTraitsPartPartType extends Enum {2879 readonly isFixedPart: boolean;2880 readonly asFixedPart: RmrkTraitsPartFixedPart;2881 readonly isSlotPart: boolean;2882 readonly asSlotPart: RmrkTraitsPartSlotPart;2883 readonly type: 'FixedPart' | 'SlotPart';2884 }28852886 /** @name RmrkTraitsPartFixedPart (308) */2887 interface RmrkTraitsPartFixedPart extends Struct {2888 readonly id: u32;2889 readonly z: u32;2890 readonly src: Bytes;2891 }28922893 /** @name RmrkTraitsPartSlotPart (309) */2894 interface RmrkTraitsPartSlotPart extends Struct {2895 readonly id: u32;2896 readonly equippable: RmrkTraitsPartEquippableList;2897 readonly src: Bytes;2898 readonly z: u32;2899 }29002901 /** @name RmrkTraitsPartEquippableList (310) */2902 interface RmrkTraitsPartEquippableList extends Enum {2903 readonly isAll: boolean;2904 readonly isEmpty: boolean;2905 readonly isCustom: boolean;2906 readonly asCustom: Vec<u32>;2907 readonly type: 'All' | 'Empty' | 'Custom';2908 }29092910 /** @name RmrkTraitsTheme (312) */2911 interface RmrkTraitsTheme extends Struct {2912 readonly name: Bytes;2913 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2914 readonly inherit: bool;2915 }29162917 /** @name RmrkTraitsThemeThemeProperty (314) */2918 interface RmrkTraitsThemeThemeProperty extends Struct {2919 readonly key: Bytes;2920 readonly value: Bytes;2921 }29222923 /** @name PalletAppPromotionCall (316) */2924 interface PalletAppPromotionCall extends Enum {2925 readonly isSetAdminAddress: boolean;2926 readonly asSetAdminAddress: {2927 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;2928 } & Struct;2929 readonly isStake: boolean;2930 readonly asStake: {2931 readonly amount: u128;2932 } & Struct;2933 readonly isUnstake: boolean;2934 readonly isSponsorCollection: boolean;2935 readonly asSponsorCollection: {2936 readonly collectionId: u32;2937 } & Struct;2938 readonly isStopSponsoringCollection: boolean;2939 readonly asStopSponsoringCollection: {2940 readonly collectionId: u32;2941 } & Struct;2942 readonly isSponsorContract: boolean;2943 readonly asSponsorContract: {2944 readonly contractId: H160;2945 } & Struct;2946 readonly isStopSponsoringContract: boolean;2947 readonly asStopSponsoringContract: {2948 readonly contractId: H160;2949 } & Struct;2950 readonly isPayoutStakers: boolean;2951 readonly asPayoutStakers: {2952 readonly stakersNumber: Option<u8>;2953 } & Struct;2954 readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';2955 }29562957 /** @name PalletForeignAssetsModuleCall (318) */2958 interface PalletForeignAssetsModuleCall extends Enum {2959 readonly isRegisterForeignAsset: boolean;2960 readonly asRegisterForeignAsset: {2961 readonly owner: AccountId32;2962 readonly location: XcmVersionedMultiLocation;2963 readonly metadata: PalletForeignAssetsModuleAssetMetadata;2964 } & Struct;2965 readonly isUpdateForeignAsset: boolean;2966 readonly asUpdateForeignAsset: {2967 readonly foreignAssetId: u32;2968 readonly location: XcmVersionedMultiLocation;2969 readonly metadata: PalletForeignAssetsModuleAssetMetadata;2970 } & Struct;2971 readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';2972 }29732974 /** @name PalletEvmCall (319) */2975 interface PalletEvmCall extends Enum {2976 readonly isWithdraw: boolean;2977 readonly asWithdraw: {2978 readonly address: H160;2979 readonly value: u128;2980 } & Struct;2981 readonly isCall: boolean;2982 readonly asCall: {2983 readonly source: H160;2984 readonly target: H160;2985 readonly input: Bytes;2986 readonly value: U256;2987 readonly gasLimit: u64;2988 readonly maxFeePerGas: U256;2989 readonly maxPriorityFeePerGas: Option<U256>;2990 readonly nonce: Option<U256>;2991 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2992 } & Struct;2993 readonly isCreate: boolean;2994 readonly asCreate: {2995 readonly source: H160;2996 readonly init: Bytes;2997 readonly value: U256;2998 readonly gasLimit: u64;2999 readonly maxFeePerGas: U256;3000 readonly maxPriorityFeePerGas: Option<U256>;3001 readonly nonce: Option<U256>;3002 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;3003 } & Struct;3004 readonly isCreate2: boolean;3005 readonly asCreate2: {3006 readonly source: H160;3007 readonly init: Bytes;3008 readonly salt: H256;3009 readonly value: U256;3010 readonly gasLimit: u64;3011 readonly maxFeePerGas: U256;3012 readonly maxPriorityFeePerGas: Option<U256>;3013 readonly nonce: Option<U256>;3014 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;3015 } & Struct;3016 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';3017 }30183019 /** @name PalletEthereumCall (323) */3020 interface PalletEthereumCall extends Enum {3021 readonly isTransact: boolean;3022 readonly asTransact: {3023 readonly transaction: EthereumTransactionTransactionV2;3024 } & Struct;3025 readonly type: 'Transact';3026 }30273028 /** @name EthereumTransactionTransactionV2 (324) */3029 interface EthereumTransactionTransactionV2 extends Enum {3030 readonly isLegacy: boolean;3031 readonly asLegacy: EthereumTransactionLegacyTransaction;3032 readonly isEip2930: boolean;3033 readonly asEip2930: EthereumTransactionEip2930Transaction;3034 readonly isEip1559: boolean;3035 readonly asEip1559: EthereumTransactionEip1559Transaction;3036 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3037 }30383039 /** @name EthereumTransactionLegacyTransaction (325) */3040 interface EthereumTransactionLegacyTransaction extends Struct {3041 readonly nonce: U256;3042 readonly gasPrice: U256;3043 readonly gasLimit: U256;3044 readonly action: EthereumTransactionTransactionAction;3045 readonly value: U256;3046 readonly input: Bytes;3047 readonly signature: EthereumTransactionTransactionSignature;3048 }30493050 /** @name EthereumTransactionTransactionAction (326) */3051 interface EthereumTransactionTransactionAction extends Enum {3052 readonly isCall: boolean;3053 readonly asCall: H160;3054 readonly isCreate: boolean;3055 readonly type: 'Call' | 'Create';3056 }30573058 /** @name EthereumTransactionTransactionSignature (327) */3059 interface EthereumTransactionTransactionSignature extends Struct {3060 readonly v: u64;3061 readonly r: H256;3062 readonly s: H256;3063 }30643065 /** @name EthereumTransactionEip2930Transaction (329) */3066 interface EthereumTransactionEip2930Transaction extends Struct {3067 readonly chainId: u64;3068 readonly nonce: U256;3069 readonly gasPrice: U256;3070 readonly gasLimit: U256;3071 readonly action: EthereumTransactionTransactionAction;3072 readonly value: U256;3073 readonly input: Bytes;3074 readonly accessList: Vec<EthereumTransactionAccessListItem>;3075 readonly oddYParity: bool;3076 readonly r: H256;3077 readonly s: H256;3078 }30793080 /** @name EthereumTransactionAccessListItem (331) */3081 interface EthereumTransactionAccessListItem extends Struct {3082 readonly address: H160;3083 readonly storageKeys: Vec<H256>;3084 }30853086 /** @name EthereumTransactionEip1559Transaction (332) */3087 interface EthereumTransactionEip1559Transaction extends Struct {3088 readonly chainId: u64;3089 readonly nonce: U256;3090 readonly maxPriorityFeePerGas: U256;3091 readonly maxFeePerGas: U256;3092 readonly gasLimit: U256;3093 readonly action: EthereumTransactionTransactionAction;3094 readonly value: U256;3095 readonly input: Bytes;3096 readonly accessList: Vec<EthereumTransactionAccessListItem>;3097 readonly oddYParity: bool;3098 readonly r: H256;3099 readonly s: H256;3100 }31013102 /** @name PalletEvmMigrationCall (333) */3103 interface PalletEvmMigrationCall extends Enum {3104 readonly isBegin: boolean;3105 readonly asBegin: {3106 readonly address: H160;3107 } & Struct;3108 readonly isSetData: boolean;3109 readonly asSetData: {3110 readonly address: H160;3111 readonly data: Vec<ITuple<[H256, H256]>>;3112 } & Struct;3113 readonly isFinish: boolean;3114 readonly asFinish: {3115 readonly address: H160;3116 readonly code: Bytes;3117 } & Struct;3118 readonly type: 'Begin' | 'SetData' | 'Finish';3119 }31203121 /** @name PalletSudoError (336) */3122 interface PalletSudoError extends Enum {3123 readonly isRequireSudo: boolean;3124 readonly type: 'RequireSudo';3125 }31263127 /** @name OrmlVestingModuleError (338) */3128 interface OrmlVestingModuleError extends Enum {3129 readonly isZeroVestingPeriod: boolean;3130 readonly isZeroVestingPeriodCount: boolean;3131 readonly isInsufficientBalanceToLock: boolean;3132 readonly isTooManyVestingSchedules: boolean;3133 readonly isAmountLow: boolean;3134 readonly isMaxVestingSchedulesExceeded: boolean;3135 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';3136 }31373138 /** @name OrmlXtokensModuleError (339) */3139 interface OrmlXtokensModuleError extends Enum {3140 readonly isAssetHasNoReserve: boolean;3141 readonly isNotCrossChainTransfer: boolean;3142 readonly isInvalidDest: boolean;3143 readonly isNotCrossChainTransferableCurrency: boolean;3144 readonly isUnweighableMessage: boolean;3145 readonly isXcmExecutionFailed: boolean;3146 readonly isCannotReanchor: boolean;3147 readonly isInvalidAncestry: boolean;3148 readonly isInvalidAsset: boolean;3149 readonly isDestinationNotInvertible: boolean;3150 readonly isBadVersion: boolean;3151 readonly isDistinctReserveForAssetAndFee: boolean;3152 readonly isZeroFee: boolean;3153 readonly isZeroAmount: boolean;3154 readonly isTooManyAssetsBeingSent: boolean;3155 readonly isAssetIndexNonExistent: boolean;3156 readonly isFeeNotEnough: boolean;3157 readonly isNotSupportedMultiLocation: boolean;3158 readonly isMinXcmFeeNotDefined: boolean;3159 readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';3160 }31613162 /** @name OrmlTokensBalanceLock (342) */3163 interface OrmlTokensBalanceLock extends Struct {3164 readonly id: U8aFixed;3165 readonly amount: u128;3166 }31673168 /** @name OrmlTokensAccountData (344) */3169 interface OrmlTokensAccountData extends Struct {3170 readonly free: u128;3171 readonly reserved: u128;3172 readonly frozen: u128;3173 }31743175 /** @name OrmlTokensReserveData (346) */3176 interface OrmlTokensReserveData extends Struct {3177 readonly id: Null;3178 readonly amount: u128;3179 }31803181 /** @name OrmlTokensModuleError (348) */3182 interface OrmlTokensModuleError extends Enum {3183 readonly isBalanceTooLow: boolean;3184 readonly isAmountIntoBalanceFailed: boolean;3185 readonly isLiquidityRestrictions: boolean;3186 readonly isMaxLocksExceeded: boolean;3187 readonly isKeepAlive: boolean;3188 readonly isExistentialDeposit: boolean;3189 readonly isDeadAccount: boolean;3190 readonly isTooManyReserves: boolean;3191 readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';3192 }31933194 /** @name CumulusPalletXcmpQueueInboundChannelDetails (350) */3195 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {3196 readonly sender: u32;3197 readonly state: CumulusPalletXcmpQueueInboundState;3198 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;3199 }32003201 /** @name CumulusPalletXcmpQueueInboundState (351) */3202 interface CumulusPalletXcmpQueueInboundState extends Enum {3203 readonly isOk: boolean;3204 readonly isSuspended: boolean;3205 readonly type: 'Ok' | 'Suspended';3206 }32073208 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (354) */3209 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {3210 readonly isConcatenatedVersionedXcm: boolean;3211 readonly isConcatenatedEncodedBlob: boolean;3212 readonly isSignals: boolean;3213 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';3214 }32153216 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (357) */3217 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {3218 readonly recipient: u32;3219 readonly state: CumulusPalletXcmpQueueOutboundState;3220 readonly signalsExist: bool;3221 readonly firstIndex: u16;3222 readonly lastIndex: u16;3223 }32243225 /** @name CumulusPalletXcmpQueueOutboundState (358) */3226 interface CumulusPalletXcmpQueueOutboundState extends Enum {3227 readonly isOk: boolean;3228 readonly isSuspended: boolean;3229 readonly type: 'Ok' | 'Suspended';3230 }32313232 /** @name CumulusPalletXcmpQueueQueueConfigData (360) */3233 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {3234 readonly suspendThreshold: u32;3235 readonly dropThreshold: u32;3236 readonly resumeThreshold: u32;3237 readonly thresholdWeight: u64;3238 readonly weightRestrictDecay: u64;3239 readonly xcmpMaxIndividualWeight: u64;3240 }32413242 /** @name CumulusPalletXcmpQueueError (362) */3243 interface CumulusPalletXcmpQueueError extends Enum {3244 readonly isFailedToSend: boolean;3245 readonly isBadXcmOrigin: boolean;3246 readonly isBadXcm: boolean;3247 readonly isBadOverweightIndex: boolean;3248 readonly isWeightOverLimit: boolean;3249 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';3250 }32513252 /** @name PalletXcmError (363) */3253 interface PalletXcmError extends Enum {3254 readonly isUnreachable: boolean;3255 readonly isSendFailure: boolean;3256 readonly isFiltered: boolean;3257 readonly isUnweighableMessage: boolean;3258 readonly isDestinationNotInvertible: boolean;3259 readonly isEmpty: boolean;3260 readonly isCannotReanchor: boolean;3261 readonly isTooManyAssets: boolean;3262 readonly isInvalidOrigin: boolean;3263 readonly isBadVersion: boolean;3264 readonly isBadLocation: boolean;3265 readonly isNoSubscription: boolean;3266 readonly isAlreadySubscribed: boolean;3267 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';3268 }32693270 /** @name CumulusPalletXcmError (364) */3271 type CumulusPalletXcmError = Null;32723273 /** @name CumulusPalletDmpQueueConfigData (365) */3274 interface CumulusPalletDmpQueueConfigData extends Struct {3275 readonly maxIndividual: u64;3276 }32773278 /** @name CumulusPalletDmpQueuePageIndexData (366) */3279 interface CumulusPalletDmpQueuePageIndexData extends Struct {3280 readonly beginUsed: u32;3281 readonly endUsed: u32;3282 readonly overweightCount: u64;3283 }32843285 /** @name CumulusPalletDmpQueueError (369) */3286 interface CumulusPalletDmpQueueError extends Enum {3287 readonly isUnknown: boolean;3288 readonly isOverLimit: boolean;3289 readonly type: 'Unknown' | 'OverLimit';3290 }32913292 /** @name PalletUniqueError (373) */3293 interface PalletUniqueError extends Enum {3294 readonly isCollectionDecimalPointLimitExceeded: boolean;3295 readonly isConfirmUnsetSponsorFail: boolean;3296 readonly isEmptyArgument: boolean;3297 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;3298 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';3299 }33003301 /** @name PalletUniqueSchedulerScheduledV3 (376) */3302 interface PalletUniqueSchedulerScheduledV3 extends Struct {3303 readonly maybeId: Option<U8aFixed>;3304 readonly priority: u8;3305 readonly call: FrameSupportScheduleMaybeHashed;3306 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;3307 readonly origin: OpalRuntimeOriginCaller;3308 }33093310 /** @name OpalRuntimeOriginCaller (377) */3311 interface OpalRuntimeOriginCaller extends Enum {3312 readonly isSystem: boolean;3313 readonly asSystem: FrameSupportDispatchRawOrigin;3314 readonly isVoid: boolean;3315 readonly isPolkadotXcm: boolean;3316 readonly asPolkadotXcm: PalletXcmOrigin;3317 readonly isCumulusXcm: boolean;3318 readonly asCumulusXcm: CumulusPalletXcmOrigin;3319 readonly isEthereum: boolean;3320 readonly asEthereum: PalletEthereumRawOrigin;3321 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';3322 }33233324 /** @name FrameSupportDispatchRawOrigin (378) */3325 interface FrameSupportDispatchRawOrigin extends Enum {3326 readonly isRoot: boolean;3327 readonly isSigned: boolean;3328 readonly asSigned: AccountId32;3329 readonly isNone: boolean;3330 readonly type: 'Root' | 'Signed' | 'None';3331 }33323333 /** @name PalletXcmOrigin (379) */3334 interface PalletXcmOrigin extends Enum {3335 readonly isXcm: boolean;3336 readonly asXcm: XcmV1MultiLocation;3337 readonly isResponse: boolean;3338 readonly asResponse: XcmV1MultiLocation;3339 readonly type: 'Xcm' | 'Response';3340 }33413342 /** @name CumulusPalletXcmOrigin (380) */3343 interface CumulusPalletXcmOrigin extends Enum {3344 readonly isRelay: boolean;3345 readonly isSiblingParachain: boolean;3346 readonly asSiblingParachain: u32;3347 readonly type: 'Relay' | 'SiblingParachain';3348 }33493350 /** @name PalletEthereumRawOrigin (381) */3351 interface PalletEthereumRawOrigin extends Enum {3352 readonly isEthereumTransaction: boolean;3353 readonly asEthereumTransaction: H160;3354 readonly type: 'EthereumTransaction';3355 }33563357 /** @name SpCoreVoid (382) */3358 type SpCoreVoid = Null;33593360 /** @name PalletUniqueSchedulerError (383) */3361 interface PalletUniqueSchedulerError extends Enum {3362 readonly isFailedToSchedule: boolean;3363 readonly isNotFound: boolean;3364 readonly isTargetBlockNumberInPast: boolean;3365 readonly isRescheduleNoChange: boolean;3366 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';3367 }33683369 /** @name UpDataStructsCollection (384) */3370 interface UpDataStructsCollection extends Struct {3371 readonly owner: AccountId32;3372 readonly mode: UpDataStructsCollectionMode;3373 readonly name: Vec<u16>;3374 readonly description: Vec<u16>;3375 readonly tokenPrefix: Bytes;3376 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3377 readonly limits: UpDataStructsCollectionLimits;3378 readonly permissions: UpDataStructsCollectionPermissions;3379 readonly flags: U8aFixed;3380 }33813382 /** @name UpDataStructsSponsorshipStateAccountId32 (385) */3383 interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3384 readonly isDisabled: boolean;3385 readonly isUnconfirmed: boolean;3386 readonly asUnconfirmed: AccountId32;3387 readonly isConfirmed: boolean;3388 readonly asConfirmed: AccountId32;3389 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3390 }33913392 /** @name UpDataStructsProperties (387) */3393 interface UpDataStructsProperties extends Struct {3394 readonly map: UpDataStructsPropertiesMapBoundedVec;3395 readonly consumedSpace: u32;3396 readonly spaceLimit: u32;3397 }33983399 /** @name UpDataStructsPropertiesMapBoundedVec (388) */3400 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}34013402 /** @name UpDataStructsPropertiesMapPropertyPermission (393) */3403 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}34043405 /** @name UpDataStructsCollectionStats (400) */3406 interface UpDataStructsCollectionStats extends Struct {3407 readonly created: u32;3408 readonly destroyed: u32;3409 readonly alive: u32;3410 }34113412 /** @name UpDataStructsTokenChild (401) */3413 interface UpDataStructsTokenChild extends Struct {3414 readonly token: u32;3415 readonly collection: u32;3416 }34173418 /** @name PhantomTypeUpDataStructs (402) */3419 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}34203421 /** @name UpDataStructsTokenData (404) */3422 interface UpDataStructsTokenData extends Struct {3423 readonly properties: Vec<UpDataStructsProperty>;3424 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3425 readonly pieces: u128;3426 }34273428 /** @name UpDataStructsRpcCollection (406) */3429 interface UpDataStructsRpcCollection extends Struct {3430 readonly owner: AccountId32;3431 readonly mode: UpDataStructsCollectionMode;3432 readonly name: Vec<u16>;3433 readonly description: Vec<u16>;3434 readonly tokenPrefix: Bytes;3435 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3436 readonly limits: UpDataStructsCollectionLimits;3437 readonly permissions: UpDataStructsCollectionPermissions;3438 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3439 readonly properties: Vec<UpDataStructsProperty>;3440 readonly readOnly: bool;3441 readonly foreign: bool;3442 }34433444 /** @name RmrkTraitsCollectionCollectionInfo (407) */3445 interface RmrkTraitsCollectionCollectionInfo extends Struct {3446 readonly issuer: AccountId32;3447 readonly metadata: Bytes;3448 readonly max: Option<u32>;3449 readonly symbol: Bytes;3450 readonly nftsCount: u32;3451 }34523453 /** @name RmrkTraitsNftNftInfo (408) */3454 interface RmrkTraitsNftNftInfo extends Struct {3455 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;3456 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;3457 readonly metadata: Bytes;3458 readonly equipped: bool;3459 readonly pending: bool;3460 }34613462 /** @name RmrkTraitsNftRoyaltyInfo (410) */3463 interface RmrkTraitsNftRoyaltyInfo extends Struct {3464 readonly recipient: AccountId32;3465 readonly amount: Permill;3466 }34673468 /** @name RmrkTraitsResourceResourceInfo (411) */3469 interface RmrkTraitsResourceResourceInfo extends Struct {3470 readonly id: u32;3471 readonly resource: RmrkTraitsResourceResourceTypes;3472 readonly pending: bool;3473 readonly pendingRemoval: bool;3474 }34753476 /** @name RmrkTraitsPropertyPropertyInfo (412) */3477 interface RmrkTraitsPropertyPropertyInfo extends Struct {3478 readonly key: Bytes;3479 readonly value: Bytes;3480 }34813482 /** @name RmrkTraitsBaseBaseInfo (413) */3483 interface RmrkTraitsBaseBaseInfo extends Struct {3484 readonly issuer: AccountId32;3485 readonly baseType: Bytes;3486 readonly symbol: Bytes;3487 }34883489 /** @name RmrkTraitsNftNftChild (414) */3490 interface RmrkTraitsNftNftChild extends Struct {3491 readonly collectionId: u32;3492 readonly nftId: u32;3493 }34943495 /** @name PalletCommonError (416) */3496 interface PalletCommonError extends Enum {3497 readonly isCollectionNotFound: boolean;3498 readonly isMustBeTokenOwner: boolean;3499 readonly isNoPermission: boolean;3500 readonly isCantDestroyNotEmptyCollection: boolean;3501 readonly isPublicMintingNotAllowed: boolean;3502 readonly isAddressNotInAllowlist: boolean;3503 readonly isCollectionNameLimitExceeded: boolean;3504 readonly isCollectionDescriptionLimitExceeded: boolean;3505 readonly isCollectionTokenPrefixLimitExceeded: boolean;3506 readonly isTotalCollectionsLimitExceeded: boolean;3507 readonly isCollectionAdminCountExceeded: boolean;3508 readonly isCollectionLimitBoundsExceeded: boolean;3509 readonly isOwnerPermissionsCantBeReverted: boolean;3510 readonly isTransferNotAllowed: boolean;3511 readonly isAccountTokenLimitExceeded: boolean;3512 readonly isCollectionTokenLimitExceeded: boolean;3513 readonly isMetadataFlagFrozen: boolean;3514 readonly isTokenNotFound: boolean;3515 readonly isTokenValueTooLow: boolean;3516 readonly isApprovedValueTooLow: boolean;3517 readonly isCantApproveMoreThanOwned: boolean;3518 readonly isAddressIsZero: boolean;3519 readonly isUnsupportedOperation: boolean;3520 readonly isNotSufficientFounds: boolean;3521 readonly isUserIsNotAllowedToNest: boolean;3522 readonly isSourceCollectionIsNotAllowedToNest: boolean;3523 readonly isCollectionFieldSizeExceeded: boolean;3524 readonly isNoSpaceForProperty: boolean;3525 readonly isPropertyLimitReached: boolean;3526 readonly isPropertyKeyIsTooLong: boolean;3527 readonly isInvalidCharacterInPropertyKey: boolean;3528 readonly isEmptyPropertyKey: boolean;3529 readonly isCollectionIsExternal: boolean;3530 readonly isCollectionIsInternal: boolean;3531 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';3532 }35333534 /** @name PalletFungibleError (418) */3535 interface PalletFungibleError extends Enum {3536 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;3537 readonly isFungibleItemsHaveNoId: boolean;3538 readonly isFungibleItemsDontHaveData: boolean;3539 readonly isFungibleDisallowsNesting: boolean;3540 readonly isSettingPropertiesNotAllowed: boolean;3541 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3542 }35433544 /** @name PalletRefungibleItemData (419) */3545 interface PalletRefungibleItemData extends Struct {3546 readonly constData: Bytes;3547 }35483549 /** @name PalletRefungibleError (424) */3550 interface PalletRefungibleError extends Enum {3551 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;3552 readonly isWrongRefungiblePieces: boolean;3553 readonly isRepartitionWhileNotOwningAllPieces: boolean;3554 readonly isRefungibleDisallowsNesting: boolean;3555 readonly isSettingPropertiesNotAllowed: boolean;3556 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3557 }35583559 /** @name PalletNonfungibleItemData (425) */3560 interface PalletNonfungibleItemData extends Struct {3561 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3562 }35633564 /** @name UpDataStructsPropertyScope (427) */3565 interface UpDataStructsPropertyScope extends Enum {3566 readonly isNone: boolean;3567 readonly isRmrk: boolean;3568 readonly type: 'None' | 'Rmrk';3569 }35703571 /** @name PalletNonfungibleError (429) */3572 interface PalletNonfungibleError extends Enum {3573 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;3574 readonly isNonfungibleItemsHaveNoAmount: boolean;3575 readonly isCantBurnNftWithChildren: boolean;3576 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';3577 }35783579 /** @name PalletStructureError (430) */3580 interface PalletStructureError extends Enum {3581 readonly isOuroborosDetected: boolean;3582 readonly isDepthLimit: boolean;3583 readonly isBreadthLimit: boolean;3584 readonly isTokenNotFound: boolean;3585 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';3586 }35873588 /** @name PalletRmrkCoreError (431) */3589 interface PalletRmrkCoreError extends Enum {3590 readonly isCorruptedCollectionType: boolean;3591 readonly isRmrkPropertyKeyIsTooLong: boolean;3592 readonly isRmrkPropertyValueIsTooLong: boolean;3593 readonly isRmrkPropertyIsNotFound: boolean;3594 readonly isUnableToDecodeRmrkData: boolean;3595 readonly isCollectionNotEmpty: boolean;3596 readonly isNoAvailableCollectionId: boolean;3597 readonly isNoAvailableNftId: boolean;3598 readonly isCollectionUnknown: boolean;3599 readonly isNoPermission: boolean;3600 readonly isNonTransferable: boolean;3601 readonly isCollectionFullOrLocked: boolean;3602 readonly isResourceDoesntExist: boolean;3603 readonly isCannotSendToDescendentOrSelf: boolean;3604 readonly isCannotAcceptNonOwnedNft: boolean;3605 readonly isCannotRejectNonOwnedNft: boolean;3606 readonly isCannotRejectNonPendingNft: boolean;3607 readonly isResourceNotPending: boolean;3608 readonly isNoAvailableResourceId: boolean;3609 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';3610 }36113612 /** @name PalletRmrkEquipError (433) */3613 interface PalletRmrkEquipError extends Enum {3614 readonly isPermissionError: boolean;3615 readonly isNoAvailableBaseId: boolean;3616 readonly isNoAvailablePartId: boolean;3617 readonly isBaseDoesntExist: boolean;3618 readonly isNeedsDefaultThemeFirst: boolean;3619 readonly isPartDoesntExist: boolean;3620 readonly isNoEquippableOnFixedPart: boolean;3621 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';3622 }36233624 /** @name PalletAppPromotionError (439) */3625 interface PalletAppPromotionError extends Enum {3626 readonly isAdminNotSet: boolean;3627 readonly isNoPermission: boolean;3628 readonly isNotSufficientFunds: boolean;3629 readonly isPendingForBlockOverflow: boolean;3630 readonly isSponsorNotSet: boolean;3631 readonly isIncorrectLockedBalanceOperation: boolean;3632 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';3633 }36343635 /** @name PalletForeignAssetsModuleError (440) */3636 interface PalletForeignAssetsModuleError extends Enum {3637 readonly isBadLocation: boolean;3638 readonly isMultiLocationExisted: boolean;3639 readonly isAssetIdNotExists: boolean;3640 readonly isAssetIdExisted: boolean;3641 readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';3642 }36433644 /** @name PalletEvmError (443) */3645 interface PalletEvmError extends Enum {3646 readonly isBalanceLow: boolean;3647 readonly isFeeOverflow: boolean;3648 readonly isPaymentOverflow: boolean;3649 readonly isWithdrawFailed: boolean;3650 readonly isGasPriceTooLow: boolean;3651 readonly isInvalidNonce: boolean;3652 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';3653 }36543655 /** @name FpRpcTransactionStatus (446) */3656 interface FpRpcTransactionStatus extends Struct {3657 readonly transactionHash: H256;3658 readonly transactionIndex: u32;3659 readonly from: H160;3660 readonly to: Option<H160>;3661 readonly contractAddress: Option<H160>;3662 readonly logs: Vec<EthereumLog>;3663 readonly logsBloom: EthbloomBloom;3664 }36653666 /** @name EthbloomBloom (448) */3667 interface EthbloomBloom extends U8aFixed {}36683669 /** @name EthereumReceiptReceiptV3 (450) */3670 interface EthereumReceiptReceiptV3 extends Enum {3671 readonly isLegacy: boolean;3672 readonly asLegacy: EthereumReceiptEip658ReceiptData;3673 readonly isEip2930: boolean;3674 readonly asEip2930: EthereumReceiptEip658ReceiptData;3675 readonly isEip1559: boolean;3676 readonly asEip1559: EthereumReceiptEip658ReceiptData;3677 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3678 }36793680 /** @name EthereumReceiptEip658ReceiptData (451) */3681 interface EthereumReceiptEip658ReceiptData extends Struct {3682 readonly statusCode: u8;3683 readonly usedGas: U256;3684 readonly logsBloom: EthbloomBloom;3685 readonly logs: Vec<EthereumLog>;3686 }36873688 /** @name EthereumBlock (452) */3689 interface EthereumBlock extends Struct {3690 readonly header: EthereumHeader;3691 readonly transactions: Vec<EthereumTransactionTransactionV2>;3692 readonly ommers: Vec<EthereumHeader>;3693 }36943695 /** @name EthereumHeader (453) */3696 interface EthereumHeader extends Struct {3697 readonly parentHash: H256;3698 readonly ommersHash: H256;3699 readonly beneficiary: H160;3700 readonly stateRoot: H256;3701 readonly transactionsRoot: H256;3702 readonly receiptsRoot: H256;3703 readonly logsBloom: EthbloomBloom;3704 readonly difficulty: U256;3705 readonly number: U256;3706 readonly gasLimit: U256;3707 readonly gasUsed: U256;3708 readonly timestamp: u64;3709 readonly extraData: Bytes;3710 readonly mixHash: H256;3711 readonly nonce: EthereumTypesHashH64;3712 }37133714 /** @name EthereumTypesHashH64 (454) */3715 interface EthereumTypesHashH64 extends U8aFixed {}37163717 /** @name PalletEthereumError (459) */3718 interface PalletEthereumError extends Enum {3719 readonly isInvalidSignature: boolean;3720 readonly isPreLogExists: boolean;3721 readonly type: 'InvalidSignature' | 'PreLogExists';3722 }37233724 /** @name PalletEvmCoderSubstrateError (460) */3725 interface PalletEvmCoderSubstrateError extends Enum {3726 readonly isOutOfGas: boolean;3727 readonly isOutOfFund: boolean;3728 readonly type: 'OutOfGas' | 'OutOfFund';3729 }37303731 /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (461) */3732 interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {3733 readonly isDisabled: boolean;3734 readonly isUnconfirmed: boolean;3735 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3736 readonly isConfirmed: boolean;3737 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3738 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3739 }37403741 /** @name PalletEvmContractHelpersSponsoringModeT (462) */3742 interface PalletEvmContractHelpersSponsoringModeT extends Enum {3743 readonly isDisabled: boolean;3744 readonly isAllowlisted: boolean;3745 readonly isGenerous: boolean;3746 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';3747 }37483749 /** @name PalletEvmContractHelpersError (468) */3750 interface PalletEvmContractHelpersError extends Enum {3751 readonly isNoPermission: boolean;3752 readonly isNoPendingSponsor: boolean;3753 readonly isTooManyMethodsHaveSponsoredLimit: boolean;3754 readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';3755 }37563757 /** @name PalletEvmMigrationError (469) */3758 interface PalletEvmMigrationError extends Enum {3759 readonly isAccountNotEmpty: boolean;3760 readonly isAccountIsNotMigrating: boolean;3761 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';3762 }37633764 /** @name SpRuntimeMultiSignature (471) */3765 interface SpRuntimeMultiSignature extends Enum {3766 readonly isEd25519: boolean;3767 readonly asEd25519: SpCoreEd25519Signature;3768 readonly isSr25519: boolean;3769 readonly asSr25519: SpCoreSr25519Signature;3770 readonly isEcdsa: boolean;3771 readonly asEcdsa: SpCoreEcdsaSignature;3772 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';3773 }37743775 /** @name SpCoreEd25519Signature (472) */3776 interface SpCoreEd25519Signature extends U8aFixed {}37773778 /** @name SpCoreSr25519Signature (474) */3779 interface SpCoreSr25519Signature extends U8aFixed {}37803781 /** @name SpCoreEcdsaSignature (475) */3782 interface SpCoreEcdsaSignature extends U8aFixed {}37833784 /** @name FrameSystemExtensionsCheckSpecVersion (478) */3785 type FrameSystemExtensionsCheckSpecVersion = Null;37863787 /** @name FrameSystemExtensionsCheckGenesis (479) */3788 type FrameSystemExtensionsCheckGenesis = Null;37893790 /** @name FrameSystemExtensionsCheckNonce (482) */3791 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}37923793 /** @name FrameSystemExtensionsCheckWeight (483) */3794 type FrameSystemExtensionsCheckWeight = Null;37953796 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (484) */3797 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}37983799 /** @name OpalRuntimeRuntime (485) */3800 type OpalRuntimeRuntime = Null;38013802 /** @name PalletEthereumFakeTransactionFinalizer (486) */3803 type PalletEthereumFakeTransactionFinalizer = Null;38043805} // declare moduletests/src/mintModes.test.tsdiffbeforeafterboth--- a/tests/src/mintModes.test.ts
+++ /dev/null
@@ -1,148 +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 usingApi from './substrate/substrate-api';
-import {
- addToAllowListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectFailure,
- createItemExpectSuccess,
- enableAllowListExpectSuccess,
- setMintPermissionExpectSuccess,
- addCollectionAdminExpectSuccess,
- disableAllowListExpectSuccess,
-} from './util/helpers';
-
-describe('Integration Test public minting', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('If the AllowList mode is enabled, then the address added to the allowlist and not the owner or administrator can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
-
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is regular user cannot create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, collection admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, regular user can`t create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-});
-
-describe('Integration Test private minting', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('Address that is the not owner or not admin cannot create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-
- it('Address that is collection owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('Address that is admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-});
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -45,6 +45,8 @@
'nonfungible',
'charging',
'configuration',
+ 'tokens',
+ 'xtokens',
];
// Pallets that depend on consensus and governance configuration
@@ -61,13 +63,20 @@
const refungible = 'refungible';
const scheduler = 'scheduler';
+ const foreignAssets = 'foreignassets';
const rmrkPallets = ['rmrkcore', 'rmrkequip'];
const appPromotion = 'apppromotion';
if (chain.eq('OPAL by UNIQUE')) {
- requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets);
+ requiredPallets.push(
+ refungible,
+ scheduler,
+ foreignAssets,
+ appPromotion,
+ ...rmrkPallets,
+ );
} else if (chain.eq('QUARTZ by UNIQUE')) {
- // Insert Quartz additional pallets here
+ requiredPallets.push(refungible);
} else if (chain.eq('UNIQUE')) {
// Insert Unique additional pallets here
}
tests/src/refungible.test.tsdiffbeforeafterboth--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -17,17 +17,18 @@
import {IKeyringPair} from '@polkadot/types/types';
import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds';
-let alice: IKeyringPair;
-let bob: IKeyringPair;
const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;
describe('integration test: Refungible functionality:', async () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor);
});
});
@@ -209,36 +210,38 @@
const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 200n);
- const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event);
- expect(chainEvents).to.include.deep.members([{
- method: 'ItemCreated',
+ const chainEvents = helper.chainLog.slice(-1)[0].events;
+ expect(chainEvents).to.deep.include({
section: 'common',
- index: '0x4202',
- data: [
- helper.api!.createType('u32', collection.collectionId).toHuman(),
- helper.api!.createType('u32', token.tokenId).toHuman(),
- {Substrate: alice.address},
- '100',
+ method: 'ItemCreated',
+ index: [66, 2],
+ data: [
+ collection.collectionId,
+ token.tokenId,
+ {substrate: alice.address},
+ 100n,
],
- }]);
+ phase: {applyExtrinsic: 2},
+ });
});
itSub('Repartition with decreased amount', async ({helper}) => {
const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 50n);
- const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event);
- expect(chainEvents).to.include.deep.members([{
+ const chainEvents = helper.chainLog.slice(-1)[0].events;
+ expect(chainEvents).to.deep.include({
method: 'ItemDestroyed',
section: 'common',
- index: '0x4203',
- data: [
- helper.api!.createType('u32', collection.collectionId).toHuman(),
- helper.api!.createType('u32', token.tokenId).toHuman(),
- {Substrate: alice.address},
- '50',
+ index: [66, 3],
+ data: [
+ collection.collectionId,
+ token.tokenId,
+ {substrate: alice.address},
+ 50n,
],
- }]);
+ phase: {applyExtrinsic: 2},
+ });
});
itSub('Create new collection with properties', async ({helper}) => {
tests/src/removeFromAllowList.test.tsdiffbeforeafterboth--- a/tests/src/removeFromAllowList.test.ts
+++ /dev/null
@@ -1,134 +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 {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test removeFromAllowList', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('ensure bob is not in allowlist after removal', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-1', tokenPrefix: 'RFAL'});
-
- const collectionInfo = await collection.getData();
- expect(collectionInfo!.raw.permissions.access).to.not.equal('AllowList');
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address});
-
- await collection.removeFromAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('allows removal from collection with unset allowlist status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-2', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address});
-
- await collection.setPermissions(alice, {access: 'Normal'});
-
- await collection.removeFromAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.be.empty;
- });
-});
-
-describe('Negative Integration Test removeFromAllowList', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('fails on removal from not existing collection', async ({helper}) => {
- const nonExistentCollectionId = (1 << 32) - 1;
- await expect(helper.collection.removeFromAllowList(alice, nonExistentCollectionId, {Substrate: alice.address}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails on removal from removed collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-3', tokenPrefix: 'RFAL'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await collection.burn(alice);
- await expect(collection.removeFromAllowList(alice, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-});
-
-describe('Integration Test removeFromAllowList with collection admin permissions', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
- let charlie: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
- });
- });
-
- itSub('ensure address is not in allowlist after removal', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-4', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addAdmin(alice, {Substrate: bob.address});
-
- await collection.addToAllowList(bob, {Substrate: charlie.address});
- await collection.removeFromAllowList(bob, {Substrate: charlie.address});
-
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('Collection admin allowed to remove from allowlist with unset allowlist status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-5', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addAdmin(alice, {Substrate: bob.address});
- await collection.addToAllowList(alice, {Substrate: charlie.address});
-
- await collection.setPermissions(bob, {access: 'Normal'});
- await collection.removeFromAllowList(bob, {Substrate: charlie.address});
-
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('Regular user can`t remove from allowlist', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-6', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: charlie.address});
-
- await expect(collection.removeFromAllowList(bob, {Substrate: charlie.address}))
- .to.be.rejectedWith(/common\.NoPermission/);
- expect(await collection.getAllowList()).to.deep.contain({Substrate: charlie.address});
- });
-});
tests/src/setContractSponsoringRateLimit.test.tsdiffbeforeafterboth--- a/tests/src/setContractSponsoringRateLimit.test.ts
+++ b/tests/src/setContractSponsoringRateLimit.test.ts
@@ -25,7 +25,7 @@
setContractSponsoringRateLimitExpectSuccess,
} from './util/helpers';
-// todo:playgrounds postponed skipped test
+// todo:playgrounds skipped~postponed test
describe.skip('Integration Test setContractSponsoringRateLimit', () => {
it('ensure sponsored contract can\'t be called twice without pause for free', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/setMintPermission.test.tsdiffbeforeafterboth--- a/tests/src/setMintPermission.test.ts
+++ /dev/null
@@ -1,111 +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 {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test setMintPermission', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('ensure allow-listed non-privileged address can mint tokens', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-1', description: '', tokenPrefix: 'SMP'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
- });
-
- itSub('can be enabled twice', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-2', description: '', tokenPrefix: 'SMP'});
- expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList');
-
- await collection.setPermissions(alice, {mintMode: true});
- await collection.setPermissions(alice, {mintMode: true});
- expect((await collection.getData())?.raw.permissions.mintMode).to.be.true;
- });
-
- itSub('can be disabled twice', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-3', description: '', tokenPrefix: 'SMP'});
- expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
-
- await collection.setPermissions(alice, {access: 'Normal', mintMode: false});
- await collection.setPermissions(alice, {access: 'Normal', mintMode: false});
- expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(false);
- });
-
- itSub('Collection admin success on set', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-4', description: '', tokenPrefix: 'SMP'});
- await collection.addAdmin(alice, {Substrate: bob.address});
- await collection.setPermissions(bob, {access: 'AllowList', mintMode: true});
-
- expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
- });
-});
-
-describe('Negative Integration Test setMintPermission', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('fails on not existing collection', async ({helper}) => {
- const collectionId = (1 << 32) - 1;
- await expect(helper.collection.setPermissions(alice, collectionId, {mintMode: true}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails on removed collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-1', tokenPrefix: 'SMP'});
- await collection.burn(alice);
-
- await expect(collection.setPermissions(alice, {mintMode: true}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails when non-owner tries to set mint status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-2', tokenPrefix: 'SMP'});
-
- await expect(collection.setPermissions(bob, {mintMode: true}))
- .to.be.rejectedWith(/common\.NoPermission/);
- });
-
- itSub('ensure non-allow-listed non-privileged address can\'t mint tokens', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-3', tokenPrefix: 'SMP'});
- await collection.setPermissions(alice, {mintMode: true});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
-});
tests/src/setPermissions.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/setPermissions.test.ts
@@ -0,0 +1,107 @@
+// 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 {itSub, usingPlaygrounds, expect} from './util/playgrounds';
+
+describe('Integration Test: Set Permissions', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
+ });
+ });
+
+ itSub('can all be enabled twice', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-1', tokenPrefix: 'SP'});
+ expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList');
+
+ await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}});
+ await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}});
+
+ const permissions = (await collection.getData())?.raw.permissions;
+ expect(permissions).to.be.deep.equal({
+ access: 'AllowList',
+ mintMode: true,
+ nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]},
+ });
+ });
+
+ itSub('can all be disabled twice', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'});
+ expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
+
+ await collection.setPermissions(alice, {access: 'AllowList', nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]}});
+ expect((await collection.getData())?.raw.permissions).to.be.deep.equal({
+ access: 'AllowList',
+ mintMode: false,
+ nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]},
+ });
+
+ await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}});
+ await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}});
+ expect((await collection.getData())?.raw.permissions).to.be.deep.equal({
+ access: 'Normal',
+ mintMode: false,
+ nesting: {collectionAdmin: false, tokenOwner: false, restricted: null},
+ });
+ });
+
+ itSub('collection admin can set permissions', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'});
+ await collection.addAdmin(alice, {Substrate: bob.address});
+ await collection.setPermissions(bob, {access: 'AllowList', mintMode: true});
+
+ expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
+ expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
+ });
+});
+
+describe('Negative Integration Test: Set Permissions', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
+ });
+ });
+
+ itSub('fails on not existing collection', async ({helper}) => {
+ const collectionId = (1 << 32) - 1;
+ await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('fails on removed collection', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-1', tokenPrefix: 'SP'});
+ await collection.burn(alice);
+
+ await expect(collection.setPermissions(alice, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('fails when non-owner tries to set permissions', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-2', tokenPrefix: 'SP'});
+
+ await expect(collection.setPermissions(bob, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
+});
\ No newline at end of file
tests/src/setPublicAccessMode.test.tsdiffbeforeafterboth--- a/tests/src/setPublicAccessMode.test.ts
+++ /dev/null
@@ -1,93 +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/>.
-
-// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
-import {IKeyringPair} from '@polkadot/types/types';
-import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test setPublicAccessMode(): ', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('Runs extrinsic with collection id parameters, sets the allowlist mode for the collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-1', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.not.rejected;
- });
-
- itSub('Allowlisted collection limits', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-2', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
-
- itSub('setPublicAccessMode by collection admin', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-4', tokenPrefix: 'TF'});
- await collection.addAdmin(alice, {Substrate: bob.address});
-
- await expect(collection.setPermissions(bob, {access: 'AllowList'})).to.be.not.rejected;
- });
-});
-
-describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('Sets a non-existent collection', async ({helper}) => {
- const collectionId = (1 << 32) - 1;
- await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('Sets the collection that has been deleted', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-1', tokenPrefix: 'TF'});
- await collection.burn(alice);
-
- await expect(collection.setPermissions(alice, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('Re-sets the list mode already set in quantity', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-2', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList'});
- await collection.setPermissions(alice, {access: 'AllowList'});
- });
-
- itSub('Executes method as a malefactor', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-3', tokenPrefix: 'TF'});
-
- await expect(collection.setPermissions(bob, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.NoPermission/);
- });
-});
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -110,6 +110,9 @@
if (status.isBroadcast) {
return TransactionStatus.NotReady;
}
+ if (status.isRetracted) {
+ return TransactionStatus.NotReady;
+ }
if (status.isInBlock || status.isFinalized) {
if(events.filter(e => e.event.data.method === 'ExtrinsicFailed').length > 0) {
return TransactionStatus.Fail;
@@ -148,18 +151,32 @@
});
}
+/**
+ * @deprecated use `executeTransaction` instead
+ */
export function
submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic<ApiTypes>): Promise<EventRecord[]> {
/* eslint no-async-promise-executor: "off" */
return new Promise(async (resolve, reject) => {
try {
- await transaction.signAndSend(sender, ({events = [], status}) => {
+ await transaction.signAndSend(sender, ({events = [], status, dispatchError}) => {
const transactionStatus = getTransactionStatus(events, status);
if (transactionStatus === TransactionStatus.Success) {
resolve(events);
} else if (transactionStatus === TransactionStatus.Fail) {
- console.log(`Something went wrong with transaction. Status: ${status}`);
+ let moduleError = null;
+
+ if (dispatchError) {
+ if (dispatchError.isModule) {
+ const modErr = dispatchError.asModule;
+ const errorMeta = dispatchError.registry.findMetaError(modErr);
+
+ moduleError = JSON.stringify(errorMeta, null, 4);
+ }
+ }
+
+ console.log(`Something went wrong with transaction. Status: ${status}\nModule error: ${moduleError}`);
reject(events);
}
});
tests/src/tx-version-presence.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/tx-version-presence.test.ts
@@ -0,0 +1,32 @@
+// 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 {Metadata} from '@polkadot/types';
+import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
+
+let metadata: Metadata;
+
+describe('TxVersion is present', () => {
+ before(async () => {
+ await usingPlaygrounds(async helper => {
+ metadata = await helper.api!.rpc.state.getMetadata();
+ });
+ });
+
+ itSub('Signed extension CheckTxVersion is present', async () => {
+ expect(metadata.asLatest.extrinsic.signedExtensions.map(se => se.identifier.toString())).to.include('CheckTxVersion');
+ });
+});
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -16,7 +16,7 @@
import '../interfaces/augment-api-rpc';
import '../interfaces/augment-api-query';
-import {ApiPromise} from '@polkadot/api';
+import {ApiPromise, Keyring} from '@polkadot/api';
import type {AccountId, EventRecord, Event, BlockNumber} from '@polkadot/types/interfaces';
import type {GenericEventData} from '@polkadot/types';
import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types';
@@ -63,14 +63,14 @@
export async function isQuartz(): Promise<boolean> {
return usingApi(async api => {
const chain = await api.rpc.system.chain();
-
+
return chain.eq('QUARTZ');
});
}
let modulesNames: any;
export function getModuleNames(api: ApiPromise): string[] {
- if (typeof modulesNames === 'undefined')
+ if (typeof modulesNames === 'undefined')
modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase());
return modulesNames;
}
@@ -105,6 +105,19 @@
return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON();
}
+export function bigIntToDecimals(number: bigint, decimals = 18): string {
+ const numberStr = number.toString();
+ const dotPos = numberStr.length - decimals;
+
+ if (dotPos <= 0) {
+ return '0.' + '0'.repeat(Math.abs(dotPos)) + numberStr;
+ } else {
+ const intPart = numberStr.substring(0, dotPos);
+ const fractPart = numberStr.substring(dotPos);
+ return intPart + '.' + fractPart;
+ }
+}
+
export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {
if (typeof input === 'string') {
if (input.length >= 47) {
@@ -291,7 +304,7 @@
export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] {
const results: CreateItemResult[] = [];
-
+
const genericResult = getGenericResult<CreateItemResult[]>(events, 'common', 'ItemCreated', (data) => {
const collectionId = parseInt(data[0].toString(), 10);
const itemId = parseInt(data[1].toString(), 10);
@@ -316,15 +329,15 @@
export function getCreateItemResult(events: EventRecord[]): CreateItemResult {
const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => data.map(function(value) { return value.toJSON(); }));
-
- if (genericResult.data == null)
+
+ if (genericResult.data == null)
return {
success: genericResult.success,
collectionId: 0,
itemId: 0,
amount: 0,
};
- else
+ else
return {
success: genericResult.success,
collectionId: genericResult.data[0] as number,
@@ -336,7 +349,7 @@
export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] {
const results: DestroyItemResult[] = [];
-
+
const genericResult = getGenericResult<DestroyItemResult[]>(events, 'common', 'ItemDestroyed', (data) => {
const collectionId = parseInt(data[0].toString(), 10);
const itemId = parseInt(data[1].toString(), 10);
@@ -1102,6 +1115,19 @@
return balance;
}
+export async function paraSiblingSovereignAccount(paraid: number): Promise<string> {
+ return usingApi(async api => {
+ // We are getting a *sibling* parachain sovereign account,
+ // so we need a sibling prefix: encoded(b"sibl") == 0x7369626c
+ const siblingPrefix = '0x7369626c';
+
+ const encodedParaId = api.createType('u32', paraid).toHex(true).substring(2);
+ const suffix = '000000000000000000000000000000000000000000000000';
+
+ return siblingPrefix + encodedParaId + suffix;
+ });
+}
+
export async function transferBalanceTo(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) {
const tx = api.tx.balances.transfer(target, amount);
const events = await submitTransactionAsync(source, tx);
@@ -1125,9 +1151,9 @@
expect(blockNumber).to.be.greaterThan(0);
const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule
scheduledId,
- expectedBlockNumber,
- repetitions > 1 ? [period, repetitions] : null,
- 0,
+ expectedBlockNumber,
+ repetitions > 1 ? [period, repetitions] : null,
+ 0,
{Value: operationTx as any},
);
@@ -1152,13 +1178,13 @@
expect(blockNumber).to.be.greaterThan(0);
const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule
scheduledId,
- expectedBlockNumber,
- repetitions <= 1 ? null : [period, repetitions],
- 0,
+ expectedBlockNumber,
+ repetitions <= 1 ? null : [period, repetitions],
+ 0,
{Value: operationTx as any},
);
- //const events =
+ //const events =
await expect(submitTransactionExpectFailAsync(sender, scheduleTx)).to.be.rejected;
//expect(getGenericResult(events).success).to.be.false;
});
@@ -1222,7 +1248,7 @@
const transferTx = api.tx.balances.transfer(recipient.address, amount);
const balanceBefore = await getFreeBalance(recipient);
-
+
await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions);
expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore);
@@ -1738,6 +1764,12 @@
return (await api.rpc.unique.collectionById(collectionId)).unwrap();
}
+export const describe_xcm = (
+ process.env.RUN_XCM_TESTS
+ ? describe
+ : describe.skip
+);
+
export async function waitNewBlocks(blocksCount = 1): Promise<void> {
await usingApi(async (api) => {
const promise = new Promise<void>(async (resolve) => {
@@ -1754,6 +1786,45 @@
});
}
+export async function waitEvent(
+ api: ApiPromise,
+ maxBlocksToWait: number,
+ eventSection: string,
+ eventMethod: string,
+): Promise<EventRecord | null> {
+
+ const promise = new Promise<EventRecord | null>(async (resolve) => {
+ const unsubscribe = await api.rpc.chain.subscribeNewHeads(async header => {
+ const blockNumber = header.number.toHuman();
+ const blockHash = header.hash;
+ const eventIdStr = `${eventSection}.${eventMethod}`;
+ const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`;
+
+ console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`);
+
+ const apiAt = await api.at(blockHash);
+ const eventRecords = await apiAt.query.system.events();
+
+ const neededEvent = eventRecords.find(r => {
+ return r.event.section == eventSection && r.event.method == eventMethod;
+ });
+
+ if (neededEvent) {
+ unsubscribe();
+ resolve(neededEvent);
+ } else if (maxBlocksToWait > 0) {
+ maxBlocksToWait--;
+ } else {
+ console.log(`Event \`${eventIdStr}\` is NOT found`);
+
+ unsubscribe();
+ resolve(null);
+ }
+ });
+ });
+ return promise;
+}
+
export async function repartitionRFT(
api: ApiPromise,
collectionId: number,
@@ -1782,6 +1853,11 @@
itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true});
itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true});
+let accountSeed = 10000;
+export function generateKeyringPair(keyring: Keyring) {
+ const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16).padStart(64 - 8, '0')}`;
+ return keyring.addFromUri(privateKey);
+}
export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) {
const blockHash = await api.rpc.chain.getBlockHash(blockNumber);
@@ -1800,4 +1876,4 @@
expect(subEvents).to.be.like(events);
}
return subEvents;
-}
\ No newline at end of file
+}
tests/src/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/index.ts
+++ b/tests/src/util/playgrounds/index.ts
@@ -13,14 +13,14 @@
chai.use(chaiAsPromised);
export const expect = chai.expect;
-export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
+export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>, url: string = config.substrateUrl) => {
const silentConsole = new SilentConsole();
silentConsole.enable();
const helper = new DevUniqueHelper(new SilentLogger());
try {
- await helper.connect(config.substrateUrl);
+ await helper.connect(url);
const ss58Format = helper.chain.getChainProperties().ss58Format;
const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);
await code(helper, privateKey);
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -3,22 +3,32 @@
import {IKeyringPair} from '@polkadot/types/types';
-export interface IChainEvent {
- data: any;
- method: string;
+export interface IEvent {
section: string;
+ method: string;
+ index: [number, number] | string;
+ data: any[];
+ phase: {applyExtrinsic: number} | 'Initialization',
}
export interface ITransactionResult {
- status: 'Fail' | 'Success';
- result: {
- events: {
- event: IChainEvent
- }[];
- },
- moduleError?: string;
+ status: 'Fail' | 'Success';
+ result: {
+ events: {
+ phase: any, // {ApplyExtrinsic: number} | 'Initialization',
+ event: IEvent;
+ }[];
+ },
+ moduleError?: string;
}
+export interface ISubscribeBlockEventsData {
+ number: number;
+ hash: string;
+ timestamp: number;
+ events: IEvent[];
+}
+
export interface ILogger {
log: (msg: any, level?: string) => void;
level: {
@@ -147,6 +157,11 @@
feeFrozen: bigint
}
+export interface IStakingInfo {
+ block: bigint,
+ amount: bigint,
+}
+
export type TSubstrateAccount = string;
export type TEthereumAccount = string;
export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -60,11 +60,13 @@
*/
arrange: ArrangeGroup;
wait: WaitGroup;
+ admin: AdminGroup;
constructor(logger: { log: (msg: any, level: any) => void, level: any }) {
super(logger);
this.arrange = new ArrangeGroup(this);
this.wait = new WaitGroup(this);
+ this.admin = new AdminGroup(this);
}
async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
@@ -120,6 +122,7 @@
*/
createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {
let nonce = await this.helper.chain.getNonce(donor.address);
+ const wait = new WaitGroup(this.helper);
const ss58Format = this.helper.chain.getChainProperties().ss58Format;
const tokenNominal = this.helper.balance.getOneTokenNominal();
const transactions = [];
@@ -129,7 +132,7 @@
accounts.push(recipient);
if (balance !== 0n) {
const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]);
- transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation'));
nonce++;
}
}
@@ -154,7 +157,7 @@
for (let index = 0; index < 5; index++) {
accountsCreated = await checkBalances();
if(accountsCreated) break;
-
+ await wait.newBlocks(1);
}
if (!accountsCreated) throw Error('Accounts generation failed');
@@ -180,7 +183,7 @@
accounts.push(recepient);
if (withBalance !== 0n) {
const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, withBalance * tokenNominal]);
- transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation'));
nonce++;
}
}
@@ -281,3 +284,22 @@
});
}
}
+
+class AdminGroup {
+ helper: UniqueHelper;
+
+ constructor(helper: UniqueHelper) {
+ this.helper = helper;
+ }
+
+ async payoutStakers(signer: IKeyringPair, stakersToPayout: number) {
+ const payoutResult = await this.helper.executeExtrinsic(signer, 'api.tx.appPromotion.payoutStakers', [stakersToPayout], true);
+ return payoutResult.result.events.filter(e => e.event.method === 'StakingRecalculation').map(e => {
+ return {
+ staker: e.event.data[0].toString(),
+ stake: e.event.data[1].toBigInt(),
+ payout: e.event.data[2].toBigInt(),
+ };
+ });
+ }
+}
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -6,10 +6,10 @@
/* eslint-disable no-prototype-builtins */
import {ApiPromise, WsProvider, Keyring} from '@polkadot/api';
-import {ApiInterfaceEvents} from '@polkadot/api/types';
+import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types';
import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';
import {IKeyringPair} from '@polkadot/types/types';
-import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
+import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {
const address = {} as ICrossAccountId;
@@ -149,7 +149,7 @@
return {success, tokens};
}
- static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) {
+ static findCollectionInEvents(events: {event: IEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) {
let eventId = null;
events.forEach(({event: {data, method, section}}) => {
if ((section === expectedSection) && (method === expectedMethod)) {
@@ -163,7 +163,7 @@
return eventId === collectionId;
}
- static isTokenTransferSuccess(events: {event: IChainEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
+ static isTokenTransferSuccess(events: {event: IEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
const normalizeAddress = (address: string | ICrossAccountId) => {
if(typeof address === 'string') return address;
const obj = {} as any;
@@ -195,11 +195,64 @@
}
}
+class UniqueEventHelper {
+ private static extractIndex(index: any): [number, number] | string {
+ if(index.toRawType() === '[u8;2]') return [index[0], index[1]];
+ return index.toJSON();
+ }
+
+ private static extractSub(data: any, subTypes: any): {[key: string]: any} {
+ let obj: any = {};
+ let index = 0;
+
+ if (data.entries) {
+ for(const [key, value] of data.entries()) {
+ obj[key] = this.extractData(value, subTypes[index]);
+ index++;
+ }
+ } else obj = data.toJSON();
+
+ return obj;
+ }
+
+ private static extractData(data: any, type: any): any {
+ if (['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber();
+ if (['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt();
+ if(type.hasOwnProperty('sub')) return this.extractSub(data, type.sub);
+ return data.toHuman();
+ }
+ public static extractEvents(records: ITransactionResult): IEvent[] {
+ const parsedEvents: IEvent[] = [];
+
+ records.result.events.forEach((record) => {
+ const {event, phase} = record;
+ const types = (event as any).typeDef;
+
+ const eventData: IEvent = {
+ section: event.section.toString(),
+ method: event.method.toString(),
+ index: this.extractIndex(event.index),
+ data: [],
+ phase: phase.toJSON(),
+ };
+
+ event.data.forEach((val: any, index: number) => {
+ eventData.data.push(this.extractData(val, types[index]));
+ });
+
+ parsedEvents.push(eventData);
+ });
+
+ return parsedEvents;
+ }
+}
+
class ChainHelperBase {
transactionStatus = UniqueUtil.transactionStatus;
chainLogType = UniqueUtil.chainLogType;
util: typeof UniqueUtil;
+ eventHelper: typeof UniqueEventHelper;
logger: ILogger;
api: ApiPromise | null;
forcedNetwork: TUniqueNetworks | null;
@@ -208,6 +261,7 @@
constructor(logger?: ILogger) {
this.util = UniqueUtil;
+ this.eventHelper = UniqueEventHelper;
if (typeof logger == 'undefined') logger = this.util.getDefaultLogger();
this.logger = logger;
this.api = null;
@@ -290,7 +344,7 @@
return {api, network};
}
- getTransactionStatus(data: {events: {event: IChainEvent}[], status: any}) {
+ getTransactionStatus(data: {events: {event: IEvent}[], status: any}) {
const {events, status} = data;
if (status.isReady) {
return this.transactionStatus.NOT_READY;
@@ -299,11 +353,11 @@
return this.transactionStatus.NOT_READY;
}
if (status.isInBlock || status.isFinalized) {
- const errors = events.filter(e => e.event.data.method === 'ExtrinsicFailed');
+ const errors = events.filter(e => e.event.method === 'ExtrinsicFailed');
if (errors.length > 0) {
return this.transactionStatus.FAIL;
}
- if (events.filter(e => e.event.data.method === 'ExtrinsicSuccess').length > 0) {
+ if (events.filter(e => e.event.method === 'ExtrinsicSuccess').length > 0) {
return this.transactionStatus.SUCCESS;
}
}
@@ -311,7 +365,7 @@
return this.transactionStatus.FAIL;
}
- signTransaction(sender: TSigner, transaction: any, label = 'transaction', options: any = null) {
+ signTransaction(sender: TSigner, transaction: any, options: Partial<SignerOptions> | null = null, label = 'transaction') {
const sign = (callback: any) => {
if(options !== null) return transaction.signAndSend(sender, options, callback);
return transaction.signAndSend(sender, callback);
@@ -332,13 +386,16 @@
if (result.hasOwnProperty('dispatchError')) {
const dispatchError = result['dispatchError'];
- if (dispatchError && dispatchError.isModule) {
- const modErr = dispatchError.asModule;
- const errorMeta = dispatchError.registry.findMetaError(modErr);
+ if (dispatchError) {
+ if (dispatchError.isModule) {
+ const modErr = dispatchError.asModule;
+ const errorMeta = dispatchError.registry.findMetaError(modErr);
- moduleError = `${errorMeta.section}.${errorMeta.name}`;
- }
- else {
+ moduleError = `${errorMeta.section}.${errorMeta.name}`;
+ } else {
+ moduleError = dispatchError.toHuman();
+ }
+ } else {
this.logger.log(result, this.logger.level.ERROR);
}
}
@@ -364,16 +421,16 @@
return call(...params);
}
- async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false/*, failureMessage='expected success'*/) {
+ async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true, options: Partial<SignerOptions>|null = null/*, failureMessage='expected success'*/) {
if(this.api === null) throw Error('API not initialized');
if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`);
const startTime = (new Date()).getTime();
let result: ITransactionResult;
- let events = [];
+ let events: IEvent[] = [];
try {
- result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), extrinsic) as ITransactionResult;
- events = result.result.events.map((x: any) => x.toHuman());
+ result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult;
+ events = this.eventHelper.extractEvents(result);
}
catch(e) {
if(!(e as object).hasOwnProperty('status')) throw e;
@@ -2029,21 +2086,54 @@
return 1;
}
+ /**
+ * Get total staked amount for address
+ * @param address substrate or ethereum address
+ * @returns total staked amount
+ */
async getTotalStaked(address?: ICrossAccountId): Promise<bigint> {
if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt();
return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt();
}
- async getTotalStakedPerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ /**
+ * Get total staked per block
+ * @param address substrate or ethereum address
+ * @returns array of stakes. `block` – the number of the block in which the stake was made. `amount` - the number of tokens staked in the block
+ */
+ async getTotalStakedPerBlock(address: ICrossAccountId): Promise<IStakingInfo[]> {
+ const rawTotalStakerdPerBlock = await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address]);
+ return rawTotalStakerdPerBlock.map(([block, amount]: any[]) => {
+ return {
+ block: block.toBigInt(),
+ amount: amount.toBigInt(),
+ };
+ });
}
+ /**
+ * Get total pending unstake amount for address
+ * @param address substrate or ethereum address
+ * @returns total pending unstake amount
+ */
async getPendingUnstake(address: ICrossAccountId): Promise<bigint> {
return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt();
}
- async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ /**
+ * Get pending unstake amount per block for address
+ * @param address substrate or ethereum address
+ * @returns array of pending stakes. `block` – the number of the block in which the unstake was made. `amount` - the number of tokens unstaked in the block
+ */
+ async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<IStakingInfo[]> {
+ const rawUnstakedPerBlock = await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address]);
+ const result = rawUnstakedPerBlock.map(([block, amount]: any[]) => {
+ return {
+ block: block.toBigInt(),
+ amount: amount.toBigInt(),
+ };
+ });
+ return result;
}
}
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmOpal.test.ts
@@ -0,0 +1,527 @@
+// 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 chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {executeTransaction} from './../substrate/substrate-api';
+import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';
+import waitNewBlocks from './../substrate/wait-new-blocks';
+import {normalizeAccountId} from './../util/helpers';
+import getBalance from './../substrate/get-balance';
+
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const STATEMINE_CHAIN = 1000;
+const UNIQUE_CHAIN = 2095;
+
+const RELAY_PORT = '9844';
+const UNIQUE_PORT = '9944';
+const STATEMINE_PORT = '9948';
+const STATEMINE_PALLET_INSTANCE = 50;
+const ASSET_ID = 100;
+const ASSET_METADATA_DECIMALS = 18;
+const ASSET_METADATA_NAME = 'USDT';
+const ASSET_METADATA_DESCRIPTION = 'USDT';
+const ASSET_METADATA_MINIMAL_BALANCE = 1;
+
+const WESTMINT_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;
+
+// 10,000.00 (ten thousands) USDT
+const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n;
+
+describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ let balanceStmnBefore: bigint;
+ let balanceStmnAfter: bigint;
+
+ let balanceOpalBefore: bigint;
+ let balanceOpalAfter: bigint;
+ let balanceOpalFinal: bigint;
+
+ let balanceBobBefore: bigint;
+ let balanceBobAfter: bigint;
+ let balanceBobFinal: bigint;
+
+ let balanceBobRelayTokenBefore: bigint;
+ let balanceBobRelayTokenAfter: bigint;
+
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ bob = privateKeyWrapper('//Bob'); // funds donor
+ });
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const relayApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),
+ };
+
+ await usingApi(async (api) => {
+
+ // 350.00 (three hundred fifty) DOT
+ const fundingAmount = 3_500_000_000_000;
+
+ const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ // set metadata
+ const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS);
+ const events2 = await executeTransaction(api, alice, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ // mint some amount of asset
+ const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, ASSET_AMOUNT);
+ const events3 = await executeTransaction(api, alice, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+
+ // funding parachain sovereing account (Parachain: 2095)
+ const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN);
+ const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount);
+ const events4 = await executeTransaction(api, bob, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+
+ }, statemineApiOptions);
+
+
+ await usingApi(async (api) => {
+
+ const location = {
+ V1: {
+ parents: 1,
+ interior: {X3: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ PalletInstance: STATEMINE_PALLET_INSTANCE,
+ },
+ {
+ GeneralIndex: ASSET_ID,
+ },
+ ]},
+ },
+ };
+
+ const metadata =
+ {
+ name: ASSET_ID,
+ symbol: ASSET_METADATA_NAME,
+ decimals: ASSET_METADATA_DECIMALS,
+ minimalBalance: ASSET_METADATA_MINIMAL_BALANCE,
+ };
+ //registerForeignAsset(owner, location, metadata)
+ const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await executeTransaction(api, alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceOpalBefore] = await getBalance(api, [alice.address]);
+
+ }, uniqueApiOptions);
+
+
+ // Providing the relay currency to the unique sender account
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayApiOptions);
+
+ });
+
+ it('Should connect and send USDT from Westmint to Opal', async () => {
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ await usingApi(async (api) => {
+
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: {
+ X2: [
+ {
+ PalletInstance: STATEMINE_PALLET_INSTANCE,
+ },
+ {
+ GeneralIndex: ASSET_ID,
+ },
+ ]},
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ [balanceStmnBefore] = await getBalance(api, [alice.address]);
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceStmnAfter] = await getBalance(api, [alice.address]);
+
+ // common good parachain take commission in it native token
+ console.log(
+ 'Opal to Westmint transaction fees on Westmint: %s WND',
+ bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS),
+ );
+ expect(balanceStmnBefore > balanceStmnAfter).to.be.true;
+
+ }, statemineApiOptions);
+
+
+ // ensure that asset has been delivered
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+ // expext collection id will be with id 1
+ const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt();
+
+ [balanceOpalAfter] = await getBalance(api, [alice.address]);
+
+ // commission has not paid in USDT token
+ expect(free == TRANSFER_AMOUNT).to.be.true;
+ console.log(
+ 'Opal to Westmint transaction fees on Opal: %s USDT',
+ bigIntToDecimals(TRANSFER_AMOUNT - free),
+ );
+ // ... and parachain native token
+ expect(balanceOpalAfter == balanceOpalBefore).to.be.true;
+ console.log(
+ 'Opal to Westmint transaction fees on Opal: %s WND',
+ bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS),
+ );
+
+ }, uniqueApiOptions);
+
+ });
+
+ it('Should connect and send USDT from Unique to Statemine back', async () => {
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {X2: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ]},
+ },
+ };
+
+ const currencies: [any, bigint][] = [
+ [
+ {
+ ForeignAssetId: 0,
+ },
+ //10_000_000_000_000_000n,
+ TRANSFER_AMOUNT,
+ ],
+ [
+ {
+ NativeAssetId: 'Parent',
+ },
+ 400_000_000_000_000n,
+ ],
+ ];
+
+ const feeItem = 1;
+ const destWeight = 500000000000;
+
+ const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ // the commission has been paid in parachain native token
+ [balanceOpalFinal] = await getBalance(api, [alice.address]);
+ expect(balanceOpalAfter > balanceOpalFinal).to.be.true;
+ }, uniqueApiOptions);
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ // The USDT token never paid fees. Its amount not changed from begin value.
+ // Also check that xcm transfer has been succeeded
+ const free = ((await api.query.assets.account(100, alice.address)).toHuman()) as any;
+ expect(BigInt(free.balance.replace(/,/g, '')) == ASSET_AMOUNT).to.be.true;
+ }, statemineApiOptions);
+ });
+
+ it('Should connect and send Relay token to Unique', async () => {
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const uniqueApiOptions2: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const relayApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),
+ };
+
+ const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n;
+
+ await usingApi(async (api) => {
+ [balanceBobBefore] = await getBalance(api, [bob.address]);
+ balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
+
+ }, uniqueApiOptions);
+
+ // Providing the relay currency to the unique sender account
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: bob.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT_RELAY,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, bob, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayApiOptions);
+
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceBobAfter] = await getBalance(api, [bob.address]);
+ balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
+ const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore;
+ console.log(
+ 'Relay (Westend) to Opal transaction fees: %s OPL',
+ bigIntToDecimals(balanceBobAfter - balanceBobBefore),
+ );
+ console.log(
+ 'Relay (Westend) to Opal transaction fees: %s WND',
+ bigIntToDecimals(wndFee, WESTMINT_DECIMALS),
+ );
+ expect(balanceBobBefore == balanceBobAfter).to.be.true;
+ expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;
+ }, uniqueApiOptions2);
+
+ });
+
+ it('Should connect and send Relay token back', async () => {
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {X2: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ AccountId32: {
+ network: 'Any',
+ id: bob.addressRaw,
+ },
+ },
+ ]},
+ },
+ };
+
+ const currencies: any = [
+ [
+ {
+ NativeAssetId: 'Parent',
+ },
+ 50_000_000_000_000_000n,
+ ],
+ ];
+
+ const feeItem = 0;
+ const destWeight = 500000000000;
+
+ const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight);
+ const events = await executeTransaction(api, bob, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceBobFinal] = await getBalance(api, [bob.address]);
+ console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal);
+
+ }, uniqueApiOptions);
+ });
+
+});
tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmQuartz.test.ts
@@ -0,0 +1,799 @@
+// 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 chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider, Keyring} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
+import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
+import {MultiLocation} from '@polkadot/types/interfaces';
+import {blake2AsHex} from '@polkadot/util-crypto';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import getBalance from '../substrate/get-balance';
+import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const QUARTZ_CHAIN = 2095;
+const KARURA_CHAIN = 2000;
+const MOONRIVER_CHAIN = 2023;
+
+const RELAY_PORT = 9844;
+const KARURA_PORT = 9946;
+const MOONRIVER_PORT = 9947;
+
+const KARURA_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 2000000000000000000000000n;
+
+function parachainApiOptions(port: number): ApiOptions {
+ return {
+ provider: new WsProvider('ws://127.0.0.1:' + port.toString()),
+ };
+}
+
+function karuraOptions(): ApiOptions {
+ return parachainApiOptions(KARURA_PORT);
+}
+
+function moonriverOptions(): ApiOptions {
+ return parachainApiOptions(MOONRIVER_PORT);
+}
+
+function relayOptions(): ApiOptions {
+ return parachainApiOptions(RELAY_PORT);
+}
+
+describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => {
+ let alice: IKeyringPair;
+ let randomAccount: IKeyringPair;
+
+ let balanceQuartzTokenInit: bigint;
+ let balanceQuartzTokenMiddle: bigint;
+ let balanceQuartzTokenFinal: bigint;
+ let balanceKaruraTokenInit: bigint;
+ let balanceKaruraTokenMiddle: bigint;
+ let balanceKaruraTokenFinal: bigint;
+ let balanceQuartzForeignTokenInit: bigint;
+ let balanceQuartzForeignTokenMiddle: bigint;
+ let balanceQuartzForeignTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ alice = privateKeyWrapper('//Alice');
+ randomAccount = generateKeyringPair(keyringSr25519);
+ });
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: QUARTZ_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const metadata = {
+ name: 'QTZ',
+ symbol: 'QTZ',
+ decimals: 18,
+ minimalBalance: 1,
+ };
+
+ const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await submitTransactionAsync(alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n);
+ const events1 = await submitTransactionAsync(alice, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+
+ [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceQuartzForeignTokenInit = BigInt(free);
+ }
+ },
+ karuraOptions(),
+ );
+
+ // Quartz side
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(alice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]);
+ });
+ });
+
+ it('Should connect and send QTZ to Karura', async () => {
+
+ // Quartz side
+ await usingApi(async (api) => {
+
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: KARURA_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const beneficiary = {
+ V0: {
+ X1: {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees > 0n).to.be.true;
+ });
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceQuartzForeignTokenMiddle = BigInt(free);
+
+ [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle;
+ const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit;
+
+ console.log(
+ '[Quartz -> Karura] transaction fees on Karura: %s KAR',
+ bigIntToDecimals(karFees, KARURA_DECIMALS),
+ );
+ console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
+ expect(karFees == 0n).to.be.true;
+ expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ karuraOptions(),
+ );
+ });
+
+ it('Should connect to Karura and send QTZ back', async () => {
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ ForeignAsset: 0,
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any;
+ balanceQuartzForeignTokenFinal = BigInt(free);
+ }
+
+ const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal;
+ const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal;
+
+ console.log(
+ '[Karura -> Quartz] transaction fees on Karura: %s KAR',
+ bigIntToDecimals(karFees, KARURA_DECIMALS),
+ );
+ console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
+
+ expect(karFees > 0).to.be.true;
+ expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ karuraOptions(),
+ );
+
+ // Quartz side
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]);
+ const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
+
+ const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees == 0n).to.be.true;
+ });
+ });
+});
+
+// These tests are relevant only when the foreign asset pallet is disabled
+describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => {
+ let alice: IKeyringPair;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ });
+ });
+
+ it('Quartz rejects tokens from the Relay', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: QUARTZ_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const dmpQueueExecutedDownward = await waitEvent(
+ api,
+ maxWaitBlocks,
+ 'dmpQueue',
+ 'ExecutedDownward',
+ );
+
+ expect(
+ dmpQueueExecutedDownward != null,
+ '[Relay] dmpQueue.ExecutedDownward event is expected',
+ ).to.be.true;
+
+ const event = dmpQueueExecutedDownward!.event;
+ const outcome = event.data[1] as XcmV2TraitsOutcome;
+
+ expect(
+ outcome.isIncomplete,
+ '[Relay] The outcome of the XCM should be `Incomplete`',
+ ).to.be.true;
+
+ const incomplete = outcome.asIncomplete;
+ expect(
+ incomplete[1].toString() == 'AssetNotFound',
+ '[Relay] The XCM error should be `AssetNotFound`',
+ ).to.be.true;
+ });
+ });
+
+ it('Quartz rejects KAR tokens from Karura', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ Token: 'KAR',
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, karuraOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail');
+
+ expect(
+ xcmpQueueFailEvent != null,
+ '[Karura] xcmpQueue.FailEvent event is expected',
+ ).to.be.true;
+
+ const event = xcmpQueueFailEvent!.event;
+ const outcome = event.data[1] as XcmV2TraitsError;
+
+ expect(
+ outcome.isUntrustedReserveLocation,
+ '[Karura] The XCM error should be `UntrustedReserveLocation`',
+ ).to.be.true;
+ });
+ });
+});
+
+describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {
+
+ // Quartz constants
+ let quartzAlice: IKeyringPair;
+ let quartzAssetLocation;
+
+ let randomAccountQuartz: IKeyringPair;
+ let randomAccountMoonriver: IKeyringPair;
+
+ // Moonriver constants
+ let assetId: string;
+
+ const moonriverKeyring = new Keyring({type: 'ethereum'});
+ const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133';
+ const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b';
+ const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68';
+
+ const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum');
+ const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum');
+ const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum');
+
+ const councilVotingThreshold = 2;
+ const technicalCommitteeThreshold = 2;
+ const votingPeriod = 3;
+ const delayPeriod = 0;
+
+ const quartzAssetMetadata = {
+ name: 'xcQuartz',
+ symbol: 'xcQTZ',
+ decimals: 18,
+ isFrozen: false,
+ minimalBalance: 1,
+ };
+
+ let balanceQuartzTokenInit: bigint;
+ let balanceQuartzTokenMiddle: bigint;
+ let balanceQuartzTokenFinal: bigint;
+ let balanceForeignQtzTokenInit: bigint;
+ let balanceForeignQtzTokenMiddle: bigint;
+ let balanceForeignQtzTokenFinal: bigint;
+ let balanceMovrTokenInit: bigint;
+ let balanceMovrTokenMiddle: bigint;
+ let balanceMovrTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringEth = new Keyring({type: 'ethereum'});
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ quartzAlice = privateKeyWrapper('//Alice');
+ randomAccountQuartz = generateKeyringPair(keyringSr25519);
+ randomAccountMoonriver = generateKeyringPair(keyringEth);
+
+ balanceForeignQtzTokenInit = 0n;
+ });
+
+ await usingApi(
+ async (api) => {
+
+ // >>> Sponsoring Dorothy >>>
+ console.log('Sponsoring Dorothy.......');
+ const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n);
+ const events0 = await submitTransactionAsync(alithAccount, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+ console.log('Sponsoring Dorothy.......DONE');
+ // <<< Sponsoring Dorothy <<<
+
+ const sourceLocation: MultiLocation = api.createType(
+ 'MultiLocation',
+ {
+ parents: 1,
+ interior: {X1: {Parachain: QUARTZ_CHAIN}},
+ },
+ );
+
+ quartzAssetLocation = {XCM: sourceLocation};
+ const existentialDeposit = 1;
+ const isSufficient = true;
+ const unitsPerSecond = '1';
+ const numAssetsWeightHint = 0;
+
+ const registerTx = api.tx.assetManager.registerForeignAsset(
+ quartzAssetLocation,
+ quartzAssetMetadata,
+ existentialDeposit,
+ isSufficient,
+ );
+ console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || '');
+
+ const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond(
+ quartzAssetLocation,
+ unitsPerSecond,
+ numAssetsWeightHint,
+ );
+ console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || '');
+
+ const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]);
+ console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || '');
+
+ // >>> Note motion preimage >>>
+ console.log('Note motion preimage.......');
+ const encodedProposal = batchCall?.method.toHex() || '';
+ const proposalHash = blake2AsHex(encodedProposal);
+ console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal);
+ console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash);
+ console.log('Encoded length %d', encodedProposal.length);
+
+ const tx1 = api.tx.democracy.notePreimage(encodedProposal);
+ const events1 = await submitTransactionAsync(baltatharAccount, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+ console.log('Note motion preimage.......DONE');
+ // <<< Note motion preimage <<<
+
+ // >>> Propose external motion through council >>>
+ console.log('Propose external motion through council.......');
+ const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash);
+ const tx2 = api.tx.councilCollective.propose(
+ councilVotingThreshold,
+ externalMotion,
+ externalMotion.encodedLength,
+ );
+ const events2 = await submitTransactionAsync(baltatharAccount, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ const encodedMotion = externalMotion?.method.toHex() || '';
+ const motionHash = blake2AsHex(encodedMotion);
+ console.log('Motion hash is %s', motionHash);
+
+ const tx3 = api.tx.councilCollective.vote(motionHash, 0, true);
+ {
+ const events3 = await submitTransactionAsync(dorothyAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+ {
+ const events3 = await submitTransactionAsync(baltatharAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+
+ const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength);
+ const events4 = await submitTransactionAsync(dorothyAccount, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+ console.log('Propose external motion through council.......DONE');
+ // <<< Propose external motion through council <<<
+
+ // >>> Fast track proposal through technical committee >>>
+ console.log('Fast track proposal through technical committee.......');
+ const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod);
+ const tx5 = api.tx.techCommitteeCollective.propose(
+ technicalCommitteeThreshold,
+ fastTrack,
+ fastTrack.encodedLength,
+ );
+ const events5 = await submitTransactionAsync(alithAccount, tx5);
+ const result5 = getGenericResult(events5);
+ expect(result5.success).to.be.true;
+
+ const encodedFastTrack = fastTrack?.method.toHex() || '';
+ const fastTrackHash = blake2AsHex(encodedFastTrack);
+ console.log('FastTrack hash is %s', fastTrackHash);
+
+ const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1;
+ const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true);
+ {
+ const events6 = await submitTransactionAsync(baltatharAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+ {
+ const events6 = await submitTransactionAsync(alithAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+
+ const tx7 = api.tx.techCommitteeCollective
+ .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength);
+ const events7 = await submitTransactionAsync(baltatharAccount, tx7);
+ const result7 = getGenericResult(events7);
+ expect(result7.success).to.be.true;
+ console.log('Fast track proposal through technical committee.......DONE');
+ // <<< Fast track proposal through technical committee <<<
+
+ // >>> Referendum voting >>>
+ console.log('Referendum voting.......');
+ const tx8 = api.tx.democracy.vote(
+ 0,
+ {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}},
+ );
+ const events8 = await submitTransactionAsync(dorothyAccount, tx8);
+ const result8 = getGenericResult(events8);
+ expect(result8.success).to.be.true;
+ console.log('Referendum voting.......DONE');
+ // <<< Referendum voting <<<
+
+ // >>> Acquire Quartz AssetId Info on Moonriver >>>
+ console.log('Acquire Quartz AssetId Info on Moonriver.......');
+
+ // Wait for the democracy execute
+ await waitNewBlocks(api, 5);
+
+ assetId = (await api.query.assetManager.assetTypeId({
+ XCM: sourceLocation,
+ })).toString();
+
+ console.log('QTZ asset ID is %s', assetId);
+ console.log('Acquire Quartz AssetId Info on Moonriver.......DONE');
+ // >>> Acquire Quartz AssetId Info on Moonriver >>>
+
+ // >>> Sponsoring random Account >>>
+ console.log('Sponsoring random Account.......');
+ const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n);
+ const events10 = await submitTransactionAsync(baltatharAccount, tx10);
+ const result10 = getGenericResult(events10);
+ expect(result10.success).to.be.true;
+ console.log('Sponsoring random Account.......DONE');
+ // <<< Sponsoring random Account <<<
+
+ [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]);
+ },
+ moonriverOptions(),
+ );
+
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(quartzAlice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]);
+ });
+ });
+
+ it('Should connect and send QTZ to Moonriver', async () => {
+ await usingApi(async (api) => {
+ const currencyId = {
+ NativeAssetId: 'Here',
+ };
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: MOONRIVER_CHAIN},
+ {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}},
+ ],
+ },
+ },
+ };
+ const amount = TRANSFER_AMOUNT;
+ const destWeight = 850000000;
+
+ const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight);
+ const events = await submitTransactionAsync(randomAccountQuartz, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]);
+ expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true;
+
+ const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees));
+ expect(transactionFees > 0).to.be.true;
+ });
+
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]);
+
+ const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle;
+ console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees));
+ expect(movrFees == 0n).to.be.true;
+
+ const qtzRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonriver.address)
+ ).toJSON()! as any;
+
+ balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']);
+ const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit;
+ console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
+ expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonriverOptions(),
+ );
+ });
+
+ it('Should connect to Moonriver and send QTZ back', async () => {
+ await usingApi(
+ async (api) => {
+ const asset = {
+ V1: {
+ id: {
+ Concrete: {
+ parents: 1,
+ interior: {
+ X1: {Parachain: QUARTZ_CHAIN},
+ },
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ };
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}},
+ ],
+ },
+ },
+ };
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccountMoonriver, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]);
+
+ const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal;
+ console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees));
+ expect(movrFees > 0).to.be.true;
+
+ const qtzRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonriver.address)
+ ).toJSON()! as any;
+
+ expect(qtzRandomAccountAsset).to.be.null;
+
+ balanceForeignQtzTokenFinal = 0n;
+
+ const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal;
+ console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
+ expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonriverOptions(),
+ );
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]);
+ const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
+
+ const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees == 0n).to.be.true;
+ });
+ });
+});
tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -0,0 +1,799 @@
+// 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 chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider, Keyring} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
+import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
+import {MultiLocation} from '@polkadot/types/interfaces';
+import {blake2AsHex} from '@polkadot/util-crypto';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import getBalance from '../substrate/get-balance';
+import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const UNIQUE_CHAIN = 2037;
+const ACALA_CHAIN = 2000;
+const MOONBEAM_CHAIN = 2004;
+
+const RELAY_PORT = 9844;
+const ACALA_PORT = 9946;
+const MOONBEAM_PORT = 9947;
+
+const ACALA_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 2000000000000000000000000n;
+
+function parachainApiOptions(port: number): ApiOptions {
+ return {
+ provider: new WsProvider('ws://127.0.0.1:' + port.toString()),
+ };
+}
+
+function acalaOptions(): ApiOptions {
+ return parachainApiOptions(ACALA_PORT);
+}
+
+function moonbeamOptions(): ApiOptions {
+ return parachainApiOptions(MOONBEAM_PORT);
+}
+
+function relayOptions(): ApiOptions {
+ return parachainApiOptions(RELAY_PORT);
+}
+
+describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => {
+ let alice: IKeyringPair;
+ let randomAccount: IKeyringPair;
+
+ let balanceUniqueTokenInit: bigint;
+ let balanceUniqueTokenMiddle: bigint;
+ let balanceUniqueTokenFinal: bigint;
+ let balanceAcalaTokenInit: bigint;
+ let balanceAcalaTokenMiddle: bigint;
+ let balanceAcalaTokenFinal: bigint;
+ let balanceUniqueForeignTokenInit: bigint;
+ let balanceUniqueForeignTokenMiddle: bigint;
+ let balanceUniqueForeignTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ alice = privateKeyWrapper('//Alice');
+ randomAccount = generateKeyringPair(keyringSr25519);
+ });
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: UNIQUE_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const metadata = {
+ name: 'UNQ',
+ symbol: 'UNQ',
+ decimals: 18,
+ minimalBalance: 1,
+ };
+
+ const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await submitTransactionAsync(alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n);
+ const events1 = await submitTransactionAsync(alice, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+
+ [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceUniqueForeignTokenInit = BigInt(free);
+ }
+ },
+ acalaOptions(),
+ );
+
+ // Unique side
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(alice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]);
+ });
+ });
+
+ it('Should connect and send UNQ to Acala', async () => {
+
+ // Unique side
+ await usingApi(async (api) => {
+
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: ACALA_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const beneficiary = {
+ V0: {
+ X1: {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees > 0n).to.be.true;
+ });
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceUniqueForeignTokenMiddle = BigInt(free);
+
+ [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle;
+ const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit;
+
+ console.log(
+ '[Unique -> Acala] transaction fees on Acala: %s ACA',
+ bigIntToDecimals(acaFees, ACALA_DECIMALS),
+ );
+ console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
+ expect(acaFees == 0n).to.be.true;
+ expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ acalaOptions(),
+ );
+ });
+
+ it('Should connect to Acala and send UNQ back', async () => {
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ ForeignAsset: 0,
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any;
+ balanceUniqueForeignTokenFinal = BigInt(free);
+ }
+
+ const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal;
+ const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal;
+
+ console.log(
+ '[Acala -> Unique] transaction fees on Acala: %s ACA',
+ bigIntToDecimals(acaFees, ACALA_DECIMALS),
+ );
+ console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
+
+ expect(acaFees > 0).to.be.true;
+ expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ acalaOptions(),
+ );
+
+ // Unique side
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]);
+ const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
+
+ const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees == 0n).to.be.true;
+ });
+ });
+});
+
+// These tests are relevant only when the foreign asset pallet is disabled
+describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => {
+ let alice: IKeyringPair;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ });
+ });
+
+ it('Unique rejects tokens from the Relay', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const dmpQueueExecutedDownward = await waitEvent(
+ api,
+ maxWaitBlocks,
+ 'dmpQueue',
+ 'ExecutedDownward',
+ );
+
+ expect(
+ dmpQueueExecutedDownward != null,
+ '[Relay] dmpQueue.ExecutedDownward event is expected',
+ ).to.be.true;
+
+ const event = dmpQueueExecutedDownward!.event;
+ const outcome = event.data[1] as XcmV2TraitsOutcome;
+
+ expect(
+ outcome.isIncomplete,
+ '[Relay] The outcome of the XCM should be `Incomplete`',
+ ).to.be.true;
+
+ const incomplete = outcome.asIncomplete;
+ expect(
+ incomplete[1].toString() == 'AssetNotFound',
+ '[Relay] The XCM error should be `AssetNotFound`',
+ ).to.be.true;
+ });
+ });
+
+ it('Unique rejects ACA tokens from Acala', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ Token: 'ACA',
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, acalaOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail');
+
+ expect(
+ xcmpQueueFailEvent != null,
+ '[Acala] xcmpQueue.FailEvent event is expected',
+ ).to.be.true;
+
+ const event = xcmpQueueFailEvent!.event;
+ const outcome = event.data[1] as XcmV2TraitsError;
+
+ expect(
+ outcome.isUntrustedReserveLocation,
+ '[Acala] The XCM error should be `UntrustedReserveLocation`',
+ ).to.be.true;
+ });
+ });
+});
+
+describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
+
+ // Unique constants
+ let uniqueAlice: IKeyringPair;
+ let uniqueAssetLocation;
+
+ let randomAccountUnique: IKeyringPair;
+ let randomAccountMoonbeam: IKeyringPair;
+
+ // Moonbeam constants
+ let assetId: string;
+
+ const moonbeamKeyring = new Keyring({type: 'ethereum'});
+ const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133';
+ const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b';
+ const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68';
+
+ const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum');
+ const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum');
+ const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum');
+
+ const councilVotingThreshold = 2;
+ const technicalCommitteeThreshold = 2;
+ const votingPeriod = 3;
+ const delayPeriod = 0;
+
+ const uniqueAssetMetadata = {
+ name: 'xcUnique',
+ symbol: 'xcUNQ',
+ decimals: 18,
+ isFrozen: false,
+ minimalBalance: 1,
+ };
+
+ let balanceUniqueTokenInit: bigint;
+ let balanceUniqueTokenMiddle: bigint;
+ let balanceUniqueTokenFinal: bigint;
+ let balanceForeignUnqTokenInit: bigint;
+ let balanceForeignUnqTokenMiddle: bigint;
+ let balanceForeignUnqTokenFinal: bigint;
+ let balanceGlmrTokenInit: bigint;
+ let balanceGlmrTokenMiddle: bigint;
+ let balanceGlmrTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringEth = new Keyring({type: 'ethereum'});
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ uniqueAlice = privateKeyWrapper('//Alice');
+ randomAccountUnique = generateKeyringPair(keyringSr25519);
+ randomAccountMoonbeam = generateKeyringPair(keyringEth);
+
+ balanceForeignUnqTokenInit = 0n;
+ });
+
+ await usingApi(
+ async (api) => {
+
+ // >>> Sponsoring Dorothy >>>
+ console.log('Sponsoring Dorothy.......');
+ const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n);
+ const events0 = await submitTransactionAsync(alithAccount, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+ console.log('Sponsoring Dorothy.......DONE');
+ // <<< Sponsoring Dorothy <<<
+
+ const sourceLocation: MultiLocation = api.createType(
+ 'MultiLocation',
+ {
+ parents: 1,
+ interior: {X1: {Parachain: UNIQUE_CHAIN}},
+ },
+ );
+
+ uniqueAssetLocation = {XCM: sourceLocation};
+ const existentialDeposit = 1;
+ const isSufficient = true;
+ const unitsPerSecond = '1';
+ const numAssetsWeightHint = 0;
+
+ const registerTx = api.tx.assetManager.registerForeignAsset(
+ uniqueAssetLocation,
+ uniqueAssetMetadata,
+ existentialDeposit,
+ isSufficient,
+ );
+ console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || '');
+
+ const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond(
+ uniqueAssetLocation,
+ unitsPerSecond,
+ numAssetsWeightHint,
+ );
+ console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || '');
+
+ const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]);
+ console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || '');
+
+ // >>> Note motion preimage >>>
+ console.log('Note motion preimage.......');
+ const encodedProposal = batchCall?.method.toHex() || '';
+ const proposalHash = blake2AsHex(encodedProposal);
+ console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal);
+ console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash);
+ console.log('Encoded length %d', encodedProposal.length);
+
+ const tx1 = api.tx.democracy.notePreimage(encodedProposal);
+ const events1 = await submitTransactionAsync(baltatharAccount, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+ console.log('Note motion preimage.......DONE');
+ // <<< Note motion preimage <<<
+
+ // >>> Propose external motion through council >>>
+ console.log('Propose external motion through council.......');
+ const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash);
+ const tx2 = api.tx.councilCollective.propose(
+ councilVotingThreshold,
+ externalMotion,
+ externalMotion.encodedLength,
+ );
+ const events2 = await submitTransactionAsync(baltatharAccount, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ const encodedMotion = externalMotion?.method.toHex() || '';
+ const motionHash = blake2AsHex(encodedMotion);
+ console.log('Motion hash is %s', motionHash);
+
+ const tx3 = api.tx.councilCollective.vote(motionHash, 0, true);
+ {
+ const events3 = await submitTransactionAsync(dorothyAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+ {
+ const events3 = await submitTransactionAsync(baltatharAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+
+ const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength);
+ const events4 = await submitTransactionAsync(dorothyAccount, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+ console.log('Propose external motion through council.......DONE');
+ // <<< Propose external motion through council <<<
+
+ // >>> Fast track proposal through technical committee >>>
+ console.log('Fast track proposal through technical committee.......');
+ const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod);
+ const tx5 = api.tx.techCommitteeCollective.propose(
+ technicalCommitteeThreshold,
+ fastTrack,
+ fastTrack.encodedLength,
+ );
+ const events5 = await submitTransactionAsync(alithAccount, tx5);
+ const result5 = getGenericResult(events5);
+ expect(result5.success).to.be.true;
+
+ const encodedFastTrack = fastTrack?.method.toHex() || '';
+ const fastTrackHash = blake2AsHex(encodedFastTrack);
+ console.log('FastTrack hash is %s', fastTrackHash);
+
+ const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1;
+ const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true);
+ {
+ const events6 = await submitTransactionAsync(baltatharAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+ {
+ const events6 = await submitTransactionAsync(alithAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+
+ const tx7 = api.tx.techCommitteeCollective
+ .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength);
+ const events7 = await submitTransactionAsync(baltatharAccount, tx7);
+ const result7 = getGenericResult(events7);
+ expect(result7.success).to.be.true;
+ console.log('Fast track proposal through technical committee.......DONE');
+ // <<< Fast track proposal through technical committee <<<
+
+ // >>> Referendum voting >>>
+ console.log('Referendum voting.......');
+ const tx8 = api.tx.democracy.vote(
+ 0,
+ {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}},
+ );
+ const events8 = await submitTransactionAsync(dorothyAccount, tx8);
+ const result8 = getGenericResult(events8);
+ expect(result8.success).to.be.true;
+ console.log('Referendum voting.......DONE');
+ // <<< Referendum voting <<<
+
+ // >>> Acquire Unique AssetId Info on Moonbeam >>>
+ console.log('Acquire Unique AssetId Info on Moonbeam.......');
+
+ // Wait for the democracy execute
+ await waitNewBlocks(api, 5);
+
+ assetId = (await api.query.assetManager.assetTypeId({
+ XCM: sourceLocation,
+ })).toString();
+
+ console.log('UNQ asset ID is %s', assetId);
+ console.log('Acquire Unique AssetId Info on Moonbeam.......DONE');
+ // >>> Acquire Unique AssetId Info on Moonbeam >>>
+
+ // >>> Sponsoring random Account >>>
+ console.log('Sponsoring random Account.......');
+ const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n);
+ const events10 = await submitTransactionAsync(baltatharAccount, tx10);
+ const result10 = getGenericResult(events10);
+ expect(result10.success).to.be.true;
+ console.log('Sponsoring random Account.......DONE');
+ // <<< Sponsoring random Account <<<
+
+ [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]);
+ },
+ moonbeamOptions(),
+ );
+
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(uniqueAlice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]);
+ });
+ });
+
+ it('Should connect and send UNQ to Moonbeam', async () => {
+ await usingApi(async (api) => {
+ const currencyId = {
+ NativeAssetId: 'Here',
+ };
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: MOONBEAM_CHAIN},
+ {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}},
+ ],
+ },
+ },
+ };
+ const amount = TRANSFER_AMOUNT;
+ const destWeight = 850000000;
+
+ const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight);
+ const events = await submitTransactionAsync(randomAccountUnique, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]);
+ expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true;
+
+ const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees));
+ expect(transactionFees > 0).to.be.true;
+ });
+
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]);
+
+ const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle;
+ console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
+ expect(glmrFees == 0n).to.be.true;
+
+ const unqRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonbeam.address)
+ ).toJSON()! as any;
+
+ balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']);
+ const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit;
+ console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
+ expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonbeamOptions(),
+ );
+ });
+
+ it('Should connect to Moonbeam and send UNQ back', async () => {
+ await usingApi(
+ async (api) => {
+ const asset = {
+ V1: {
+ id: {
+ Concrete: {
+ parents: 1,
+ interior: {
+ X1: {Parachain: UNIQUE_CHAIN},
+ },
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ };
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}},
+ ],
+ },
+ },
+ };
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccountMoonbeam, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]);
+
+ const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal;
+ console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
+ expect(glmrFees > 0).to.be.true;
+
+ const unqRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonbeam.address)
+ ).toJSON()! as any;
+
+ expect(unqRandomAccountAsset).to.be.null;
+
+ balanceForeignUnqTokenFinal = 0n;
+
+ const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal;
+ console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
+ expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonbeamOptions(),
+ );
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]);
+ const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
+
+ const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees == 0n).to.be.true;
+ });
+ });
+});
tests/src/xcmTransfer.test.tsdiffbeforeafterboth--- a/tests/src/xcmTransfer.test.ts
+++ b/tests/src/xcmTransfer.test.ts
@@ -78,7 +78,7 @@
let balanceOnKaruraBefore: bigint;
await usingApi(async (api) => {
- const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any;
balanceOnKaruraBefore = free;
}, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
@@ -136,7 +136,7 @@
await usingApi(async (api) => {
// todo do something about instant sealing, where there might not be any new blocks
await waitNewBlocks(api, 3);
- const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any;
expect(free > balanceOnKaruraBefore).to.be.true;
}, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
});
@@ -165,7 +165,7 @@
};
const id = {
- ForeignAsset: 0,
+ ForeignAssetId: 0,
};
const amount = TRANSFER_AMOUNT;