git.delta.rocks / unique-network / refs/commits / bf6a3d46a94a

difftreelog

Add chain extension for transfer

Greg Zaitsev2021-01-28parent: #0c7b324.patch.diff
in: master

4 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -543,9 +543,9 @@
 
 [[package]]
 name = "bumpalo"
-version = "3.4.0"
+version = "3.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
+checksum = "f07aa6688c702439a1be0307b6a94dffe1168569e45b9500c1372bc580740d59"
 
 [[package]]
 name = "byte-slice-cast"
@@ -984,6 +984,16 @@
 ]
 
 [[package]]
+name = "ctor"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10bcb9d7dcbf7002aaffbb53eac22906b64cdcc127971dcc387d8eb7c95d5560"
+dependencies = [
+ "quote",
+ "syn",
+]
+
+[[package]]
 name = "cuckoofilter"
 version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1319,7 +1329,7 @@
 checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c"
 dependencies = [
  "byteorder",
- "rand 0.8.2",
+ "rand 0.8.3",
  "rustc-hex",
  "static_assertions",
 ]
@@ -1368,7 +1378,7 @@
 [[package]]
 name = "fork-tree"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
 ]
@@ -1386,7 +1396,7 @@
 [[package]]
 name = "frame-benchmarking"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -1404,7 +1414,7 @@
 [[package]]
 name = "frame-benchmarking-cli"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "Inflector",
  "chrono",
@@ -1427,7 +1437,7 @@
 [[package]]
 name = "frame-executive"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -1443,7 +1453,7 @@
 [[package]]
 name = "frame-metadata"
 version = "12.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "serde",
@@ -1454,7 +1464,7 @@
 [[package]]
 name = "frame-support"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "bitflags",
  "frame-metadata",
@@ -1479,7 +1489,7 @@
 [[package]]
 name = "frame-support-procedural"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "Inflector",
  "frame-support-procedural-tools",
@@ -1491,7 +1501,7 @@
 [[package]]
 name = "frame-support-procedural-tools"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support-procedural-tools-derive",
  "proc-macro-crate",
@@ -1503,7 +1513,7 @@
 [[package]]
 name = "frame-support-procedural-tools-derive"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1513,7 +1523,7 @@
 [[package]]
 name = "frame-system"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "impl-trait-for-tuples 0.2.0",
@@ -1529,7 +1539,7 @@
 [[package]]
 name = "frame-system-benchmarking"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
@@ -1543,7 +1553,7 @@
 [[package]]
 name = "frame-system-rpc-runtime-api"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-api",
@@ -2190,9 +2200,9 @@
 
 [[package]]
 name = "if-watch"
-version = "0.1.7"
+version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d"
+checksum = "97b8538953a3f0d0d3868f0a706eb4273535e10d72acb5c82c1c23ae48835c85"
 dependencies = [
  "async-io",
  "futures 0.3.12",
@@ -2330,9 +2340,9 @@
 
 [[package]]
 name = "js-sys"
-version = "0.3.46"
+version = "0.3.47"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175"
+checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65"
 dependencies = [
  "wasm-bindgen",
 ]
@@ -2647,9 +2657,9 @@
 
 [[package]]
 name = "libp2p-deflate"
-version = "0.27.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "935893c0e5b6ca6ef60d5225aab9182f97c8c5671df2fa9dee8f4ed72a90e6eb"
+checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345"
 dependencies = [
  "flate2",
  "futures 0.3.12",
@@ -2882,9 +2892,9 @@
 
 [[package]]
 name = "libp2p-swarm"
-version = "0.27.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22ea8c69839a0e593c8c6a24282cb234d48ac37be4153183f4914e00f5303e75"
+checksum = "d4f89ebb4d8953bda12623e9871959fe728dea3bf6eae0421dc9c42dc821e488"
 dependencies = [
  "either",
  "futures 0.3.12",
@@ -3054,11 +3064,12 @@
 
 [[package]]
 name = "log"
-version = "0.4.13"
+version = "0.4.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcf3805d4480bb5b86070dcfeb9e2cb2ebc148adb753c5cca5f884d1d65a42b2"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
+ "value-bag",
 ]
 
 [[package]]
@@ -3618,7 +3629,7 @@
 [[package]]
 name = "pallet-aura"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3637,7 +3648,7 @@
 [[package]]
 name = "pallet-authorship"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3652,7 +3663,7 @@
 [[package]]
 name = "pallet-balances"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
@@ -3666,7 +3677,7 @@
 [[package]]
 name = "pallet-contracts"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3687,7 +3698,7 @@
 [[package]]
 name = "pallet-contracts-primitives"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "bitflags",
  "parity-scale-codec",
@@ -3698,7 +3709,7 @@
 [[package]]
 name = "pallet-contracts-proc-macro"
 version = "0.1.0"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -3708,7 +3719,7 @@
 [[package]]
 name = "pallet-contracts-rpc"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "jsonrpc-core",
  "jsonrpc-core-client",
@@ -3727,7 +3738,7 @@
 [[package]]
 name = "pallet-contracts-rpc-runtime-api"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "pallet-contracts-primitives",
  "parity-scale-codec",
@@ -3739,7 +3750,7 @@
 [[package]]
 name = "pallet-grandpa"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
@@ -3781,7 +3792,7 @@
 [[package]]
 name = "pallet-randomness-collective-flip"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3794,7 +3805,7 @@
 [[package]]
 name = "pallet-session"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3814,7 +3825,7 @@
 [[package]]
 name = "pallet-sudo"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3828,7 +3839,7 @@
 [[package]]
 name = "pallet-timestamp"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
@@ -3846,7 +3857,7 @@
 [[package]]
 name = "pallet-transaction-payment"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3862,7 +3873,7 @@
 [[package]]
 name = "pallet-transaction-payment-rpc"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "jsonrpc-core",
  "jsonrpc-core-client",
@@ -3879,7 +3890,7 @@
 [[package]]
 name = "pallet-transaction-payment-rpc-runtime-api"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "pallet-transaction-payment",
  "parity-scale-codec",
@@ -3890,7 +3901,7 @@
 [[package]]
 name = "pallet-treasury"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -3905,7 +3916,7 @@
 [[package]]
 name = "pallet-vesting"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "enumflags2",
  "frame-support",
@@ -4585,9 +4596,9 @@
 
 [[package]]
 name = "rand"
-version = "0.8.2"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18519b42a40024d661e1714153e9ad0c3de27cd495760ceb09710920f1098b1e"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
 dependencies = [
  "libc",
  "rand_chacha 0.3.0",
@@ -4997,7 +5008,7 @@
 [[package]]
 name = "sc-basic-authorship"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-timer 3.0.2",
@@ -5020,7 +5031,7 @@
 [[package]]
 name = "sc-block-builder"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sc-client-api",
@@ -5037,7 +5048,7 @@
 [[package]]
 name = "sc-chain-spec"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-trait-for-tuples 0.2.0",
  "parity-scale-codec",
@@ -5058,7 +5069,7 @@
 [[package]]
 name = "sc-chain-spec-derive"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
@@ -5069,7 +5080,7 @@
 [[package]]
 name = "sc-cli"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "chrono",
  "fdlimit",
@@ -5107,7 +5118,7 @@
 [[package]]
 name = "sc-client-api"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "fnv",
@@ -5141,7 +5152,7 @@
 [[package]]
 name = "sc-client-db"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "blake2-rfc",
  "hash-db",
@@ -5171,7 +5182,7 @@
 [[package]]
 name = "sc-consensus"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "sc-client-api",
  "sp-blockchain",
@@ -5182,7 +5193,7 @@
 [[package]]
 name = "sc-consensus-aura"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "futures 0.3.12",
@@ -5213,7 +5224,7 @@
 [[package]]
 name = "sc-consensus-babe"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "fork-tree",
@@ -5258,7 +5269,7 @@
 [[package]]
 name = "sc-consensus-epochs"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "fork-tree",
  "parity-scale-codec",
@@ -5271,7 +5282,7 @@
 [[package]]
 name = "sc-consensus-slots"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-timer 3.0.2",
@@ -5297,7 +5308,7 @@
 [[package]]
 name = "sc-consensus-uncles"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "sc-client-api",
@@ -5311,7 +5322,7 @@
 [[package]]
 name = "sc-executor"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "lazy_static",
@@ -5340,7 +5351,7 @@
 [[package]]
 name = "sc-executor-common"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "parity-scale-codec",
@@ -5356,7 +5367,7 @@
 [[package]]
 name = "sc-executor-wasmi"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "parity-scale-codec",
@@ -5371,7 +5382,7 @@
 [[package]]
 name = "sc-executor-wasmtime"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "parity-scale-codec",
@@ -5389,13 +5400,14 @@
 [[package]]
 name = "sc-finality-grandpa"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "finality-grandpa",
  "fork-tree",
  "futures 0.3.12",
  "futures-timer 3.0.2",
+ "linked-hash-map",
  "log",
  "parity-scale-codec",
  "parking_lot 0.11.1",
@@ -5426,7 +5438,7 @@
 [[package]]
 name = "sc-informant"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "ansi_term 0.12.1",
  "futures 0.3.12",
@@ -5444,7 +5456,7 @@
 [[package]]
 name = "sc-keystore"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "async-trait",
  "derive_more",
@@ -5464,7 +5476,7 @@
 [[package]]
 name = "sc-light"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "hash-db",
  "lazy_static",
@@ -5483,7 +5495,7 @@
 [[package]]
 name = "sc-network"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "async-std",
  "async-trait",
@@ -5535,7 +5547,7 @@
 [[package]]
 name = "sc-network-gossip"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-timer 3.0.2",
@@ -5551,7 +5563,7 @@
 [[package]]
 name = "sc-offchain"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "bytes 0.5.6",
  "fnv",
@@ -5578,7 +5590,7 @@
 [[package]]
 name = "sc-peerset"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "libp2p",
@@ -5591,7 +5603,7 @@
 [[package]]
 name = "sc-proposer-metrics"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "substrate-prometheus-endpoint",
@@ -5600,7 +5612,7 @@
 [[package]]
 name = "sc-rpc"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "hash-db",
@@ -5634,7 +5646,7 @@
 [[package]]
 name = "sc-rpc-api"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "futures 0.3.12",
@@ -5658,7 +5670,7 @@
 [[package]]
 name = "sc-rpc-server"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.1.30",
  "jsonrpc-core",
@@ -5676,7 +5688,7 @@
 [[package]]
 name = "sc-service"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "directories 3.0.1",
  "exit-future",
@@ -5739,7 +5751,7 @@
 [[package]]
 name = "sc-state-db"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "parity-scale-codec",
@@ -5754,7 +5766,7 @@
 [[package]]
 name = "sc-telemetry"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "chrono",
  "futures 0.3.12",
@@ -5776,7 +5788,7 @@
 [[package]]
 name = "sc-tracing"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "ansi_term 0.12.1",
  "atty",
@@ -5804,7 +5816,7 @@
 [[package]]
 name = "sc-tracing-proc-macro"
 version = "2.0.0"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
@@ -5815,7 +5827,7 @@
 [[package]]
 name = "sc-transaction-graph"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "futures 0.3.12",
@@ -5837,7 +5849,7 @@
 [[package]]
 name = "sc-transaction-pool"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-diagnose",
@@ -5912,9 +5924,9 @@
 
 [[package]]
 name = "scroll_derive"
-version = "0.10.4"
+version = "0.10.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12bd20b94c7cdfda8c7ba9b92ad0d9a56e3fa018c25fca83b51aa664c9b4c0d"
+checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -5980,18 +5992,18 @@
 
 [[package]]
 name = "serde"
-version = "1.0.120"
+version = "1.0.123"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "166b2349061381baf54a58e4b13c89369feb0ef2eaa57198899e2312aac30aab"
+checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.120"
+version = "1.0.123"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775"
+checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -6192,7 +6204,7 @@
 [[package]]
 name = "sp-allocator"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "sp-core",
@@ -6204,7 +6216,7 @@
 [[package]]
 name = "sp-api"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "hash-db",
  "parity-scale-codec",
@@ -6220,7 +6232,7 @@
 [[package]]
 name = "sp-api-proc-macro"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "blake2-rfc",
  "proc-macro-crate",
@@ -6232,7 +6244,7 @@
 [[package]]
 name = "sp-application-crypto"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "serde",
@@ -6244,7 +6256,7 @@
 [[package]]
 name = "sp-arithmetic"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "integer-sqrt",
  "num-traits",
@@ -6257,7 +6269,7 @@
 [[package]]
 name = "sp-authorship"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-inherents",
@@ -6268,7 +6280,7 @@
 [[package]]
 name = "sp-block-builder"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-api",
@@ -6280,7 +6292,7 @@
 [[package]]
 name = "sp-blockchain"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "log",
@@ -6298,7 +6310,7 @@
 [[package]]
 name = "sp-chain-spec"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "serde",
  "serde_json",
@@ -6307,7 +6319,7 @@
 [[package]]
 name = "sp-consensus"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-timer 3.0.2",
@@ -6333,7 +6345,7 @@
 [[package]]
 name = "sp-consensus-aura"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-api",
@@ -6347,7 +6359,7 @@
 [[package]]
 name = "sp-consensus-babe"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "merlin",
  "parity-scale-codec",
@@ -6367,7 +6379,7 @@
 [[package]]
 name = "sp-consensus-slots"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-runtime",
@@ -6376,7 +6388,7 @@
 [[package]]
 name = "sp-consensus-vrf"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "schnorrkel",
@@ -6388,7 +6400,7 @@
 [[package]]
 name = "sp-core"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "base58",
  "blake2-rfc",
@@ -6432,7 +6444,7 @@
 [[package]]
 name = "sp-database"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "kvdb",
  "parking_lot 0.11.1",
@@ -6441,7 +6453,7 @@
 [[package]]
 name = "sp-debug-derive"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -6451,7 +6463,7 @@
 [[package]]
 name = "sp-externalities"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "environmental",
  "parity-scale-codec",
@@ -6462,7 +6474,7 @@
 [[package]]
 name = "sp-finality-grandpa"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "finality-grandpa",
  "log",
@@ -6479,7 +6491,7 @@
 [[package]]
 name = "sp-inherents"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "parking_lot 0.11.1",
@@ -6491,7 +6503,7 @@
 [[package]]
 name = "sp-io"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "hash-db",
@@ -6515,7 +6527,7 @@
 [[package]]
 name = "sp-keyring"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "lazy_static",
  "sp-core",
@@ -6526,7 +6538,7 @@
 [[package]]
 name = "sp-keystore"
 version = "0.8.0"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "async-trait",
  "derive_more",
@@ -6543,7 +6555,7 @@
 [[package]]
 name = "sp-offchain"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "sp-api",
  "sp-core",
@@ -6553,7 +6565,7 @@
 [[package]]
 name = "sp-panic-handler"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "backtrace",
 ]
@@ -6561,7 +6573,7 @@
 [[package]]
 name = "sp-rpc"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "serde",
  "sp-core",
@@ -6570,7 +6582,7 @@
 [[package]]
 name = "sp-runtime"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "either",
  "hash256-std-hasher",
@@ -6591,7 +6603,7 @@
 [[package]]
 name = "sp-runtime-interface"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-trait-for-tuples 0.2.0",
  "parity-scale-codec",
@@ -6608,7 +6620,7 @@
 [[package]]
 name = "sp-runtime-interface-proc-macro"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "Inflector",
  "proc-macro-crate",
@@ -6620,7 +6632,7 @@
 [[package]]
 name = "sp-sandbox"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-core",
@@ -6633,7 +6645,7 @@
 [[package]]
 name = "sp-serializer"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "serde",
  "serde_json",
@@ -6642,7 +6654,7 @@
 [[package]]
 name = "sp-session"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-api",
@@ -6655,7 +6667,7 @@
 [[package]]
 name = "sp-staking"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "parity-scale-codec",
  "sp-runtime",
@@ -6665,7 +6677,7 @@
 [[package]]
 name = "sp-state-machine"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "hash-db",
  "log",
@@ -6687,12 +6699,12 @@
 [[package]]
 name = "sp-std"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 
 [[package]]
 name = "sp-storage"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-serde",
  "parity-scale-codec",
@@ -6705,7 +6717,7 @@
 [[package]]
 name = "sp-tasks"
 version = "2.0.0"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "sp-core",
@@ -6718,7 +6730,7 @@
 [[package]]
 name = "sp-timestamp"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-trait-for-tuples 0.2.0",
  "parity-scale-codec",
@@ -6732,7 +6744,7 @@
 [[package]]
 name = "sp-tracing"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "log",
  "parity-scale-codec",
@@ -6745,7 +6757,7 @@
 [[package]]
 name = "sp-transaction-pool"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "derive_more",
  "futures 0.3.12",
@@ -6761,7 +6773,7 @@
 [[package]]
 name = "sp-trie"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "hash-db",
  "memory-db",
@@ -6775,7 +6787,7 @@
 [[package]]
 name = "sp-utils"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "futures 0.3.12",
  "futures-core",
@@ -6787,7 +6799,7 @@
 [[package]]
 name = "sp-version"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-serde",
  "parity-scale-codec",
@@ -6799,7 +6811,7 @@
 [[package]]
 name = "sp-wasm-interface"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "impl-trait-for-tuples 0.2.0",
  "parity-scale-codec",
@@ -6920,7 +6932,7 @@
 [[package]]
 name = "substrate-build-script-utils"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "platforms",
 ]
@@ -6928,7 +6940,7 @@
 [[package]]
 name = "substrate-frame-rpc-system"
 version = "2.0.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "frame-system-rpc-runtime-api",
  "futures 0.3.12",
@@ -6951,7 +6963,7 @@
 [[package]]
 name = "substrate-prometheus-endpoint"
 version = "0.8.1"
-source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#a7fd1e5d59b12d0166da54d545e7e5826bc6f518"
+source = "git+https://github.com/usetech-llc/substrate.git?branch=unique#0e070672cf7a7bec72fb3f26188915cfb43c440f"
 dependencies = [
  "async-std",
  "derive_more",
@@ -6982,9 +6994,9 @@
 
 [[package]]
 name = "syn"
-version = "1.0.58"
+version = "1.0.60"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5"
+checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -7023,7 +7035,7 @@
 dependencies = [
  "cfg-if 1.0.0",
  "libc",
- "rand 0.8.2",
+ "rand 0.8.3",
  "redox_syscall 0.2.4",
  "remove_dir_all",
  "winapi 0.3.9",
@@ -7069,11 +7081,11 @@
 
 [[package]]
 name = "thread_local"
-version = "1.1.0"
+version = "1.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447"
+checksum = "d8208a331e1cb318dd5bd76951d2b8fc48ca38a69f5f4e4af1b6a9f8c6236915"
 dependencies = [
- "lazy_static",
+ "once_cell",
 ]
 
 [[package]]
@@ -7125,9 +7137,9 @@
 
 [[package]]
 name = "tinyvec"
-version = "1.1.0"
+version = "1.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f"
+checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023"
 dependencies = [
  "tinyvec_macros",
 ]
@@ -7412,9 +7424,9 @@
 
 [[package]]
 name = "tower-service"
-version = "0.3.0"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860"
+checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
 
 [[package]]
 name = "tracing"
@@ -7668,6 +7680,15 @@
 ]
 
 [[package]]
+name = "value-bag"
+version = "1.0.0-alpha.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1"
+dependencies = [
+ "ctor",
+]
+
+[[package]]
 name = "vcpkg"
 version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -7738,9 +7759,9 @@
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.69"
+version = "0.2.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e"
+checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be"
 dependencies = [
  "cfg-if 1.0.0",
  "wasm-bindgen-macro",
@@ -7748,9 +7769,9 @@
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.69"
+version = "0.2.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62"
+checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7"
 dependencies = [
  "bumpalo",
  "lazy_static",
@@ -7763,9 +7784,9 @@
 
 [[package]]
 name = "wasm-bindgen-futures"
-version = "0.4.19"
+version = "0.4.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35"
+checksum = "3de431a2910c86679c34283a33f66f4e4abd7e0aec27b6669060148872aadf94"
 dependencies = [
  "cfg-if 1.0.0",
  "js-sys",
@@ -7775,9 +7796,9 @@
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.69"
+version = "0.2.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084"
+checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -7785,9 +7806,9 @@
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.69"
+version = "0.2.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549"
+checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -7798,9 +7819,9 @@
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.69"
+version = "0.2.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158"
+checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64"
 
 [[package]]
 name = "wasm-timer"
@@ -8027,9 +8048,9 @@
 
 [[package]]
 name = "web-sys"
-version = "0.3.46"
+version = "0.3.47"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3"
+checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3"
 dependencies = [
  "js-sys",
  "wasm-bindgen",
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1047,32 +1047,8 @@
         ///     * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
         #[weight = <T as Config>::WeightInfo::transfer()]
         pub fn transfer(origin, recipient: T::AccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
-
             let sender = ensure_signed(origin)?;
-            let target_collection = <Collection<T>>::get(collection_id);
-
-            // Limits check
-            Self::is_correct_transfer(collection_id, &target_collection, &recipient)?;
-
-            // Transfer permissions check
-            ensure!(Self::is_item_owner(sender.clone(), collection_id, item_id) ||
-                Self::is_owner_or_admin_permissions(collection_id, sender.clone()),
-                Error::<T>::NoPermission);
-
-            if target_collection.access == AccessMode::WhiteList {
-                Self::check_white_list(collection_id, &sender)?;
-                Self::check_white_list(collection_id, &recipient)?;
-            }
-
-            match target_collection.mode
-            {
-                CollectionMode::NFT => Self::transfer_nft(collection_id, item_id, sender.clone(), recipient)?,
-                CollectionMode::Fungible(_)  => Self::transfer_fungible(collection_id, value, &sender, &recipient)?,
-                CollectionMode::ReFungible(_)  => Self::transfer_refungible(collection_id, item_id, value, sender.clone(), recipient)?,
-                _ => ()
-            };
-
-            Ok(())
+            Self::transfer_internal(sender, recipient, collection_id, item_id, value)
         }
 
         /// Set, change, or remove approved address to transfer the ownership of the NFT.
@@ -1554,6 +1530,35 @@
 
 impl<T: Config> Module<T> {
 
+    pub fn transfer_internal(sender: T::AccountId, recipient: T::AccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
+
+        let target_collection = <Collection<T>>::get(collection_id);
+
+        // Limits check
+        Self::is_correct_transfer(collection_id, &target_collection, &recipient)?;
+
+        // Transfer permissions check
+        ensure!(Self::is_item_owner(sender.clone(), collection_id, item_id) ||
+            Self::is_owner_or_admin_permissions(collection_id, sender.clone()),
+            Error::<T>::NoPermission);
+
+        if target_collection.access == AccessMode::WhiteList {
+            Self::check_white_list(collection_id, &sender)?;
+            Self::check_white_list(collection_id, &recipient)?;
+        }
+
+        match target_collection.mode
+        {
+            CollectionMode::NFT => Self::transfer_nft(collection_id, item_id, sender.clone(), recipient)?,
+            CollectionMode::Fungible(_)  => Self::transfer_fungible(collection_id, value, &sender, &recipient)?,
+            CollectionMode::ReFungible(_)  => Self::transfer_refungible(collection_id, item_id, value, sender.clone(), recipient)?,
+            _ => ()
+        };
+
+        Ok(())
+    }
+
+
     fn is_correct_transfer(collection_id: CollectionId, collection: &CollectionType<T::AccountId>, recipient: &T::AccountId) -> DispatchResult {
 
         // check token limit and account token limit
addedruntime/src/chain_extension.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/src/chain_extension.rs
@@ -0,0 +1,98 @@
+//! NFT Chain Extension
+
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+use codec::{Decode, Encode};
+
+pub use pallet_contracts::chain_extension::RetVal;
+use pallet_contracts::chain_extension::{
+    ChainExtension, Environment, Ext, InitState, SysConfig, UncheckedFrom,
+};
+
+pub use frame_support::debug;
+use frame_support::dispatch::DispatchError;
+
+extern crate pallet_nft;
+pub use pallet_nft::*;
+use crate::Runtime;
+use sp_runtime::AccountId32;
+use crate::Vec;
+use frame_system::Origin;
+
+/// Transfer parameters
+#[derive(Debug, PartialEq, Encode, Decode)]
+pub struct NFTExtTransfer<E: Ext> {
+    pub recipient: <E::T as SysConfig>::AccountId,
+    pub collection_id: u32,
+    pub token_id: u32,
+    pub amount: u128,
+}
+
+/// The chain Extension of NFT pallet
+pub struct NFTExtension;
+
+// pub trait ToAccount32 {
+//     fn to_account32<E: Ext>(addr: <E::T as SysConfig>::AccountId);
+// }
+
+// impl ToAccount32 for NFTExtension {
+//     fn to_account32<E: Ext>(addr: <E::T as SysConfig>::AccountId) 
+//     where
+//         <E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
+//     {
+//         let mut bytes: [u8; 32];
+//         let addrVec: Vec<u8> = addr.encode();
+//         for i in 0..32 {
+//             bytes[i] = addrVec[i];
+//         }
+//         AccountId32::from(bytes)
+//     }
+
+// }
+
+impl ChainExtension for NFTExtension {
+    fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
+    where
+        <E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
+    {
+        // The memory of the vm stores buf in scale-codec
+        match func_id {
+            0 => {
+                let mut env = env.buf_in_buf_out();
+                let input: NFTExtTransfer<E> = env.read_as()?;
+
+                // Sender to AccountId32
+                let mut bytesSender: [u8; 32] = [0; 32];
+                let addrVecSender: Vec<u8> = env.ext().caller().encode();
+                for i in 0..32 {
+                    bytesSender[i] = addrVecSender[i];
+                }
+                let sender = AccountId32::from(bytesSender);
+
+                // Recipient to AccountId32
+                let mut bytesRec: [u8; 32] = [0; 32];
+                let addrVecRec: Vec<u8> = input.recipient.encode();
+                for i in 0..32 {
+                    bytesRec[i] = addrVecRec[i];
+                }
+                let recipient = AccountId32::from(bytesRec);
+
+
+
+                match pallet_nft::Module::<Runtime>::transfer_internal(sender, recipient, input.collection_id, input.token_id, input.amount) {
+                    Ok(_) => Ok(RetVal::Converging(func_id)),
+                    DispatchError => Err(DispatchError::Other("Transfer error"))
+                }
+
+                
+            },
+			_ => {
+				panic!("Passed unknown func_id to test chain extension: {}", func_id);
+            }
+        }
+    }
+}
+
modifiedruntime/src/lib.rsdiffbeforeafterboth
before · runtime/src/lib.rs
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.78#![cfg_attr(not(feature = "std"), no_std)]9// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.10#![recursion_limit = "256"]1112// Make the WASM binary available.13#[cfg(feature = "std")]14include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));1516use pallet_grandpa::fg_primitives;17use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};18use sp_api::impl_runtime_apis;19use sp_consensus_aura::sr25519::AuthorityId as AuraId;20use sp_core::{ crypto::KeyTypeId, crypto::Public, OpaqueMetadata };21use sp_runtime::{22    Permill, Perbill, Perquintill, Percent,23    // BuildStorage, 24    ModuleId, FixedPointNumber,25    create_runtime_str, generic, impl_opaque_keys,26    traits::{27        Convert, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, 28        IdentityLookup, NumberFor, Verify,29    },30    transaction_validity::{TransactionSource, TransactionValidity},31    ApplyExtrinsicResult, MultiSignature,32};33use sp_std::prelude::*;34#[cfg(feature = "std")]35use sp_version::NativeVersion;36use sp_version::RuntimeVersion;37pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};38// A few exports that help ease life for downstream crates.39pub use pallet_balances::Call as BalancesCall;40pub use pallet_contracts::Schedule as ContractsSchedule;41use pallet_contracts::WeightInfo;42pub use frame_support::{43    construct_runtime,44    dispatch::DispatchResult,45    parameter_types,46    traits::{47        Currency, ExistenceRequirement, Get, KeyOwnerProofSystem, OnUnbalanced, Randomness,48        LockIdentifier,49    },50    weights::{51        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},52        DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,53        WeightToFeePolynomial,54    },55    StorageValue,56};57// #[cfg(any(feature = "std", test))]58use frame_system::{59    self as system,60    EnsureRoot, 61    limits::{BlockWeights, BlockLength}};62use sp_std::{marker::PhantomData};6364pub use pallet_timestamp::Call as TimestampCall;6566/// Struct that handles the conversion of Balance -> `u64`. This is used for67/// staking's election calculation.68pub struct CurrencyToVoteHandler;6970impl CurrencyToVoteHandler {71	fn factor() -> Balance {72		(Balances::total_issuance() / u64::max_value() as Balance).max(1)73	}74}7576impl Convert<Balance, u64> for CurrencyToVoteHandler {77	fn convert(x: Balance) -> u64 {78		(x / Self::factor()) as u6479	}80}8182impl Convert<u128, Balance> for CurrencyToVoteHandler {83	fn convert(x: u128) -> Balance {84		x * Self::factor()85	}86}8788/// Re-export a nft pallet89/// TODO: Check this re-export. Is this safe and good style?90extern crate pallet_nft;91pub use pallet_nft::*;9293/// An index to a block.94pub type BlockNumber = u32;9596/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.97pub type Signature = MultiSignature;9899/// Some way of identifying an account on the chain. We intentionally make it equivalent100/// to the public key of our transaction signing scheme.101pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;102103/// The type for looking up accounts. We don't expect more than 4 billion of them, but you104/// never know...105pub type AccountIndex = u32;106107/// Balance of an account.108pub type Balance = u128;109110/// Index of a transaction in the chain.111pub type Index = u32;112113/// A hash of some data used by the chain.114pub type Hash = sp_core::H256;115116/// Digest item type.117pub type DigestItem = generic::DigestItem<Hash>;118119mod nft_weights;120121/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know122/// the specifics of the runtime. They can then be made to be agnostic over specific formats123/// of data like extrinsics, allowing for them to continue syncing the network through upgrades124/// to even the core data structures.125pub mod opaque {126    use super::*;127128    pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;129130    /// Opaque block header type.131    pub type Header = generic::Header<BlockNumber, BlakeTwo256>;132    /// Opaque block type.133    pub type Block = generic::Block<Header, UncheckedExtrinsic>;134    /// Opaque block identifier type.135    pub type BlockId = generic::BlockId<Block>;136137    impl_opaque_keys! {138        pub struct SessionKeys {139            pub aura: Aura,140            pub grandpa: Grandpa,141        }142    }143}144145/// This runtime version.146pub const VERSION: RuntimeVersion = RuntimeVersion {147    spec_name: create_runtime_str!("nft"),148    impl_name: create_runtime_str!("nft"),149    authoring_version: 1,150    spec_version: 3,151    impl_version: 1,152    apis: RUNTIME_API_VERSIONS,153    transaction_version: 1,154};155156pub const MILLISECS_PER_BLOCK: u64 = 6000;157158pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;159160// These time units are defined in number of blocks.161pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);162pub const HOURS: BlockNumber = MINUTES * 60;163pub const DAYS: BlockNumber = HOURS * 24;164165/// The version information used to identify this runtime when compiled natively.166#[cfg(feature = "std")]167pub fn native_version() -> NativeVersion {168    NativeVersion {169        runtime_version: VERSION,170        can_author_with: Default::default(),171    }172}173174/// Provides a membership set with only the configured aura users175pub struct ValiudatorsOnly<Runtime: pallet_aura::Config>(PhantomData<Runtime>);176impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {177	fn contains(t: &AccountId) -> bool {178        let arr: [u8; 32] = *t.as_ref();179        let raw_key: Vec<u8> = Vec::from(arr);180181        match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {182            Some(_) => true,183            None => false,184        }  185	}186	fn sorted_members() -> Vec<AccountId> {187        let mut members: Vec<AccountId> = Vec::new();188        for auth in pallet_aura::Module::<Runtime>::authorities() {189            let mut arr: [u8; 32] = Default::default(); 190            let bor_arr = auth.clone().to_raw_vec();191            let slice = bor_arr.as_slice();192            arr.copy_from_slice(slice);193            members.push(AccountId::from(arr));194        }195        members  196	}197	fn count() -> usize {198        pallet_aura::Module::<Runtime>::authorities().len()199	}200}201202impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {203	fn min_len() -> usize {204		1205	}206	fn max_len() -> usize {207		100208	}209}210211type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;212213pub struct DealWithFees;214impl OnUnbalanced<NegativeImbalance> for DealWithFees {215	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {216		if let Some(fees) = fees_then_tips.next() {217			// for fees, 80% to treasury, 20% to author218			let mut split = fees.ration(80, 20);219			if let Some(tips) = fees_then_tips.next() {220				// for tips, if any, 80% to treasury, 20% to author (though this can be anything)221				tips.ration_merge_into(80, 20, &mut split);222			}223			Treasury::on_unbalanced(split.0);224			// Author::on_unbalanced(split.1);225		}226	}227}228229/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.230/// This is used to limit the maximal weight of a single extrinsic.231const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);232/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used233/// by  Operational  extrinsics.234const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);235/// We allow for 2 seconds of compute with a 6 second average block time.236const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;237238parameter_types! {239    pub const BlockHashCount: BlockNumber = 2400;240	pub RuntimeBlockLength: BlockLength =241		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);242    pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);243    pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;244	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()245		.base_block(BlockExecutionWeight::get())246		.for_class(DispatchClass::all(), |weights| {247			weights.base_extrinsic = ExtrinsicBaseWeight::get();248		})249		.for_class(DispatchClass::Normal, |weights| {250			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);251		})252		.for_class(DispatchClass::Operational, |weights| {253			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);254			// Operational transactions have some extra reserved space, so that they255			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.256			weights.reserved = Some(257				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT258			);259		})260		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)261		.build_or_panic();262    pub const Version: RuntimeVersion = VERSION;263    pub const SS58Prefix: u8 = 42;264}265266impl system::Config for Runtime {267    /// The basic call filter to use in dispatchable.268    type BaseCallFilter = ();269    /// The identifier used to distinguish between accounts.270    type AccountId = AccountId;271    /// The aggregated dispatch type that is available for extrinsics.272    type Call = Call;273    /// The lookup mechanism to get account ID from whatever is passed in dispatchers.274    type Lookup = IdentityLookup<AccountId>;275    /// The index type for storing how many extrinsics an account has signed.276    type Index = Index;277    /// The index type for blocks.278    type BlockNumber = BlockNumber;279    /// The type for hashing blocks and tries.280    type Hash = Hash;281    /// The hashing algorithm used.282    type Hashing = BlakeTwo256;283    /// The header type.284    type Header = generic::Header<BlockNumber, BlakeTwo256>;285    /// The ubiquitous event type.286    type Event = Event;287    /// The ubiquitous origin type.288    type Origin = Origin;289    /// Maximum number of block number to block hash mappings to keep (oldest pruned first).290    type BlockHashCount = BlockHashCount;291    /// The weight of database operations that the runtime can invoke.292    type DbWeight = RocksDbWeight;293    /// The weight of the overhead invoked on the block import process, independent of the294    /// extrinsics included in that block.295	type BlockWeights = RuntimeBlockWeights;296    /// Version of the runtime.297    type Version = Version;298 	/// This type is being generated by `construct_runtime!`.299    type PalletInfo = PalletInfo;300    /// What to do if a new account is created.301    type OnNewAccount = ();302    /// What to do if an account is fully reaped from the system.303    type OnKilledAccount = ();304    /// The data to be stored in an account.305    type AccountData = pallet_balances::AccountData<Balance>;306	/// Weight information for the extrinsics of this pallet.307    type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;308    309	type BlockLength = RuntimeBlockLength;310	type SS58Prefix = SS58Prefix;311}312313impl pallet_aura::Config for Runtime {314    type AuthorityId = AuraId;315}316317impl pallet_grandpa::Config for Runtime {318	type Event = Event;319	type Call = Call;320321	type KeyOwnerProofSystem = ();322323	type KeyOwnerProof =324		<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;325326	type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(327		KeyTypeId,328		GrandpaId,329	)>>::IdentificationTuple;330331	type HandleEquivocation = ();332333	type WeightInfo = ();334}335336parameter_types! {337    pub const MinimumPeriod: u64 = SLOT_DURATION / 2;338}339340impl pallet_timestamp::Config for Runtime {341	/// A timestamp: milliseconds since the unix epoch.342	type Moment = u64;343	type OnTimestampSet = Aura;344	type MinimumPeriod = MinimumPeriod;345	type WeightInfo = ();346}347348parameter_types! {349    // pub const ExistentialDeposit: u128 = 500;350    pub const ExistentialDeposit: u128 = 0;351	pub const MaxLocks: u32 = 50;352}353354impl pallet_balances::Config for Runtime {355	type MaxLocks = MaxLocks;356	/// The type for recording an account's balance.357	type Balance = Balance;358	/// The ubiquitous event type.359	type Event = Event;360	type DustRemoval = Treasury;361	type ExistentialDeposit = ExistentialDeposit;362	type AccountStore = System;363	type WeightInfo = ();364}365366pub const MILLICENTS: Balance = 1_000_000_000;367pub const CENTS: Balance = 1_000 * MILLICENTS;368pub const DOLLARS: Balance = 100 * CENTS;369370pub const fn deposit(items: u32, bytes: u32) -> Balance {371    items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS372}373374parameter_types! {375	pub const TombstoneDeposit: Balance = deposit(376		0,377		sp_std::mem::size_of::<pallet_contracts::ContractInfo<Runtime>>() as u32378	);379	pub const DepositPerContract: Balance = TombstoneDeposit::get();380	pub const DepositPerStorageByte: Balance = deposit(0, 1);381	pub const DepositPerStorageItem: Balance = deposit(1, 0);382	pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS);383	pub const SurchargeReward: Balance = 150 * MILLICENTS;384	pub const SignedClaimHandicap: u32 = 2;385	pub const MaxDepth: u32 = 32;386	pub const MaxValueSize: u32 = 16 * 1024;387	// The lazy deletion runs inside on_initialize.388	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *389		RuntimeBlockWeights::get().max_block;390	// The weight needed for decoding the queue should be less or equal than a fifth391	// of the overall weight dedicated to the lazy deletion.392	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (393			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -394			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)395		)) / 5) as u32;396}397398399impl pallet_contracts::Config for Runtime {400	type Time = Timestamp;401	type Randomness = RandomnessCollectiveFlip;402	type Currency = Balances;403	type Event = Event;404	type RentPayment = ();405	type SignedClaimHandicap = SignedClaimHandicap;406	type TombstoneDeposit = TombstoneDeposit;407	type DepositPerContract = DepositPerContract;408	type DepositPerStorageByte = DepositPerStorageByte;409	type DepositPerStorageItem = DepositPerStorageItem;410	type RentFraction = RentFraction;411	type SurchargeReward = SurchargeReward;412	type MaxDepth = MaxDepth;413	type MaxValueSize = MaxValueSize;414	type WeightPrice = pallet_transaction_payment::Module<Self>;415	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;416	type ChainExtension = ();417	type DeletionQueueDepth = DeletionQueueDepth;418	type DeletionWeightLimit = DeletionWeightLimit;419}420421parameter_types! {422	pub const TransactionByteFee: Balance = 10 * MILLICENTS;423	pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);424	pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000);425	pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128);426}427428impl pallet_transaction_payment::Config for Runtime {429	type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees>;430	type TransactionByteFee = TransactionByteFee;431	type WeightToFee = IdentityFee<Balance>;432	type FeeMultiplierUpdate =433		TargetedFeeAdjustment<Self, TargetBlockFullness, AdjustmentVariable, MinimumMultiplier>;434}435436parameter_types! {437	pub const ProposalBond: Permill = Permill::from_percent(5);438	pub const ProposalBondMinimum: Balance = 1 * DOLLARS;439	pub const SpendPeriod: BlockNumber = 5 * MINUTES;440	pub const Burn: Permill = Permill::from_percent(0);441	pub const TipCountdown: BlockNumber = 1 * DAYS;442	pub const TipFindersFee: Percent = Percent::from_percent(20);443	pub const TipReportDepositBase: Balance = 1 * DOLLARS;444	pub const DataDepositPerByte: Balance = 1 * CENTS;445	pub const BountyDepositBase: Balance = 1 * DOLLARS;446	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;447	pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");448	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;449	pub const MaximumReasonLength: u32 = 16384;450	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);451	pub const BountyValueMinimum: Balance = 5 * DOLLARS;452}453454impl pallet_treasury::Config for Runtime {455	type ModuleId = TreasuryModuleId;456	type Currency = Balances;457	type ApproveOrigin = EnsureRoot<AccountId>;458	type RejectOrigin = EnsureRoot<AccountId>;459	type Event = Event;460	type OnSlash = ();461	type ProposalBond = ProposalBond;462	type ProposalBondMinimum = ProposalBondMinimum;463	type SpendPeriod = SpendPeriod;464	type Burn = Burn;465	type BurnDestination = ();466	type SpendFunds = ();467	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;468}469470impl pallet_sudo::Config for Runtime {471    type Event = Event;472    type Call = Call;473}474475parameter_types! {476	pub const MinVestedTransfer: Balance = 100 * DOLLARS;477}478479impl pallet_vesting::Config for Runtime {480	type Event = Event;481	type Currency = Balances;482	type BlockNumberToBalance = ConvertInto;483	type MinVestedTransfer = MinVestedTransfer;484	type WeightInfo = ();485}486487/// Used for the module nft in `./nft.rs`488impl pallet_nft::Config for Runtime {489    type Event = Event;490    type WeightInfo = nft_weights::WeightInfo;491}492493construct_runtime!(494    pub enum Runtime where495        Block = Block,496        NodeBlock = opaque::Block,497        UncheckedExtrinsic = UncheckedExtrinsic498    {499        System: system::{Module, Call, Config, Storage, Event<T>},500        RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},501        Contracts: pallet_contracts::{Module, Call, Config<T>, Storage, Event<T>},502        Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},503        Aura: pallet_aura::{Module, Config<T>, Inherent},504        Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},505        Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},506        TransactionPayment: pallet_transaction_payment::{Module, Storage},507        Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},508        Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},509        Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},510        Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},511    }512);513514/// The address format for describing accounts.515pub type Address = AccountId;516/// Block header type as expected by this runtime.517pub type Header = generic::Header<BlockNumber, BlakeTwo256>;518/// Block type as expected by this runtime.519pub type Block = generic::Block<Header, UncheckedExtrinsic>;520/// A Block signed with a Justification521pub type SignedBlock = generic::SignedBlock<Block>;522/// BlockId type as expected by this runtime.523pub type BlockId = generic::BlockId<Block>;524/// The SignedExtension to the basic transaction logic.525pub type SignedExtra = (526    system::CheckSpecVersion<Runtime>,527    system::CheckTxVersion<Runtime>,528    system::CheckGenesis<Runtime>,529    system::CheckEra<Runtime>,530    system::CheckNonce<Runtime>,531    system::CheckWeight<Runtime>,532    pallet_nft::ChargeTransactionPayment<Runtime>,533);534/// Unchecked extrinsic type as expected by this runtime.535pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;536/// Extrinsic type that has already been checked.537pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;538/// Executive: handles dispatch to the various modules.539pub type Executive =540    frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;541542impl_runtime_apis! {543544	impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>545		for Runtime546	{547		fn call(548			origin: AccountId,549			dest: AccountId,550			value: Balance,551			gas_limit: u64,552			input_data: Vec<u8>,553		) -> pallet_contracts_primitives::ContractExecResult {554			Contracts::bare_call(origin, dest, value, gas_limit, input_data)555		}556557		fn get_storage(558			address: AccountId,559			key: [u8; 32],560		) -> pallet_contracts_primitives::GetStorageResult {561			Contracts::get_storage(address, key)562		}563564		fn rent_projection(565			address: AccountId,566		) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {567			Contracts::rent_projection(address)568		}569	}570571    impl sp_api::Core<Block> for Runtime {572        fn version() -> RuntimeVersion {573            VERSION574        }575576        fn execute_block(block: Block) {577            Executive::execute_block(block)578        }579580        fn initialize_block(header: &<Block as BlockT>::Header) {581            Executive::initialize_block(header)582        }583    }584585    impl sp_api::Metadata<Block> for Runtime {586        fn metadata() -> OpaqueMetadata {587            Runtime::metadata().into()588        }589    }590591    impl sp_block_builder::BlockBuilder<Block> for Runtime {592        fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {593            Executive::apply_extrinsic(extrinsic)594        }595596        fn finalize_block() -> <Block as BlockT>::Header {597            Executive::finalize_block()598        }599600        fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {601            data.create_extrinsics()602        }603604        fn check_inherents(605            block: Block,606            data: sp_inherents::InherentData,607        ) -> sp_inherents::CheckInherentsResult {608            data.check_extrinsics(&block)609        }610611        fn random_seed() -> <Block as BlockT>::Hash {612            RandomnessCollectiveFlip::random_seed()613        }614    }615616    impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {617        fn validate_transaction(618            source: TransactionSource,619            tx: <Block as BlockT>::Extrinsic,620        ) -> TransactionValidity {621            Executive::validate_transaction(source, tx)622        }623    }624625    impl sp_offchain::OffchainWorkerApi<Block> for Runtime {626        fn offchain_worker(header: &<Block as BlockT>::Header) {627            Executive::offchain_worker(header)628        }629    }630631    impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {632        fn slot_duration() -> u64 {633            Aura::slot_duration()634        }635636        fn authorities() -> Vec<AuraId> {637            Aura::authorities()638        }639    }640641    impl sp_session::SessionKeys<Block> for Runtime {642        fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {643            opaque::SessionKeys::generate(seed)644        }645646        fn decode_session_keys(647            encoded: Vec<u8>,648        ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {649            opaque::SessionKeys::decode_into_raw_public_keys(&encoded)650        }651    }652653	impl fg_primitives::GrandpaApi<Block> for Runtime {654		fn grandpa_authorities() -> GrandpaAuthorityList {655			Grandpa::grandpa_authorities()656		}657658		fn submit_report_equivocation_unsigned_extrinsic(659			_equivocation_proof: fg_primitives::EquivocationProof<660				<Block as BlockT>::Hash,661				NumberFor<Block>,662			>,663			_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,664		) -> Option<()> {665			None666		}667668		fn generate_key_ownership_proof(669			_set_id: fg_primitives::SetId,670			_authority_id: GrandpaId,671		) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {672			// NOTE: this is the only implementation possible since we've673			// defined our key owner proof type as a bottom type (i.e. a type674			// with no values).675			None676		}677    }678    679	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {680		fn account_nonce(account: AccountId) -> Index {681			System::account_nonce(account)682		}683	}684685	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {686		fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {687			TransactionPayment::query_info(uxt, len)688		}689		fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {690			TransactionPayment::query_fee_details(uxt, len)691		}692	}693694    #[cfg(feature = "runtime-benchmarks")]695	impl frame_benchmarking::Benchmark<Block> for Runtime {696		fn dispatch_benchmark(697			config: frame_benchmarking::BenchmarkConfig698		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {699			use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};700701			let whitelist: Vec<TrackedStorageKey> = vec![702				// Alice account703				hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),704				// // Total Issuance705				// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),706				// // Execution Phase707				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),708				// // Event Count709				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),710				// // System Events711				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),712            ];713714			let mut batches = Vec::<BenchmarkBatch>::new();715			let params = (&config, &whitelist);716717			add_benchmark!(params, batches, pallet_nft, Nft);718719			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }720			Ok(batches)721		}722	}723}
after · runtime/src/lib.rs
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.78#![cfg_attr(not(feature = "std"), no_std)]9// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.10#![recursion_limit = "256"]1112// Make the WASM binary available.13#[cfg(feature = "std")]14include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));1516use pallet_grandpa::fg_primitives;17use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};18use sp_api::impl_runtime_apis;19use sp_consensus_aura::sr25519::AuthorityId as AuraId;20use sp_core::{ crypto::KeyTypeId, crypto::Public, OpaqueMetadata };21use sp_runtime::{22    Permill, Perbill, Perquintill, Percent,23    // BuildStorage, 24    ModuleId, FixedPointNumber,25    create_runtime_str, generic, impl_opaque_keys,26    traits::{27        Convert, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, 28        IdentityLookup, NumberFor, Verify,29    },30    transaction_validity::{TransactionSource, TransactionValidity},31    ApplyExtrinsicResult, MultiSignature,32};33use sp_std::prelude::*;34#[cfg(feature = "std")]35use sp_version::NativeVersion;36use sp_version::RuntimeVersion;37pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};38// A few exports that help ease life for downstream crates.39pub use pallet_balances::Call as BalancesCall;40pub use pallet_contracts::Schedule as ContractsSchedule;41use pallet_contracts::WeightInfo;42pub use frame_support::{43    construct_runtime,44    dispatch::DispatchResult,45    parameter_types,46    traits::{47        Currency, ExistenceRequirement, Get, KeyOwnerProofSystem, OnUnbalanced, Randomness,48        LockIdentifier,49    },50    weights::{51        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},52        DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,53        WeightToFeePolynomial,54    },55    StorageValue,56};57// #[cfg(any(feature = "std", test))]58use frame_system::{59    self as system,60    EnsureRoot, 61    limits::{BlockWeights, BlockLength}};62use sp_std::{marker::PhantomData};6364pub use pallet_timestamp::Call as TimestampCall;6566mod chain_extension;67use crate::chain_extension::NFTExtension;6869/// Struct that handles the conversion of Balance -> `u64`. This is used for70/// staking's election calculation.71pub struct CurrencyToVoteHandler;7273impl CurrencyToVoteHandler {74	fn factor() -> Balance {75		(Balances::total_issuance() / u64::max_value() as Balance).max(1)76	}77}7879impl Convert<Balance, u64> for CurrencyToVoteHandler {80	fn convert(x: Balance) -> u64 {81		(x / Self::factor()) as u6482	}83}8485impl Convert<u128, Balance> for CurrencyToVoteHandler {86	fn convert(x: u128) -> Balance {87		x * Self::factor()88	}89}9091/// Re-export a nft pallet92/// TODO: Check this re-export. Is this safe and good style?93extern crate pallet_nft;94pub use pallet_nft::*;9596/// An index to a block.97pub type BlockNumber = u32;9899/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.100pub type Signature = MultiSignature;101102/// Some way of identifying an account on the chain. We intentionally make it equivalent103/// to the public key of our transaction signing scheme.104pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;105106/// The type for looking up accounts. We don't expect more than 4 billion of them, but you107/// never know...108pub type AccountIndex = u32;109110/// Balance of an account.111pub type Balance = u128;112113/// Index of a transaction in the chain.114pub type Index = u32;115116/// A hash of some data used by the chain.117pub type Hash = sp_core::H256;118119/// Digest item type.120pub type DigestItem = generic::DigestItem<Hash>;121122mod nft_weights;123124/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know125/// the specifics of the runtime. They can then be made to be agnostic over specific formats126/// of data like extrinsics, allowing for them to continue syncing the network through upgrades127/// to even the core data structures.128pub mod opaque {129    use super::*;130131    pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;132133    /// Opaque block header type.134    pub type Header = generic::Header<BlockNumber, BlakeTwo256>;135    /// Opaque block type.136    pub type Block = generic::Block<Header, UncheckedExtrinsic>;137    /// Opaque block identifier type.138    pub type BlockId = generic::BlockId<Block>;139140    impl_opaque_keys! {141        pub struct SessionKeys {142            pub aura: Aura,143            pub grandpa: Grandpa,144        }145    }146}147148/// This runtime version.149pub const VERSION: RuntimeVersion = RuntimeVersion {150    spec_name: create_runtime_str!("nft"),151    impl_name: create_runtime_str!("nft"),152    authoring_version: 1,153    spec_version: 3,154    impl_version: 1,155    apis: RUNTIME_API_VERSIONS,156    transaction_version: 1,157};158159pub const MILLISECS_PER_BLOCK: u64 = 6000;160161pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;162163// These time units are defined in number of blocks.164pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);165pub const HOURS: BlockNumber = MINUTES * 60;166pub const DAYS: BlockNumber = HOURS * 24;167168/// The version information used to identify this runtime when compiled natively.169#[cfg(feature = "std")]170pub fn native_version() -> NativeVersion {171    NativeVersion {172        runtime_version: VERSION,173        can_author_with: Default::default(),174    }175}176177/// Provides a membership set with only the configured aura users178pub struct ValiudatorsOnly<Runtime: pallet_aura::Config>(PhantomData<Runtime>);179impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {180	fn contains(t: &AccountId) -> bool {181        let arr: [u8; 32] = *t.as_ref();182        let raw_key: Vec<u8> = Vec::from(arr);183184        match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {185            Some(_) => true,186            None => false,187        }  188	}189	fn sorted_members() -> Vec<AccountId> {190        let mut members: Vec<AccountId> = Vec::new();191        for auth in pallet_aura::Module::<Runtime>::authorities() {192            let mut arr: [u8; 32] = Default::default(); 193            let bor_arr = auth.clone().to_raw_vec();194            let slice = bor_arr.as_slice();195            arr.copy_from_slice(slice);196            members.push(AccountId::from(arr));197        }198        members  199	}200	fn count() -> usize {201        pallet_aura::Module::<Runtime>::authorities().len()202	}203}204205impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {206	fn min_len() -> usize {207		1208	}209	fn max_len() -> usize {210		100211	}212}213214type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;215216pub struct DealWithFees;217impl OnUnbalanced<NegativeImbalance> for DealWithFees {218	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {219		if let Some(fees) = fees_then_tips.next() {220			// for fees, 80% to treasury, 20% to author221			let mut split = fees.ration(80, 20);222			if let Some(tips) = fees_then_tips.next() {223				// for tips, if any, 80% to treasury, 20% to author (though this can be anything)224				tips.ration_merge_into(80, 20, &mut split);225			}226			Treasury::on_unbalanced(split.0);227			// Author::on_unbalanced(split.1);228		}229	}230}231232/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.233/// This is used to limit the maximal weight of a single extrinsic.234const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);235/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used236/// by  Operational  extrinsics.237const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);238/// We allow for 2 seconds of compute with a 6 second average block time.239const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;240241parameter_types! {242    pub const BlockHashCount: BlockNumber = 2400;243	pub RuntimeBlockLength: BlockLength =244		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);245    pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);246    pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;247	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()248		.base_block(BlockExecutionWeight::get())249		.for_class(DispatchClass::all(), |weights| {250			weights.base_extrinsic = ExtrinsicBaseWeight::get();251		})252		.for_class(DispatchClass::Normal, |weights| {253			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);254		})255		.for_class(DispatchClass::Operational, |weights| {256			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);257			// Operational transactions have some extra reserved space, so that they258			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.259			weights.reserved = Some(260				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT261			);262		})263		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)264		.build_or_panic();265    pub const Version: RuntimeVersion = VERSION;266    pub const SS58Prefix: u8 = 42;267}268269impl system::Config for Runtime {270    /// The basic call filter to use in dispatchable.271    type BaseCallFilter = ();272    /// The identifier used to distinguish between accounts.273    type AccountId = AccountId;274    /// The aggregated dispatch type that is available for extrinsics.275    type Call = Call;276    /// The lookup mechanism to get account ID from whatever is passed in dispatchers.277    type Lookup = IdentityLookup<AccountId>;278    /// The index type for storing how many extrinsics an account has signed.279    type Index = Index;280    /// The index type for blocks.281    type BlockNumber = BlockNumber;282    /// The type for hashing blocks and tries.283    type Hash = Hash;284    /// The hashing algorithm used.285    type Hashing = BlakeTwo256;286    /// The header type.287    type Header = generic::Header<BlockNumber, BlakeTwo256>;288    /// The ubiquitous event type.289    type Event = Event;290    /// The ubiquitous origin type.291    type Origin = Origin;292    /// Maximum number of block number to block hash mappings to keep (oldest pruned first).293    type BlockHashCount = BlockHashCount;294    /// The weight of database operations that the runtime can invoke.295    type DbWeight = RocksDbWeight;296    /// The weight of the overhead invoked on the block import process, independent of the297    /// extrinsics included in that block.298	type BlockWeights = RuntimeBlockWeights;299    /// Version of the runtime.300    type Version = Version;301 	/// This type is being generated by `construct_runtime!`.302    type PalletInfo = PalletInfo;303    /// What to do if a new account is created.304    type OnNewAccount = ();305    /// What to do if an account is fully reaped from the system.306    type OnKilledAccount = ();307    /// The data to be stored in an account.308    type AccountData = pallet_balances::AccountData<Balance>;309	/// Weight information for the extrinsics of this pallet.310    type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;311    312	type BlockLength = RuntimeBlockLength;313	type SS58Prefix = SS58Prefix;314}315316impl pallet_aura::Config for Runtime {317    type AuthorityId = AuraId;318}319320impl pallet_grandpa::Config for Runtime {321	type Event = Event;322	type Call = Call;323324	type KeyOwnerProofSystem = ();325326	type KeyOwnerProof =327		<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;328329	type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(330		KeyTypeId,331		GrandpaId,332	)>>::IdentificationTuple;333334	type HandleEquivocation = ();335336	type WeightInfo = ();337}338339parameter_types! {340    pub const MinimumPeriod: u64 = SLOT_DURATION / 2;341}342343impl pallet_timestamp::Config for Runtime {344	/// A timestamp: milliseconds since the unix epoch.345	type Moment = u64;346	type OnTimestampSet = Aura;347	type MinimumPeriod = MinimumPeriod;348	type WeightInfo = ();349}350351parameter_types! {352    // pub const ExistentialDeposit: u128 = 500;353    pub const ExistentialDeposit: u128 = 0;354	pub const MaxLocks: u32 = 50;355}356357impl pallet_balances::Config for Runtime {358	type MaxLocks = MaxLocks;359	/// The type for recording an account's balance.360	type Balance = Balance;361	/// The ubiquitous event type.362	type Event = Event;363	type DustRemoval = Treasury;364	type ExistentialDeposit = ExistentialDeposit;365	type AccountStore = System;366	type WeightInfo = ();367}368369pub const MILLICENTS: Balance = 1_000_000_000;370pub const CENTS: Balance = 1_000 * MILLICENTS;371pub const DOLLARS: Balance = 100 * CENTS;372373pub const fn deposit(items: u32, bytes: u32) -> Balance {374    items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS375}376377parameter_types! {378	pub const TombstoneDeposit: Balance = deposit(379		0,380		sp_std::mem::size_of::<pallet_contracts::ContractInfo<Runtime>>() as u32381	);382	pub const DepositPerContract: Balance = TombstoneDeposit::get();383	pub const DepositPerStorageByte: Balance = deposit(0, 1);384	pub const DepositPerStorageItem: Balance = deposit(1, 0);385	pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS);386	pub const SurchargeReward: Balance = 150 * MILLICENTS;387	pub const SignedClaimHandicap: u32 = 2;388	pub const MaxDepth: u32 = 32;389	pub const MaxValueSize: u32 = 16 * 1024;390	// The lazy deletion runs inside on_initialize.391	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *392		RuntimeBlockWeights::get().max_block;393	// The weight needed for decoding the queue should be less or equal than a fifth394	// of the overall weight dedicated to the lazy deletion.395	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (396			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -397			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)398		)) / 5) as u32;399}400401402impl pallet_contracts::Config for Runtime {403	type Time = Timestamp;404	type Randomness = RandomnessCollectiveFlip;405	type Currency = Balances;406	type Event = Event;407	type RentPayment = ();408	type SignedClaimHandicap = SignedClaimHandicap;409	type TombstoneDeposit = TombstoneDeposit;410	type DepositPerContract = DepositPerContract;411	type DepositPerStorageByte = DepositPerStorageByte;412	type DepositPerStorageItem = DepositPerStorageItem;413	type RentFraction = RentFraction;414	type SurchargeReward = SurchargeReward;415	type MaxDepth = MaxDepth;416	type MaxValueSize = MaxValueSize;417	type WeightPrice = pallet_transaction_payment::Module<Self>;418	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;419	type ChainExtension = NFTExtension;420	type DeletionQueueDepth = DeletionQueueDepth;421	type DeletionWeightLimit = DeletionWeightLimit;422}423424parameter_types! {425	pub const TransactionByteFee: Balance = 10 * MILLICENTS;426	pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);427	pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000);428	pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128);429}430431impl pallet_transaction_payment::Config for Runtime {432	type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees>;433	type TransactionByteFee = TransactionByteFee;434	type WeightToFee = IdentityFee<Balance>;435	type FeeMultiplierUpdate =436		TargetedFeeAdjustment<Self, TargetBlockFullness, AdjustmentVariable, MinimumMultiplier>;437}438439parameter_types! {440	pub const ProposalBond: Permill = Permill::from_percent(5);441	pub const ProposalBondMinimum: Balance = 1 * DOLLARS;442	pub const SpendPeriod: BlockNumber = 5 * MINUTES;443	pub const Burn: Permill = Permill::from_percent(0);444	pub const TipCountdown: BlockNumber = 1 * DAYS;445	pub const TipFindersFee: Percent = Percent::from_percent(20);446	pub const TipReportDepositBase: Balance = 1 * DOLLARS;447	pub const DataDepositPerByte: Balance = 1 * CENTS;448	pub const BountyDepositBase: Balance = 1 * DOLLARS;449	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;450	pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");451	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;452	pub const MaximumReasonLength: u32 = 16384;453	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);454	pub const BountyValueMinimum: Balance = 5 * DOLLARS;455}456457impl pallet_treasury::Config for Runtime {458	type ModuleId = TreasuryModuleId;459	type Currency = Balances;460	type ApproveOrigin = EnsureRoot<AccountId>;461	type RejectOrigin = EnsureRoot<AccountId>;462	type Event = Event;463	type OnSlash = ();464	type ProposalBond = ProposalBond;465	type ProposalBondMinimum = ProposalBondMinimum;466	type SpendPeriod = SpendPeriod;467	type Burn = Burn;468	type BurnDestination = ();469	type SpendFunds = ();470	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;471}472473impl pallet_sudo::Config for Runtime {474    type Event = Event;475    type Call = Call;476}477478parameter_types! {479	pub const MinVestedTransfer: Balance = 100 * DOLLARS;480}481482impl pallet_vesting::Config for Runtime {483	type Event = Event;484	type Currency = Balances;485	type BlockNumberToBalance = ConvertInto;486	type MinVestedTransfer = MinVestedTransfer;487	type WeightInfo = ();488}489490/// Used for the module nft in `./nft.rs`491impl pallet_nft::Config for Runtime {492    type Event = Event;493    type WeightInfo = nft_weights::WeightInfo;494}495496construct_runtime!(497    pub enum Runtime where498        Block = Block,499        NodeBlock = opaque::Block,500        UncheckedExtrinsic = UncheckedExtrinsic501    {502        System: system::{Module, Call, Config, Storage, Event<T>},503        RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},504        Contracts: pallet_contracts::{Module, Call, Config<T>, Storage, Event<T>},505        Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},506        Aura: pallet_aura::{Module, Config<T>, Inherent},507        Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},508        Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},509        TransactionPayment: pallet_transaction_payment::{Module, Storage},510        Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},511        Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},512        Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},513        Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},514    }515);516517/// The address format for describing accounts.518pub type Address = AccountId;519/// Block header type as expected by this runtime.520pub type Header = generic::Header<BlockNumber, BlakeTwo256>;521/// Block type as expected by this runtime.522pub type Block = generic::Block<Header, UncheckedExtrinsic>;523/// A Block signed with a Justification524pub type SignedBlock = generic::SignedBlock<Block>;525/// BlockId type as expected by this runtime.526pub type BlockId = generic::BlockId<Block>;527/// The SignedExtension to the basic transaction logic.528pub type SignedExtra = (529    system::CheckSpecVersion<Runtime>,530    system::CheckTxVersion<Runtime>,531    system::CheckGenesis<Runtime>,532    system::CheckEra<Runtime>,533    system::CheckNonce<Runtime>,534    system::CheckWeight<Runtime>,535    pallet_nft::ChargeTransactionPayment<Runtime>,536);537/// Unchecked extrinsic type as expected by this runtime.538pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;539/// Extrinsic type that has already been checked.540pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;541/// Executive: handles dispatch to the various modules.542pub type Executive =543    frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;544545impl_runtime_apis! {546547	impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>548		for Runtime549	{550		fn call(551			origin: AccountId,552			dest: AccountId,553			value: Balance,554			gas_limit: u64,555			input_data: Vec<u8>,556		) -> pallet_contracts_primitives::ContractExecResult {557			Contracts::bare_call(origin, dest, value, gas_limit, input_data)558		}559560		fn get_storage(561			address: AccountId,562			key: [u8; 32],563		) -> pallet_contracts_primitives::GetStorageResult {564			Contracts::get_storage(address, key)565		}566567		fn rent_projection(568			address: AccountId,569		) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {570			Contracts::rent_projection(address)571		}572	}573574    impl sp_api::Core<Block> for Runtime {575        fn version() -> RuntimeVersion {576            VERSION577        }578579        fn execute_block(block: Block) {580            Executive::execute_block(block)581        }582583        fn initialize_block(header: &<Block as BlockT>::Header) {584            Executive::initialize_block(header)585        }586    }587588    impl sp_api::Metadata<Block> for Runtime {589        fn metadata() -> OpaqueMetadata {590            Runtime::metadata().into()591        }592    }593594    impl sp_block_builder::BlockBuilder<Block> for Runtime {595        fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {596            Executive::apply_extrinsic(extrinsic)597        }598599        fn finalize_block() -> <Block as BlockT>::Header {600            Executive::finalize_block()601        }602603        fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {604            data.create_extrinsics()605        }606607        fn check_inherents(608            block: Block,609            data: sp_inherents::InherentData,610        ) -> sp_inherents::CheckInherentsResult {611            data.check_extrinsics(&block)612        }613614        fn random_seed() -> <Block as BlockT>::Hash {615            RandomnessCollectiveFlip::random_seed()616        }617    }618619    impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {620        fn validate_transaction(621            source: TransactionSource,622            tx: <Block as BlockT>::Extrinsic,623        ) -> TransactionValidity {624            Executive::validate_transaction(source, tx)625        }626    }627628    impl sp_offchain::OffchainWorkerApi<Block> for Runtime {629        fn offchain_worker(header: &<Block as BlockT>::Header) {630            Executive::offchain_worker(header)631        }632    }633634    impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {635        fn slot_duration() -> u64 {636            Aura::slot_duration()637        }638639        fn authorities() -> Vec<AuraId> {640            Aura::authorities()641        }642    }643644    impl sp_session::SessionKeys<Block> for Runtime {645        fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {646            opaque::SessionKeys::generate(seed)647        }648649        fn decode_session_keys(650            encoded: Vec<u8>,651        ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {652            opaque::SessionKeys::decode_into_raw_public_keys(&encoded)653        }654    }655656	impl fg_primitives::GrandpaApi<Block> for Runtime {657		fn grandpa_authorities() -> GrandpaAuthorityList {658			Grandpa::grandpa_authorities()659		}660661		fn submit_report_equivocation_unsigned_extrinsic(662			_equivocation_proof: fg_primitives::EquivocationProof<663				<Block as BlockT>::Hash,664				NumberFor<Block>,665			>,666			_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,667		) -> Option<()> {668			None669		}670671		fn generate_key_ownership_proof(672			_set_id: fg_primitives::SetId,673			_authority_id: GrandpaId,674		) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {675			// NOTE: this is the only implementation possible since we've676			// defined our key owner proof type as a bottom type (i.e. a type677			// with no values).678			None679		}680    }681    682	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {683		fn account_nonce(account: AccountId) -> Index {684			System::account_nonce(account)685		}686	}687688	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {689		fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {690			TransactionPayment::query_info(uxt, len)691		}692		fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {693			TransactionPayment::query_fee_details(uxt, len)694		}695	}696697    #[cfg(feature = "runtime-benchmarks")]698	impl frame_benchmarking::Benchmark<Block> for Runtime {699		fn dispatch_benchmark(700			config: frame_benchmarking::BenchmarkConfig701		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {702			use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};703704			let whitelist: Vec<TrackedStorageKey> = vec![705				// Alice account706				hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),707				// // Total Issuance708				// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),709				// // Execution Phase710				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),711				// // Event Count712				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),713				// // System Events714				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),715            ];716717			let mut batches = Vec::<BenchmarkBatch>::new();718			let params = (&config, &whitelist);719720			add_benchmark!(params, batches, pallet_nft, Nft);721722			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }723			Ok(batches)724		}725	}726}