difftreelog
Merge remote-tracking branch 'origin/develop' into feature/NFTPAR-366_upstream_updates
in: master
27 files changed
.github/workflows/node_build_test.ymldiffbeforeafterboth--- a/.github/workflows/node_build_test.yml
+++ b/.github/workflows/node_build_test.yml
@@ -31,14 +31,14 @@
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.SERVER_PORT }}
- # command_timeout: 200m
+ command_timeout: 240m
script: |
eval $(ssh-agent -s)
- ssh-add /home/devops/.ssh/git_hub
+ ssh-add /home/polkadot/.ssh/git_hub
git clone git@github.com:usetech-llc/nft_private.git
cd nft_private
git checkout develop
# git pull --all
chmod +x ci_node.sh
./ci_node.sh
- rm -rf /home/polkadot/nft_private
\ No newline at end of file
+ rm -rf /home/polkadot/nft_private
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1583,14 +1583,14 @@
"log",
"parity-scale-codec 2.0.1",
"sc-client-api",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
- "sp-timestamp",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -1603,9 +1603,9 @@
"kvdb-rocksdb",
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-database",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1621,9 +1621,9 @@
"futures-timer 3.0.2",
"log",
"sc-client-api",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1659,11 +1659,11 @@
"sc-rpc",
"sc-service",
"sha3 0.8.2",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-io",
- "sp-runtime",
- "sp-storage",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
]
@@ -1808,9 +1808,9 @@
"parity-scale-codec 2.0.1",
"rlp 0.5.0",
"sha3 0.8.2",
- "sp-core",
- "sp-runtime",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1822,8 +1822,8 @@
"impl-trait-for-tuples 0.1.3",
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1835,11 +1835,11 @@
"ethereum-types 0.11.0",
"fp-evm",
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1851,10 +1851,10 @@
"ethereum-types 0.11.0",
"fp-evm",
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-core",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1862,18 +1862,37 @@
version = "3.1.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"linregress",
"log",
"parity-scale-codec 2.0.1",
"paste 1.0.4",
- "sp-api",
- "sp-io",
- "sp-runtime",
- "sp-runtime-interface",
- "sp-std",
- "sp-storage",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "frame-benchmarking"
+version = "3.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70fe99487f84579a3f2c4ba52650fec875492eea41be0e4eea8019187f105052"
+dependencies = [
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-system 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "linregress",
+ "parity-scale-codec 2.0.1",
+ "paste 1.0.4",
+ "sp-api 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime-interface 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-storage 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1883,7 +1902,7 @@
dependencies = [
"Inflector",
"chrono",
- "frame-benchmarking",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"handlebars",
"parity-scale-codec 2.0.1",
"sc-cli",
@@ -1891,11 +1910,11 @@
"sc-executor",
"sc-service",
"serde",
- "sp-core",
- "sp-externalities",
- "sp-keystore",
- "sp-runtime",
- "sp-state-machine",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"structopt",
]
@@ -1904,15 +1923,15 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "sp-tracing",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -1922,18 +1941,30 @@
dependencies = [
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
+name = "frame-metadata"
+version = "13.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "073f7bef18421362441a1708f8528e442234954611f95bdc554b313fb321948e"
+dependencies = [
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "frame-support"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"bitflags",
- "frame-metadata",
- "frame-support-procedural",
+ "frame-metadata 13.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support-procedural 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
"log",
"once_cell",
@@ -1941,15 +1972,42 @@
"paste 1.0.4",
"serde",
"smallvec 1.6.1",
- "sp-arithmetic",
- "sp-core",
- "sp-inherents",
- "sp-io",
- "sp-runtime",
- "sp-staking",
- "sp-state-machine",
- "sp-std",
- "sp-tracing",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "frame-support"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04e521e6214615bd82ba6b5fc7fd40a9cc14fdeb40f83da5eba12aa2f8179fb8"
+dependencies = [
+ "bitflags",
+ "frame-metadata 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-support-procedural 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "impl-trait-for-tuples 0.2.1",
+ "log",
+ "once_cell",
+ "parity-scale-codec 2.0.1",
+ "paste 1.0.4",
+ "serde",
+ "smallvec 1.6.1",
+ "sp-arithmetic 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-inherents 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-staking 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-state-machine 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-tracing 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1958,18 +2016,31 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"Inflector",
- "frame-support-procedural-tools",
+ "frame-support-procedural-tools 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"proc-macro2",
"quote",
"syn",
]
[[package]]
+name = "frame-support-procedural"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2668e24cbaba7f0e91d0c92a94bd1ae425a942608ad0b775db32477f5df4da9e"
+dependencies = [
+ "Inflector",
+ "frame-support-procedural-tools 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "frame-support-procedural-tools"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support-procedural-tools-derive",
+ "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"proc-macro-crate 1.0.0",
"proc-macro2",
"quote",
@@ -1977,6 +2048,19 @@
]
[[package]]
+name = "frame-support-procedural-tools"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4f88cfd111e004590f4542b75e6d3302137b9067d7e7219e4ac47a535c3b5c1"
+dependencies = [
+ "frame-support-procedural-tools-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro-crate 0.1.5",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "frame-support-procedural-tools-derive"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
@@ -1987,34 +2071,62 @@
]
[[package]]
+name = "frame-support-procedural-tools-derive"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79285388b120ac96c15a791c56b26b9264f7231324fbe0fd05026acd92bf2e6a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "frame-system"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
"log",
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "sp-version",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
+name = "frame-system"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f5fedbff05d665c00bf4e089b4377fcb15b8bd37ebc3e5fc06665474cf6e25d7"
+dependencies = [
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "impl-trait-for-tuples 0.2.1",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-version 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "frame-system-benchmarking"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
- "sp-core",
- "sp-runtime",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -2023,7 +2135,7 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4012,7 +4124,7 @@
"fc-rpc-core",
"flexi_logger",
"fp-rpc",
- "frame-benchmarking",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"frame-benchmarking-cli",
"futures 0.3.12",
"jsonrpc-core 15.1.0",
@@ -4040,16 +4152,16 @@
"sc-transaction-pool",
"serde",
"serde_json",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-aura",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-finality-grandpa",
- "sp-inherents",
- "sp-runtime",
- "sp-timestamp",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"structopt",
"substrate-build-script-utils",
@@ -4061,25 +4173,26 @@
version = "3.0.0"
dependencies = [
"fp-rpc",
- "frame-benchmarking",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"frame-executive",
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"hex-literal",
"pallet-aura",
- "pallet-balances",
+ "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-contracts",
"pallet-contracts-primitives",
"pallet-contracts-rpc-runtime-api",
"pallet-ethereum",
"pallet-evm",
"pallet-grandpa",
+ "pallet-inflation",
"pallet-nft",
- "pallet-randomness-collective-flip",
+ "pallet-randomness-collective-flip 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-sudo",
- "pallet-timestamp",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
@@ -4087,18 +4200,18 @@
"parity-scale-codec 2.0.1",
"serde",
"smallvec 1.6.1",
- "sp-api",
- "sp-arithmetic",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-consensus-aura",
- "sp-core",
- "sp-inherents",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-offchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-session",
- "sp-std",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-wasm-builder",
]
@@ -4244,16 +4357,16 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-session",
- "pallet-timestamp",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-application-crypto",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-consensus-aura",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4261,14 +4374,14 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
"parity-scale-codec 2.0.1",
"sp-authorship",
- "sp-inherents",
- "sp-runtime",
- "sp-std",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4276,14 +4389,29 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"log",
"parity-scale-codec 2.0.1",
"serde",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "pallet-balances"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41aaeaf084e594273f82bcbf96416ef1fcab602e15dd1df04b9930eceb2eb518"
+dependencies = [
+ "frame-benchmarking 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-system 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4291,8 +4419,8 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"log",
"pallet-contracts-primitives",
"pallet-contracts-proc-macro",
@@ -4300,11 +4428,11 @@
"parity-wasm 0.41.0",
"pwasm-utils 0.16.0",
"serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-sandbox",
- "sp-std",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmi-validation",
]
@@ -4315,8 +4443,8 @@
dependencies = [
"bitflags",
"parity-scale-codec 2.0.1",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4341,11 +4469,11 @@
"pallet-contracts-rpc-runtime-api",
"parity-scale-codec 2.0.1",
"serde",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-rpc",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4355,9 +4483,9 @@
dependencies = [
"pallet-contracts-primitives",
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4372,20 +4500,20 @@
"fp-evm",
"fp-rpc",
"fp-storage",
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"libsecp256k1",
- "pallet-balances",
+ "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-evm",
- "pallet-timestamp",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"rlp 0.5.0",
"rustc-hex",
"serde",
"sha3 0.8.2",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4397,21 +4525,21 @@
"evm-gasometer",
"evm-runtime",
"fp-evm",
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
"log",
- "pallet-balances",
- "pallet-timestamp",
+ "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"primitive-types 0.9.0",
"rlp 0.5.0",
"serde",
"sha3 0.8.2",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4419,21 +4547,39 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"log",
"pallet-authorship",
"pallet-session",
"parity-scale-codec 2.0.1",
"serde",
- "sp-application-crypto",
- "sp-core",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-finality-grandpa",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-session",
- "sp-staking",
- "sp-std",
+ "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "pallet-inflation"
+version = "3.0.0"
+dependencies = [
+ "frame-benchmarking 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-system 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pallet-randomness-collective-flip 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pallet-timestamp 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4443,25 +4589,25 @@
"ethereum",
"ethereum-tx-sign",
"fp-evm",
- "frame-benchmarking",
- "frame-support",
- "frame-system",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"hex-literal",
- "pallet-balances",
+ "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-contracts",
"pallet-ethereum",
"pallet-evm",
- "pallet-randomness-collective-flip",
- "pallet-timestamp",
+ "pallet-randomness-collective-flip 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"pallet-transaction-payment",
"parity-scale-codec 2.0.1",
"rlp 0.5.0",
"serde",
- "sp-api",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4469,12 +4615,26 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "parity-scale-codec 2.0.1",
+ "safe-mix",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "pallet-randomness-collective-flip"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca3ea6fa9aa36735ec11d7ec4d97dd6472650c0656fdc6d4adaca2578bd71134"
+dependencies = [
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-system 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-scale-codec 2.0.1",
"safe-mix",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4482,19 +4642,19 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
- "pallet-timestamp",
+ "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-session",
- "sp-staking",
- "sp-std",
- "sp-trie",
+ "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4502,13 +4662,13 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4516,18 +4676,36 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
+ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
"log",
"parity-scale-codec 2.0.1",
"serde",
- "sp-inherents",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "sp-timestamp",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "pallet-timestamp"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b17dd274716a55a2c3e34d9c0ed66aaac3d7e0393ec9fd985e2b8532d697a7f3"
+dependencies = [
+ "frame-benchmarking 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-support 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "frame-system 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "impl-trait-for-tuples 0.2.1",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-inherents 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-timestamp 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4535,15 +4713,15 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
"smallvec 1.6.1",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4556,11 +4734,11 @@
"jsonrpc-derive 15.1.0",
"pallet-transaction-payment-rpc-runtime-api",
"parity-scale-codec 2.0.1",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-rpc",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4570,8 +4748,8 @@
dependencies = [
"pallet-transaction-payment",
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-runtime",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4579,14 +4757,14 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"impl-trait-for-tuples 0.2.1",
- "pallet-balances",
+ "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -4595,12 +4773,12 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"enumflags2",
- "frame-support",
- "frame-system",
+ "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"parity-scale-codec 2.0.1",
"serde",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -5818,12 +5996,12 @@
"sc-client-api",
"sc-proposer-metrics",
"sc-telemetry",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"substrate-prometheus-endpoint",
]
@@ -5835,13 +6013,13 @@
dependencies = [
"parity-scale-codec 2.0.1",
"sc-client-api",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
- "sp-state-machine",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -5861,8 +6039,8 @@
"serde_json",
"sp-chain-spec",
"sp-consensus-babe",
- "sp-core",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -5901,13 +6079,13 @@
"serde",
"serde_json",
"sp-blockchain",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-keyring",
- "sp-keystore",
- "sp-panic-handler",
- "sp-runtime",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"structopt",
"thiserror",
"tiny-bip39",
@@ -5929,22 +6107,22 @@
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
"sc-executor",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-database",
- "sp-externalities",
- "sp-inherents",
- "sp-keystore",
- "sp-runtime",
- "sp-state-machine",
- "sp-std",
- "sp-storage",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
- "sp-trie",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -5967,14 +6145,14 @@
"sc-client-api",
"sc-executor",
"sc-state-db",
- "sp-arithmetic",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-database",
- "sp-runtime",
- "sp-state-machine",
- "sp-trie",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -5986,7 +6164,7 @@
"sc-client-api",
"sp-blockchain",
"sp-consensus",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6004,20 +6182,20 @@
"sc-client-api",
"sc-consensus-slots",
"sc-telemetry",
- "sp-api",
- "sp-application-crypto",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-aura",
"sp-consensus-slots",
- "sp-core",
- "sp-inherents",
- "sp-io",
- "sp-keystore",
- "sp-runtime",
- "sp-timestamp",
- "sp-version",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -6048,22 +6226,22 @@
"sc-telemetry",
"schnorrkel",
"serde",
- "sp-api",
- "sp-application-crypto",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-babe",
"sp-consensus-slots",
"sp-consensus-vrf",
- "sp-core",
- "sp-inherents",
- "sp-io",
- "sp-keystore",
- "sp-runtime",
- "sp-timestamp",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -6077,7 +6255,7 @@
"parking_lot 0.11.1",
"sc-client-api",
"sp-blockchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6092,17 +6270,17 @@
"parking_lot 0.11.1",
"sc-client-api",
"sc-telemetry",
- "sp-api",
- "sp-application-crypto",
- "sp-arithmetic",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
"sp-consensus-slots",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
- "sp-state-machine",
- "sp-trie",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
@@ -6115,9 +6293,9 @@
"sc-client-api",
"sp-authorship",
"sp-consensus",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6135,17 +6313,17 @@
"sc-executor-common",
"sc-executor-wasmi",
"sc-executor-wasmtime",
- "sp-api",
- "sp-core",
- "sp-externalities",
- "sp-io",
- "sp-panic-handler",
- "sp-runtime-interface",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-serializer",
"sp-tasks",
- "sp-trie",
- "sp-version",
- "sp-wasm-interface",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmi",
]
@@ -6158,9 +6336,9 @@
"parity-scale-codec 2.0.1",
"parity-wasm 0.41.0",
"sp-allocator",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-serializer",
- "sp-wasm-interface",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
"wasmi",
]
@@ -6174,9 +6352,9 @@
"parity-scale-codec 2.0.1",
"sc-executor-common",
"sp-allocator",
- "sp-core",
- "sp-runtime-interface",
- "sp-wasm-interface",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmi",
]
@@ -6192,9 +6370,9 @@
"sc-executor-common",
"scoped-tls",
"sp-allocator",
- "sp-core",
- "sp-runtime-interface",
- "sp-wasm-interface",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmtime",
]
@@ -6223,16 +6401,16 @@
"sc-network-gossip",
"sc-telemetry",
"serde_json",
- "sp-api",
- "sp-application-crypto",
- "sp-arithmetic",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-finality-grandpa",
- "sp-inherents",
- "sp-keystore",
- "sp-runtime",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
"substrate-prometheus-endpoint",
]
@@ -6249,7 +6427,7 @@
"sc-client-api",
"sc-network",
"sp-blockchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"sp-utils",
"wasm-timer",
@@ -6269,9 +6447,9 @@
"parking_lot 0.11.1",
"rand 0.7.3",
"serde_json",
- "sp-application-crypto",
- "sp-core",
- "sp-keystore",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"subtle 2.4.0",
]
@@ -6286,12 +6464,12 @@
"parking_lot 0.11.1",
"sc-client-api",
"sc-executor",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-core",
- "sp-externalities",
- "sp-runtime",
- "sp-state-machine",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6333,11 +6511,11 @@
"serde",
"serde_json",
"smallvec 1.6.1",
- "sp-arithmetic",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-consensus",
- "sp-core",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
"substrate-prometheus-endpoint",
"thiserror",
@@ -6358,7 +6536,7 @@
"log",
"lru",
"sc-network",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
"wasm-timer",
]
@@ -6383,10 +6561,10 @@
"sc-client-api",
"sc-keystore",
"sc-network",
- "sp-api",
- "sp-core",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-offchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
"threadpool",
]
@@ -6432,19 +6610,19 @@
"sc-rpc-api",
"sc-tracing",
"serde_json",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
"sp-chain-spec",
- "sp-core",
- "sp-keystore",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-offchain",
"sp-rpc",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-session",
- "sp-state-machine",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6464,11 +6642,11 @@
"serde",
"serde_json",
"sp-chain-spec",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-rpc",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -6485,7 +6663,7 @@
"log",
"serde",
"serde_json",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
]
@@ -6526,24 +6704,24 @@
"sc-transaction-pool",
"serde",
"serde_json",
- "sp-api",
- "sp-application-crypto",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
- "sp-core",
- "sp-externalities",
- "sp-inherents",
- "sp-io",
- "sp-keystore",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-session",
- "sp-state-machine",
- "sp-tracing",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
- "sp-trie",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
"tempfile",
"thiserror",
@@ -6563,7 +6741,7 @@
"parity-util-mem-derive",
"parking_lot 0.11.1",
"sc-client-api",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
@@ -6604,7 +6782,7 @@
"sc-tracing-proc-macro",
"serde",
"serde_json",
- "sp-tracing",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
"tracing",
"tracing-core",
@@ -6639,8 +6817,8 @@
"retain_mut",
"serde",
"sp-blockchain",
- "sp-core",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"sp-utils",
"thiserror",
@@ -6661,11 +6839,11 @@
"parking_lot 0.11.1",
"sc-client-api",
"sc-transaction-graph",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-core",
- "sp-runtime",
- "sp-tracing",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
"sp-utils",
"substrate-prometheus-endpoint",
@@ -7067,9 +7245,9 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"log",
- "sp-core",
- "sp-std",
- "sp-wasm-interface",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
@@ -7081,16 +7259,33 @@
"hash-db",
"log",
"parity-scale-codec 2.0.1",
- "sp-api-proc-macro",
- "sp-core",
- "sp-runtime",
- "sp-state-machine",
- "sp-std",
- "sp-version",
+ "sp-api-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
[[package]]
+name = "sp-api"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e63c3460d5daecf67df542c34c2bbd636214a5a200d4bddcfa2ffb9e72c346af"
+dependencies = [
+ "hash-db",
+ "parity-scale-codec 2.0.1",
+ "sp-api-proc-macro 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-state-machine 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-version 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thiserror",
+]
+
+[[package]]
name = "sp-api-proc-macro"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
@@ -7103,15 +7298,41 @@
]
[[package]]
+name = "sp-api-proc-macro"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "289624f4fe0f61e63a5019ed26c3bc732b5145eb52796ac6053cd72656d947a1"
+dependencies = [
+ "blake2-rfc",
+ "proc-macro-crate 0.1.5",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "sp-application-crypto"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
"serde",
- "sp-core",
- "sp-io",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-application-crypto"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c52e2e6d43036b97c4fce1ed87c5262c1ffdc78c655ada4d3024a3f8094bdd2c"
+dependencies = [
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7123,19 +7344,33 @@
"num-traits",
"parity-scale-codec 2.0.1",
"serde",
- "sp-debug-derive",
- "sp-std",
+ "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
+name = "sp-arithmetic"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0f1c69966c192d1dee8521f0b29ece2b14db07b9b44d801a94e295234761645"
+dependencies = [
+ "integer-sqrt",
+ "num-traits",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-debug-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "sp-authorship"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-inherents",
- "sp-runtime",
- "sp-std",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7144,10 +7379,10 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-inherents",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7160,11 +7395,11 @@
"lru",
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-consensus",
"sp-database",
- "sp-runtime",
- "sp-state-machine",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
@@ -7189,15 +7424,15 @@
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
"serde",
- "sp-api",
- "sp-core",
- "sp-inherents",
- "sp-runtime",
- "sp-state-machine",
- "sp-std",
- "sp-trie",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-utils",
- "sp-version",
+ "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"substrate-prometheus-endpoint",
"thiserror",
"wasm-timer",
@@ -7209,13 +7444,13 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-application-crypto",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-consensus-slots",
- "sp-inherents",
- "sp-runtime",
- "sp-std",
- "sp-timestamp",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7226,17 +7461,17 @@
"merlin",
"parity-scale-codec 2.0.1",
"serde",
- "sp-api",
- "sp-application-crypto",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-consensus",
"sp-consensus-slots",
"sp-consensus-vrf",
- "sp-core",
- "sp-inherents",
- "sp-keystore",
- "sp-runtime",
- "sp-std",
- "sp-timestamp",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7245,8 +7480,8 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-arithmetic",
- "sp-runtime",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7256,9 +7491,9 @@
dependencies = [
"parity-scale-codec 2.0.1",
"schnorrkel",
- "sp-core",
- "sp-runtime",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7291,11 +7526,56 @@
"secrecy",
"serde",
"sha2 0.9.3",
- "sp-debug-derive",
- "sp-externalities",
- "sp-runtime-interface",
- "sp-std",
- "sp-storage",
+ "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "substrate-bip39",
+ "thiserror",
+ "tiny-bip39",
+ "tiny-keccak",
+ "twox-hash",
+ "wasmi",
+ "zeroize",
+]
+
+[[package]]
+name = "sp-core"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "abbc8d4e9b8a7d5819ed26f1374017bb32833ef4890e4ff065e1da30669876bc"
+dependencies = [
+ "base58",
+ "blake2-rfc",
+ "byteorder",
+ "dyn-clonable",
+ "ed25519-dalek",
+ "futures 0.3.12",
+ "hash-db",
+ "hash256-std-hasher",
+ "hex",
+ "impl-serde",
+ "lazy_static",
+ "libsecp256k1",
+ "log",
+ "merlin",
+ "num-traits",
+ "parity-scale-codec 2.0.1",
+ "parity-util-mem",
+ "parking_lot 0.11.1",
+ "primitive-types 0.9.0",
+ "rand 0.7.3",
+ "regex",
+ "schnorrkel",
+ "secrecy",
+ "serde",
+ "sha2 0.9.3",
+ "sp-debug-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-externalities 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime-interface 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-storage 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"substrate-bip39",
"thiserror",
"tiny-bip39",
@@ -7325,14 +7605,37 @@
]
[[package]]
+name = "sp-debug-derive"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "sp-externalities"
version = "0.9.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"environmental",
"parity-scale-codec 2.0.1",
- "sp-std",
- "sp-storage",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-externalities"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fdc625f8c7b13b9a136d334888b21b5743d2081cb666cb03efca1dc9b8f74d1"
+dependencies = [
+ "environmental",
+ "parity-scale-codec 2.0.1",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-storage 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7344,12 +7647,12 @@
"log",
"parity-scale-codec 2.0.1",
"serde",
- "sp-api",
- "sp-application-crypto",
- "sp-core",
- "sp-keystore",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7359,12 +7662,25 @@
dependencies = [
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
- "sp-core",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
[[package]]
+name = "sp-inherents"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2542380b535c6941502a0a3069a657eb5abb70fd67b11afa164d4a4b038ba73a"
+dependencies = [
+ "parity-scale-codec 2.0.1",
+ "parking_lot 0.11.1",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thiserror",
+]
+
+[[package]]
name = "sp-io"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
@@ -7375,27 +7691,52 @@
"log",
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
- "sp-core",
- "sp-externalities",
- "sp-keystore",
- "sp-runtime-interface",
- "sp-state-machine",
- "sp-std",
- "sp-tracing",
- "sp-trie",
- "sp-wasm-interface",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"tracing",
"tracing-core",
]
[[package]]
+name = "sp-io"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33fd69f0a6e91bedc2fb1c5cc3689c212474b6c918274cb4cb14dbbe3c428c14"
+dependencies = [
+ "futures 0.3.12",
+ "hash-db",
+ "libsecp256k1",
+ "log",
+ "parity-scale-codec 2.0.1",
+ "parking_lot 0.11.1",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-externalities 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-keystore 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime-interface 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-state-machine 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-tracing 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-trie 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-wasm-interface 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tracing",
+ "tracing-core",
+]
+
+[[package]]
name = "sp-keyring"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"lazy_static",
- "sp-core",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"strum",
]
@@ -7412,8 +7753,25 @@
"parking_lot 0.11.1",
"schnorrkel",
"serde",
- "sp-core",
- "sp-externalities",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-keystore"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db6ccd2baf189112355338e8b224dc513cd239b974dbd717f12b3dc7a7248c3b"
+dependencies = [
+ "async-trait",
+ "derive_more",
+ "futures 0.3.12",
+ "merlin",
+ "parity-scale-codec 2.0.1",
+ "parking_lot 0.11.1",
+ "schnorrkel",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-externalities 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7421,9 +7779,9 @@
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
- "sp-api",
- "sp-core",
- "sp-runtime",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7435,12 +7793,21 @@
]
[[package]]
+name = "sp-panic-handler"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54702e109f1c8a870dd4065a497d2612d42cec5817126e96cc0658c5ea975784"
+dependencies = [
+ "backtrace",
+]
+
+[[package]]
name = "sp-rpc"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"serde",
- "sp-core",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7457,11 +7824,33 @@
"paste 1.0.4",
"rand 0.7.3",
"serde",
- "sp-application-crypto",
- "sp-arithmetic",
- "sp-core",
- "sp-io",
- "sp-std",
+ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-runtime"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfa4b353b76f04616dbdb8d269d58dcac47acb31c006d3b70e7b64233e68695e"
+dependencies = [
+ "either",
+ "hash256-std-hasher",
+ "impl-trait-for-tuples 0.2.1",
+ "log",
+ "parity-scale-codec 2.0.1",
+ "parity-util-mem",
+ "paste 1.0.4",
+ "rand 0.7.3",
+ "serde",
+ "sp-application-crypto 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-arithmetic 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-io 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7472,12 +7861,30 @@
"impl-trait-for-tuples 0.2.1",
"parity-scale-codec 2.0.1",
"primitive-types 0.9.0",
- "sp-externalities",
- "sp-runtime-interface-proc-macro",
- "sp-std",
- "sp-storage",
- "sp-tracing",
- "sp-wasm-interface",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "static_assertions",
+]
+
+[[package]]
+name = "sp-runtime-interface"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2e5c88b4bc8d607e4e2ff767a85db58cf7101f3dd6064f06929342ea67fe8fb"
+dependencies = [
+ "impl-trait-for-tuples 0.2.1",
+ "parity-scale-codec 2.0.1",
+ "primitive-types 0.9.0",
+ "sp-externalities 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime-interface-proc-macro 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-storage 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-tracing 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-wasm-interface 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"static_assertions",
]
@@ -7494,15 +7901,28 @@
]
[[package]]
+name = "sp-runtime-interface-proc-macro"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19a6c7c2251512c9e533d15db8a863b06ece1cbee778130dd9adbe44b6b39aa9"
+dependencies = [
+ "Inflector",
+ "proc-macro-crate 0.1.5",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "sp-sandbox"
version = "0.9.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-core",
- "sp-io",
- "sp-std",
- "sp-wasm-interface",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmi",
]
@@ -7521,11 +7941,11 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-core",
- "sp-runtime",
- "sp-staking",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7534,8 +7954,19 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-staking"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc729eb10f8809c61a1fe439ac118a4413de004aaf863003ee8752ac0b596e73"
+dependencies = [
+ "parity-scale-codec 2.0.1",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7550,22 +7981,51 @@
"parking_lot 0.11.1",
"rand 0.7.3",
"smallvec 1.6.1",
- "sp-core",
- "sp-externalities",
- "sp-panic-handler",
- "sp-std",
- "sp-trie",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
"trie-db",
"trie-root",
]
[[package]]
+name = "sp-state-machine"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46fa4143e58e9130f726d4e8a9b86f3530a8bd19a2eedcdcf4af205f4b5a6d4f"
+dependencies = [
+ "hash-db",
+ "log",
+ "num-traits",
+ "parity-scale-codec 2.0.1",
+ "parking_lot 0.11.1",
+ "rand 0.7.3",
+ "smallvec 1.6.1",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-externalities 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-panic-handler 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-trie 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thiserror",
+ "trie-db",
+ "trie-root",
+]
+
+[[package]]
name = "sp-std"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
[[package]]
+name = "sp-std"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35391ea974fa5ee869cb094d5b437688fbf3d8127d64d1b9fed5822a1ed39b12"
+
+[[package]]
name = "sp-storage"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
@@ -7574,8 +8034,22 @@
"parity-scale-codec 2.0.1",
"ref-cast",
"serde",
- "sp-debug-derive",
- "sp-std",
+ "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-storage"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86af458d4a0251c490cdde9dcaaccb88d398f3b97ac6694cdd49ed9337e6b961"
+dependencies = [
+ "impl-serde",
+ "parity-scale-codec 2.0.1",
+ "ref-cast",
+ "serde",
+ "sp-debug-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7584,11 +8058,11 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"log",
- "sp-core",
- "sp-externalities",
- "sp-io",
- "sp-runtime-interface",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
]
[[package]]
@@ -7597,21 +8071,50 @@
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"parity-scale-codec 2.0.1",
- "sp-api",
- "sp-inherents",
- "sp-runtime",
- "sp-std",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasm-timer",
]
[[package]]
+name = "sp-timestamp"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27387c541197b9f47f3d9ddcab5649a3ecdca582d2f2ea2b511af24a3d3cbf83"
+dependencies = [
+ "impl-trait-for-tuples 0.2.1",
+ "parity-scale-codec 2.0.1",
+ "sp-api 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-inherents 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "wasm-timer",
+]
+
+[[package]]
name = "sp-tracing"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6"
dependencies = [
"log",
"parity-scale-codec 2.0.1",
- "sp-std",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "tracing",
+ "tracing-core",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "sp-tracing"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567382d8d4e14fb572752863b5cd57a78f9e9a6583332b590b726f061f3ea957"
+dependencies = [
+ "log",
+ "parity-scale-codec 2.0.1",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tracing",
"tracing-core",
"tracing-subscriber",
@@ -7627,9 +8130,9 @@
"log",
"parity-scale-codec 2.0.1",
"serde",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-blockchain",
- "sp-runtime",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"thiserror",
]
@@ -7641,8 +8144,23 @@
"hash-db",
"memory-db",
"parity-scale-codec 2.0.1",
- "sp-core",
- "sp-std",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "trie-db",
+ "trie-root",
+]
+
+[[package]]
+name = "sp-trie"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b85b7f745da41ef825c6f7b93f1fdc897b03df94a4884adfbb70fbcd0aed1298"
+dependencies = [
+ "hash-db",
+ "memory-db",
+ "parity-scale-codec 2.0.1",
+ "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"trie-db",
"trie-root",
]
@@ -7667,8 +8185,21 @@
"impl-serde",
"parity-scale-codec 2.0.1",
"serde",
- "sp-runtime",
- "sp-std",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+]
+
+[[package]]
+name = "sp-version"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbeffa538a13d715d30e01d57a2636ba32845b737a29a3ea32403576588222e7"
+dependencies = [
+ "impl-serde",
+ "parity-scale-codec 2.0.1",
+ "serde",
+ "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -7678,11 +8209,23 @@
dependencies = [
"impl-trait-for-tuples 0.2.1",
"parity-scale-codec 2.0.1",
- "sp-std",
+ "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"wasmi",
]
[[package]]
+name = "sp-wasm-interface"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b214e125666a6416cf30a70cc6a5dacd34a4e5197f8a3d479f714af7e1dc7a47"
+dependencies = [
+ "impl-trait-for-tuples 0.2.1",
+ "parity-scale-codec 2.0.1",
+ "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "wasmi",
+]
+
+[[package]]
name = "spin"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -7816,11 +8359,11 @@
"sc-client-api",
"sc-rpc-api",
"serde",
- "sp-api",
+ "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-block-builder",
"sp-blockchain",
- "sp-core",
- "sp-runtime",
+ "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
+ "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)",
"sp-transaction-pool",
]
Dockerfile-testsdiffbeforeafterboth--- a/Dockerfile-tests
+++ b/Dockerfile-tests
@@ -20,11 +20,14 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install v15.0.1 && \
nvm use v15.0.1 && \
- npm install --save @polkadot/api
+ npm install --save @polkadot/api && \
+ npm install --save-dev mochawesome
CMD export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd tests && \
- npm install --global yarn && \
+ npm install --global yarn && \
+ yarn add mochawesome && \
yarn install && \
- yarn test
+ yarn test --reporter mochawesome
+ # yarn test
ci_node.shdiffbeforeafterboth--- a/ci_node.sh
+++ b/ci_node.sh
@@ -1,10 +1,12 @@
#!/bin/bash
-docker-compose -f docker-compose-tests.yml up -d --build --force-recreate --no-deps
+#docker-compose -f docker-compose-tests.yml up -d --build --force-recreate --no-deps
+
+docker-compose -f docker-compose-tests.yml up -d --build
# validate if testing container finished
-while [ "$(docker ps | grep unit_test | wc -l)" -ge 1 ]; do echo "Unit test in process" && date && sleep 60; done && docker logs unit_test &> /home/polkadot/unit_test.log & \
-while [ "$(docker ps | grep integration_test | wc -l)" -ge 1 ]; do echo "Integration test in process" && sleep 60; done && docker logs integration_test &> /home/polkadot/integration_test.log
+while [ "$(docker ps | grep unit_test | wc -l)" -ge 1 ]; do echo "Unit tests in process" && sleep 600; done && docker logs unit_test &> /home/polkadot/report-log/unit_test.log & \
+while [ "$(docker ps | grep integration_test | wc -l)" -ge 1 ]; do echo "Integration tests in process" && sleep 600; done && docker logs integration_test &> /home/polkadot/report-log/integration_test.log
docker-compose -f docker-compose-tests.yml down -v
-echo "Wrokflow finished"
-docker system prune --force
\ No newline at end of file
+echo "Workflow finished"
+docker system prune --force
docker-compose-tests.ymldiffbeforeafterboth--- a/docker-compose-tests.yml
+++ b/docker-compose-tests.yml
@@ -21,14 +21,16 @@
build:
context: ./
dockerfile: Dockerfile-tests
- volumes:
+ volumes:
- ./tests/src/config_docker.ts:/nft_parachain/tests/src/config.ts
+ - /home/polkadot/mochawesome-report:/nft_parachain/tests/mochawesome-report
+ # command: bash -c 'while true; do sleep 20; df -h; done'
networks:
- node_test_network
depends_on:
- node_validator1
- unit_tests:
+ unit_tests:
container_name: unit_test
image: nft_unit_test
build:
@@ -43,4 +45,4 @@
networks:
node_test_network:
name: node_test_network
- driver: bridge
\ No newline at end of file
+ driver: bridge
pallets/inflation/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/inflation/Cargo.toml
@@ -0,0 +1,48 @@
+[package]
+authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
+description = 'Unqiue pallet inflation'
+edition = '2018'
+homepage = 'https://substrate.io'
+license = 'Unlicense'
+name = 'pallet-inflation'
+repository = 'https://github.com/usetech-llc/nft_private/'
+version = '3.0.0'
+
+[package.metadata.docs.rs]
+targets = ['x86_64-unknown-linux-gnu']
+
+# alias "parity-scale-code" to "codec"
+[dependencies.codec]
+default-features = false
+features = ['derive']
+package = 'parity-scale-codec'
+version = '2.0.0'
+
+[dependencies]
+serde = { version = "1.0.119" }
+frame-support = { default-features = false, version = '3.0.0' }
+frame-system = { default-features = false, version = '3.0.0' }
+pallet-balances = { default-features = false, version = '3.0.0' }
+pallet-timestamp = { default-features = false, version = '3.0.0' }
+pallet-randomness-collective-flip = { default-features = false, version = '3.0.0' }
+sp-std = { default-features = false, version = '3.0.0' }
+frame-benchmarking = { default-features = false, version = "3.0.0", optional = true }
+sp-core = { default-features = false, version = '3.0.0' }
+sp-io = { default-features = false, version = '3.0.0' }
+sp-runtime = { default-features = false, version = '3.0.0' }
+
+[features]
+default = ['std']
+std = [
+ 'codec/std',
+ 'serde/std',
+ 'frame-support/std',
+ 'frame-system/std',
+ 'pallet-balances/std',
+ 'pallet-timestamp/std',
+ 'pallet-randomness-collective-flip/std',
+ 'sp-std/std',
+ 'sp-runtime/std',
+ 'frame-benchmarking/std',
+]
+runtime-benchmarks = ["frame-benchmarking"]
pallets/inflation/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/inflation/src/benchmarking.rs
@@ -0,0 +1,19 @@
+#![cfg(feature = "runtime-benchmarks")]
+
+use super::*;
+use crate::Module as Inflation;
+
+use sp_std::prelude::*;
+use frame_system::RawOrigin;
+use frame_benchmarking::{benchmarks};
+use frame_support::traits::OnInitialize;
+
+benchmarks! {
+
+ on_initialize {
+ let block1: T::BlockNumber = T::BlockNumber::from(1u32);
+ let block2: T::BlockNumber = T::BlockNumber::from(2u32);
+ Inflation::<T>::on_initialize(block1); // Create Treasury account
+ }: { Inflation::<T>::on_initialize(block2); } // Benchmark deposit_into_existing path
+
+}
pallets/inflation/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/inflation/src/lib.rs
@@ -0,0 +1,130 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+#![recursion_limit = "1024"]
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(feature = "std")]
+pub use std::*;
+
+#[cfg(feature = "std")]
+pub use serde::*;
+
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
+
+#[cfg(test)]
+mod tests;
+
+pub use frame_support::{
+ construct_runtime, decl_module, decl_storage,
+ ensure,
+ traits::{
+ Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
+ Randomness, IsSubType, WithdrawReasons,
+ },
+ weights::{
+ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+ WeightToFeePolynomial, DispatchClass,
+ },
+ StorageValue,
+ transactional,
+};
+
+// #[cfg(feature = "runtime-benchmarks")]
+pub use frame_support::dispatch::DispatchResult;
+
+use sp_runtime::{
+ Perbill,
+ traits::{Zero}
+};
+use sp_std::convert::TryInto;
+
+use frame_system::{self as system};
+
+/// The balance type of this module.
+pub type BalanceOf<T> =
+ <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
+
+pub const YEAR: u32 = 5_259_600;
+pub const TOTAL_YEARS_UNTIL_FLAT: u32 = 9;
+pub const START_INFLATION_PERCENT: u32 = 10;
+pub const END_INFLATION_PERCENT: u32 = 4;
+
+pub trait Config: system::Config {
+ type Currency: Currency<Self::AccountId>;
+ type TreasuryAccountId: Get<Self::AccountId>;
+ type InflationBlockInterval: Get<Self::BlockNumber>;
+}
+
+decl_storage! {
+ trait Store for Module<T: Config> as Inflation {
+ /// starting year total issuance
+ pub StartingYearTotalIssuance get(fn starting_year_total_issuance): BalanceOf<T>;
+
+ /// Current block inflation
+ pub BlockInflation get(fn block_inflation): BalanceOf<T>;
+ }
+}
+
+decl_module! {
+ pub struct Module<T: Config> for enum Call
+ where
+ origin: T::Origin,
+ {
+ const InflationBlockInterval: T::BlockNumber = T::InflationBlockInterval::get();
+
+ fn on_initialize(now: T::BlockNumber) -> Weight
+ {
+ let mut consumed_weight = 0;
+ let mut add_weight = |reads, writes, weight| {
+ consumed_weight += T::DbWeight::get().reads_writes(reads, writes);
+ consumed_weight += weight;
+ };
+
+ let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0);
+
+ // Recalculate inflation on the first block of the year (or if it is not initialized yet)
+ if (now % T::BlockNumber::from(YEAR)).is_zero() || <BlockInflation<T>>::get().is_zero() {
+ let current_year: u32 = (now / T::BlockNumber::from(YEAR)).try_into().unwrap_or(0);
+
+ let one_percent = Perbill::from_percent(1);
+
+ if current_year <= TOTAL_YEARS_UNTIL_FLAT {
+ let amount: BalanceOf<T> = Perbill::from_rational_approximation(
+ block_interval * (START_INFLATION_PERCENT * TOTAL_YEARS_UNTIL_FLAT - current_year * (START_INFLATION_PERCENT - END_INFLATION_PERCENT)),
+ YEAR * TOTAL_YEARS_UNTIL_FLAT
+ ) * ( one_percent * T::Currency::total_issuance() );
+ <BlockInflation<T>>::put(amount);
+ }
+ else {
+ let amount: BalanceOf<T> = Perbill::from_rational_approximation(
+ block_interval * END_INFLATION_PERCENT,
+ YEAR
+ ) * (one_percent * T::Currency::total_issuance());
+ <BlockInflation<T>>::put(amount);
+ }
+ <StartingYearTotalIssuance<T>>::set(T::Currency::total_issuance());
+
+ // First time deposit
+ T::Currency::deposit_creating(&T::TreasuryAccountId::get(), <BlockInflation<T>>::get());
+
+ add_weight(7, 6, 28_300_000);
+ }
+
+ // Apply inflation every InflationBlockInterval blocks and in the 1st block to initialize Treasury account
+ else if (now % T::BlockNumber::from(block_interval)).is_zero() {
+ T::Currency::deposit_into_existing(&T::TreasuryAccountId::get(), <BlockInflation<T>>::get()).ok();
+
+ add_weight(3, 2, 12_900_000);
+ }
+
+ consumed_weight
+ }
+
+ }
+}
pallets/inflation/src/tests.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/inflation/src/tests.rs
@@ -0,0 +1,241 @@
+#[cfg(test)]
+mod tests {
+ use crate as pallet_inflation;
+
+ use frame_system;
+ use frame_support::{traits::{Currency}, parameter_types};
+ use frame_support::{traits::OnInitialize};
+ use sp_core::H256;
+ use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
+
+ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
+ type Block = frame_system::mocking::MockBlock<Test>;
+
+ const YEAR: u64 = 5_259_600;
+
+ parameter_types! {
+ pub const ExistentialDeposit: u64 = 1;
+ pub const MaxLocks: u32 = 50;
+ }
+
+ impl pallet_balances::Config for Test {
+ type AccountStore = System;
+ type Balance = u64;
+ type DustRemoval = ();
+ type Event = ();
+ type ExistentialDeposit = ExistentialDeposit;
+ type WeightInfo = ();
+ type MaxLocks = MaxLocks;
+ }
+
+ frame_support::construct_runtime!(
+ pub enum Test where
+ Block = Block,
+ NodeBlock = Block,
+ UncheckedExtrinsic = UncheckedExtrinsic,
+ {
+ Balances: pallet_balances::{Module, Call, Storage},
+ System: frame_system::{Module, Call, Config, Storage, Event<T>},
+ Inflation: pallet_inflation::{Module, Call, Storage},
+ }
+ );
+
+ parameter_types! {
+ pub const BlockHashCount: u64 = 250;
+ pub BlockWeights: frame_system::limits::BlockWeights =
+ frame_system::limits::BlockWeights::simple_max(1024);
+ pub const SS58Prefix: u8 = 42;
+ }
+
+ impl frame_system::Config for Test {
+ type BaseCallFilter = ();
+ type BlockWeights = ();
+ type BlockLength = ();
+ type DbWeight = ();
+ type Origin = Origin;
+ type Call = Call;
+ type Index = u64;
+ type BlockNumber = u64;
+ type Hash = H256;
+ type Hashing = BlakeTwo256;
+ type AccountId = u64;
+ type Lookup = IdentityLookup<Self::AccountId>;
+ type Header = Header;
+ type Event = ();
+ type BlockHashCount = BlockHashCount;
+ type Version = ();
+ type PalletInfo = PalletInfo;
+ type AccountData = pallet_balances::AccountData<u64>;
+ type OnNewAccount = ();
+ type OnKilledAccount = ();
+ type SystemWeightInfo = ();
+ type SS58Prefix = SS58Prefix;
+ }
+
+ parameter_types! {
+ pub TreasuryAccountId: u64 = 1234;
+ pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied
+ }
+
+ impl pallet_inflation::Config for Test {
+ type Currency = Balances;
+ type TreasuryAccountId = TreasuryAccountId;
+ type InflationBlockInterval = InflationBlockInterval;
+ }
+
+ // Build genesis storage according to the mock runtime.
+ pub fn new_test_ext() -> sp_io::TestExternalities {
+ frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
+ }
+
+ #[test]
+ fn inflation_works() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+
+ // BlockInflation should be set after 1st block and
+ // first inflation deposit should be equal to BlockInflation
+ Inflation::on_initialize(1);
+ assert!(Inflation::block_inflation() > 0);
+ assert_eq!(Balances::free_balance(1234) - initial_issuance, Inflation::block_inflation());
+ });
+ }
+
+ #[test]
+ fn inflation_second_deposit() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
+
+ // Next inflation deposit happens when block is multiple of InflationBlockInterval
+ let mut block: u32 = 2;
+ let balance_before: u64 = Balances::free_balance(1234);
+ while block % InflationBlockInterval::get() != 0 {
+ Inflation::on_initialize(block as u64);
+ block += 1;
+ }
+ let balance_just_before: u64 = Balances::free_balance(1234);
+ assert_eq!(balance_before, balance_just_before);
+
+ // The block with inflation
+ Inflation::on_initialize(block as u64);
+ let balance_after: u64 = Balances::free_balance(1234);
+ assert_eq!(balance_after - balance_just_before, Inflation::block_inflation());
+ });
+ }
+
+ #[test]
+ fn inflation_in_1_year() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
+ let block_inflation_year_0 = Inflation::block_inflation();
+
+ Inflation::on_initialize(YEAR);
+ let block_inflation_year_1 = Inflation::block_inflation();
+
+ // Assert that year 1 inflation is less than year 0
+ assert!(block_inflation_year_0 > block_inflation_year_1);
+ });
+ }
+
+ #[test]
+ fn inflation_in_1_to_9_years() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
+
+ for year in 1..=9 {
+ let block_inflation_year_before = Inflation::block_inflation();
+ Inflation::on_initialize(YEAR * year);
+ let block_inflation_year_after = Inflation::block_inflation();
+
+ // Assert that next year inflation is less than previous year inflation
+ assert!(block_inflation_year_before > block_inflation_year_after);
+ }
+
+ });
+ }
+
+ #[test]
+ fn inflation_after_year_10_is_flat() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(YEAR * 9);
+
+ for year in 10..=20 {
+ let block_inflation_year_before = Inflation::block_inflation();
+ Inflation::on_initialize(YEAR * year);
+ let block_inflation_year_after = Inflation::block_inflation();
+
+ // Assert that next year inflation is equal to previous year inflation
+ assert_eq!(block_inflation_year_before, block_inflation_year_after);
+ }
+ });
+ }
+
+ #[test]
+ fn inflation_rate_by_year() {
+ new_test_ext().execute_with(|| {
+ let payouts: u64 = YEAR / InflationBlockInterval::get() as u64;
+
+ // Inflation starts at 10% and does down by 2/3% every year until year 9 (included),
+ // then it is flat.
+ let payout_by_year: [u64; 11] = [
+ 1000,
+ 933,
+ 867,
+ 800,
+ 733,
+ 667,
+ 600,
+ 533,
+ 467,
+ 400,
+ 400
+ ];
+
+ // For accuracy total issuance = payout0 * payouts * 10;
+ let initial_issuance: u64 = payout_by_year[0] * payouts * 10;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+
+ for year in 0..=10 {
+ // Year first block
+ Inflation::on_initialize(year*YEAR);
+ let mut actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
+
+ // Year second block
+ Inflation::on_initialize(year*YEAR+1);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
+
+ // Year middle block
+ Inflation::on_initialize(year*YEAR + YEAR/2);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
+
+ // Year last block
+ Inflation::on_initialize((year + 1)*YEAR-1);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
+ }
+ });
+ }
+}
pallets/nft/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -1,420 +1,419 @@
-#[cfg(feature = "runtime-benchmarks")]
-// mod benchmarking {
- use super::*;
- use sp_std::prelude::*;
- use frame_system::RawOrigin;
- // use frame_support::{ensure, traits::OnFinalize};
- use frame_benchmarking::{benchmarks, account, whitelisted_caller}; // , TrackedStorageKey,
- use crate::Module as Nft;
+#![cfg(feature = "runtime-benchmarks")]
- const SEED: u32 = 1;
+use super::*;
+use crate::Module as Nft;
- fn default_nft_data() -> CreateItemData {
- CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
- }
-
- fn default_fungible_data () -> CreateItemData {
- CreateItemData::Fungible(CreateFungibleData { })
- }
-
- fn default_re_fungible_data () -> CreateItemData {
- CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
- }
+use sp_std::prelude::*;
+use frame_system::RawOrigin;
+use frame_benchmarking::{benchmarks, account, whitelisted_caller}; // , TrackedStorageKey,
+const SEED: u32 = 1;
+/*
+fn default_nft_data() -> CreateItemData {
+ CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+}
- benchmarks! {
+fn default_fungible_data () -> CreateItemData {
+ CreateItemData::Fungible(CreateFungibleData { })
+}
- _ {}
+fn default_re_fungible_data () -> CreateItemData {
+ CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+}
+*/
- create_collection {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = account("caller", 0, SEED);
- }: create_collection(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
- verify {
- assert_eq!(Nft::<T>::collection(2).owner, caller);
- }
+benchmarks! {
- destroy_collection {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: destroy_collection(RawOrigin::Signed(caller.clone()), 2)
+ create_collection {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = account("caller", 0, SEED);
+ }: _(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
+/*
+ verify {
+ assert_eq!(Nft::<T>::collection_id(2).owner, caller);
+ }
+ destroy_collection {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: _(RawOrigin::Signed(caller.clone()), 2)
- add_to_white_list {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let whitelist_account: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+ add_to_white_list {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let whitelist_account: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
- remove_from_white_list {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let whitelist_account: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
- }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+ remove_from_white_list {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let whitelist_account: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
+ }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
- set_public_access_mode {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
+ set_public_access_mode {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
- set_mint_permission {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
+ set_mint_permission {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
- change_collection_owner {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_owner: T::AccountId = account("admin", 0, SEED);
- }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
+ change_collection_owner {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_owner: T::AccountId = account("admin", 0, SEED);
+ }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
- add_collection_admin {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_admin: T::AccountId = account("admin", 0, SEED);
- }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+ add_collection_admin {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_admin: T::AccountId = account("admin", 0, SEED);
+ }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
- remove_collection_admin {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_admin: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
- }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+ remove_collection_admin {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_admin: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
+ }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
- set_collection_sponsor {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
+ set_collection_sponsor {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
- confirm_sponsorship {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
- }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
+ confirm_sponsorship {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+ }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
- remove_collection_sponsor {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
- Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
- }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
+ remove_collection_sponsor {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+ Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
+ }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
- // nft item
- create_item_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
-
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ // nft item
+ create_item_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- #[extra]
- create_item_nft_large {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let mut nft_data = CreateNftData {
- const_data: vec![],
- variable_data: vec![]
- };
- for i in 0..1998 {
- nft_data.const_data.push(10);
- nft_data.variable_data.push(10);
- }
- let data = CreateItemData::NFT(nft_data);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ #[extra]
+ create_item_nft_large {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let mut nft_data = CreateNftData {
+ const_data: vec![],
+ variable_data: vec![]
+ };
+ for i in 0..1998 {
+ nft_data.const_data.push(10);
+ nft_data.variable_data.push(10);
+ }
+ let data = CreateItemData::NFT(nft_data);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- // fungible item
- create_item_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
+ // fungible item
+ create_item_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- // refungible item
- create_item_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
+ // refungible item
+ create_item_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- burn_item {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ burn_item {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
+ }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
- transfer_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ transfer_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
-
- transfer_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+
+ transfer_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
- transfer_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ transfer_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
- approve {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ approve {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
+ }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
- // Nft
- transfer_from_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ // Nft
+ transfer_from_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- // Fungible
- transfer_from_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ // Fungible
+ transfer_from_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- // ReFungible
- transfer_from_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ // ReFungible
+ transfer_from_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- enable_contract_sponsoring {
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ enable_contract_sponsoring {
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+ }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
- set_offchain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ set_offchain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+ }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
- set_const_on_chain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
-
- set_variable_on_chain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+ set_const_on_chain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+
+ set_variable_on_chain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
- set_variable_meta_data {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ set_variable_meta_data {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
+ }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
- set_schema_version {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
+ set_schema_version {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
- set_chain_limits {
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let limits = ChainLimits {
- collection_numbers_limit: 0,
- account_token_ownership_limit: 0,
- collections_admins_limit: 0,
- custom_data_limit: 0,
- nft_sponsor_transfer_timeout: 0,
- fungible_sponsor_transfer_timeout: 0,
- refungible_sponsor_transfer_timeout: 0
- };
- }: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
+ set_chain_limits {
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let limits = ChainLimits {
+ collection_numbers_limit: 0,
+ account_token_ownership_limit: 0,
+ collections_admins_limit: 0,
+ custom_data_limit: 0,
+ nft_sponsor_transfer_timeout: 0,
+ fungible_sponsor_transfer_timeout: 0,
+ refungible_sponsor_transfer_timeout: 0
+ };
+ }: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
- set_contract_sponsoring_rate_limit {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let block_number: T::BlockNumber = 0.into();
- }: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
+ set_contract_sponsoring_rate_limit {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let block_number: T::BlockNumber = 0.into();
+ }: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
- set_collection_limits{
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-
- let cl = CollectionLimits {
- account_token_ownership_limit: 0,
- sponsored_data_size: 0,
- token_limit: 0,
- sponsor_transfer_timeout: 0
- };
+ set_collection_limits{
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+
+ let cl = CollectionLimits {
+ account_token_ownership_limit: 0,
+ sponsored_data_size: 0,
+ token_limit: 0,
+ sponsor_transfer_timeout: 0
+ };
- }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
+ }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
- add_to_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+ add_to_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ }: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
- remove_from_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
- }: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+ remove_from_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
+ }: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
- toggle_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
-}
\ No newline at end of file
+ toggle_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ }: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+*/
+}
runtime/Cargo.tomldiffbeforeafterboth--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -26,6 +26,7 @@
# local dependencies
pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }
+pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }
# Substrate dependencies
frame-benchmarking = { default-features = false, optional = true, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
@@ -75,6 +76,7 @@
'pallet-balances/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
'pallet-nft/runtime-benchmarks',
+ 'pallet-inflation/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
]
std = [
@@ -100,6 +102,7 @@
'pallet-evm/std',
'pallet-ethereum/std',
+ 'pallet-inflation/std',
'pallet-nft/std',
'fp-rpc/std',
'sp-api/std',
runtime/src/lib.rsdiffbeforeafterboth1//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, H160, U256 };21use sp_runtime::{22 Permill, Perbill, Percent,23 ModuleId,24 create_runtime_str, generic, impl_opaque_keys,25 traits::{26 Convert, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount,27 IdentityLookup, NumberFor, Verify, AccountIdConversion,28 },29 transaction_validity::{TransactionSource, TransactionValidity},30 ApplyExtrinsicResult, MultiSignature,31};32#[cfg(feature = "std")]33use sp_version::NativeVersion;34use sp_version::RuntimeVersion;35pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};36// A few exports that help ease life for downstream crates.37pub use pallet_balances::Call as BalancesCall;38pub use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping, Runner};39pub use pallet_contracts::{Schedule as ContractsSchedule };40pub use frame_support::{41 construct_runtime,42 dispatch::DispatchResult,43 parameter_types,44 StorageValue,45 traits::{46 Currency, ExistenceRequirement, Get, KeyOwnerProofSystem, OnUnbalanced, Randomness,47 LockIdentifier, FindAuthor,48 },49 weights::{50 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},51 DispatchClass, DispatchInfo, GetDispatchInfo, Pays, PostDispatchInfo, Weight,52 WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients53 },54 ConsensusEngineId,55};56use pallet_contracts::weights::WeightInfo;57// #[cfg(any(feature = "std", test))]58use frame_system::{59 self as system,60 EnsureRoot,61 limits::{BlockWeights, BlockLength},62};63use sp_std::{prelude::*, marker::PhantomData};64use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};65use smallvec::smallvec;66use codec::{Encode, Decode};67use pallet_evm::{Account as EVMAccount, FeeCalculator, OnMethodCall};68use fp_rpc::TransactionStatus;69use sp_core::H256;7071pub use pallet_timestamp::Call as TimestampCall;7273mod chain_extension;74use crate::chain_extension::{ NFTExtension, Imbalance };7576/// Struct that handles the conversion of Balance -> `u64`. This is used for77/// staking's election calculation.78pub struct CurrencyToVoteHandler;7980impl CurrencyToVoteHandler {81 fn factor() -> Balance {82 (Balances::total_issuance() / u64::max_value() as Balance).max(1)83 }84}8586impl Convert<Balance, u64> for CurrencyToVoteHandler {87 fn convert(x: Balance) -> u64 {88 (x / Self::factor()) as u6489 }90}9192impl Convert<u128, Balance> for CurrencyToVoteHandler {93 fn convert(x: u128) -> Balance {94 x * Self::factor()95 }96}9798/// Re-export a nft pallet99/// TODO: Check this re-export. Is this safe and good style?100extern crate pallet_nft;101pub use pallet_nft::*;102103/// An index to a block.104pub type BlockNumber = u32;105106/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.107pub type Signature = MultiSignature;108109/// Some way of identifying an account on the chain. We intentionally make it equivalent110/// to the public key of our transaction signing scheme.111pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;112113/// The type for looking up accounts. We don't expect more than 4 billion of them, but you114/// never know...115pub type AccountIndex = u32;116117/// Balance of an account.118pub type Balance = u128;119120/// Index of a transaction in the chain.121pub type Index = u32;122123/// A hash of some data used by the chain.124pub type Hash = sp_core::H256;125126/// Digest item type.127pub type DigestItem = generic::DigestItem<Hash>;128129mod nft_weights;130131/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know132/// the specifics of the runtime. They can then be made to be agnostic over specific formats133/// of data like extrinsics, allowing for them to continue syncing the network through upgrades134/// to even the core data structures.135pub mod opaque {136 use super::*;137138 pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;139140 /// Opaque block header type.141 pub type Header = generic::Header<BlockNumber, BlakeTwo256>;142 /// Opaque block type.143 pub type Block = generic::Block<Header, UncheckedExtrinsic>;144 /// Opaque block identifier type.145 pub type BlockId = generic::BlockId<Block>;146147 impl_opaque_keys! {148 pub struct SessionKeys {149 pub aura: Aura,150 pub grandpa: Grandpa,151 }152 }153}154155/// This runtime version.156pub const VERSION: RuntimeVersion = RuntimeVersion {157 spec_name: create_runtime_str!("nft"),158 impl_name: create_runtime_str!("nft"),159 authoring_version: 1,160 spec_version: 3,161 impl_version: 1,162 apis: RUNTIME_API_VERSIONS,163 transaction_version: 1,164};165166pub const MILLISECS_PER_BLOCK: u64 = 6000;167168pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;169170// These time units are defined in number of blocks.171pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);172pub const HOURS: BlockNumber = MINUTES * 60;173pub const DAYS: BlockNumber = HOURS * 24;174175/// The version information used to identify this runtime when compiled natively.176#[cfg(feature = "std")]177pub fn native_version() -> NativeVersion {178 NativeVersion {179 runtime_version: VERSION,180 can_author_with: Default::default(),181 }182}183184/// Provides a membership set with only the configured aura users185pub struct ValiudatorsOnly<Runtime: pallet_aura::Config>(PhantomData<Runtime>);186impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {187 fn contains(t: &AccountId) -> bool {188 let arr: [u8; 32] = *t.as_ref();189 let raw_key: Vec<u8> = Vec::from(arr);190191 match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {192 Some(_) => true,193 None => false,194 }195 }196 fn sorted_members() -> Vec<AccountId> {197 let mut members: Vec<AccountId> = Vec::new();198 for auth in pallet_aura::Module::<Runtime>::authorities() {199 let mut arr: [u8; 32] = Default::default();200 let bor_arr = auth.clone().to_raw_vec();201 let slice = bor_arr.as_slice();202 arr.copy_from_slice(slice);203 members.push(AccountId::from(arr));204 }205 members206 }207 fn count() -> usize {208 pallet_aura::Module::<Runtime>::authorities().len()209 }210}211212impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {213 fn min_len() -> usize {214 1215 }216 fn max_len() -> usize {217 100218 }219}220221type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;222223pub struct DealWithFees;224impl OnUnbalanced<NegativeImbalance> for DealWithFees {225 fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {226 if let Some(fees) = fees_then_tips.next() {227 // for fees, 100% to treasury228 let mut split = fees.ration(100, 0);229 if let Some(tips) = fees_then_tips.next() {230 // for tips, if any, 100% to treasury231 tips.ration_merge_into(100, 0, &mut split);232 }233 Treasury::on_unbalanced(split.0);234 // Author::on_unbalanced(split.1);235 }236 }237}238239// impl OnUnbalanced<NegativeImbalance> for DealWithFees {240// fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {241// if let Some(fees) = fees_then_tips.next() {242// // for fees, 100% to treasury243// let mut split = fees.ration(100, 0);244// if let Some(tips) = fees_then_tips.next() {245// // for tips, if any, 100% to treasury246// tips.ration_merge_into(100, 0, &mut split);247// }248// Treasury::on_unbalanced(split.0);249// // Author::on_unbalanced(split.1);250// }251// }252// }253254/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.255/// This is used to limit the maximal weight of a single extrinsic.256const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);257/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used258/// by Operational extrinsics.259const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);260/// We allow for 2 seconds of compute with a 6 second average block time.261const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;262263parameter_types! {264 pub const BlockHashCount: BlockNumber = 2400;265 pub RuntimeBlockLength: BlockLength =266 BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);267 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);268 pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;269 pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()270 .base_block(BlockExecutionWeight::get())271 .for_class(DispatchClass::all(), |weights| {272 weights.base_extrinsic = ExtrinsicBaseWeight::get();273 })274 .for_class(DispatchClass::Normal, |weights| {275 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);276 })277 .for_class(DispatchClass::Operational, |weights| {278 weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);279 // Operational transactions have some extra reserved space, so that they280 // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.281 weights.reserved = Some(282 MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT283 );284 })285 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)286 .build_or_panic();287 pub const Version: RuntimeVersion = VERSION;288 pub const SS58Prefix: u8 = 42;289}290291impl system::Config for Runtime {292 /// The basic call filter to use in dispatchable.293 type BaseCallFilter = ();294 /// The identifier used to distinguish between accounts.295 type AccountId = AccountId;296 /// The aggregated dispatch type that is available for extrinsics.297 type Call = Call;298 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.299 type Lookup = IdentityLookup<AccountId>;300 /// The index type for storing how many extrinsics an account has signed.301 type Index = Index;302 /// The index type for blocks.303 type BlockNumber = BlockNumber;304 /// The type for hashing blocks and tries.305 type Hash = Hash;306 /// The hashing algorithm used.307 type Hashing = BlakeTwo256;308 /// The header type.309 type Header = generic::Header<BlockNumber, BlakeTwo256>;310 /// The ubiquitous event type.311 type Event = Event;312 /// The ubiquitous origin type.313 type Origin = Origin;314 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).315 type BlockHashCount = BlockHashCount;316 /// The weight of database operations that the runtime can invoke.317 type DbWeight = RocksDbWeight;318 /// The weight of the overhead invoked on the block import process, independent of the319 /// extrinsics included in that block.320 type BlockWeights = RuntimeBlockWeights;321 /// Version of the runtime.322 type Version = Version;323 /// This type is being generated by `construct_runtime!`.324 type PalletInfo = PalletInfo;325 /// What to do if a new account is created.326 type OnNewAccount = ();327 /// What to do if an account is fully reaped from the system.328 type OnKilledAccount = ();329 /// The data to be stored in an account.330 type AccountData = pallet_balances::AccountData<Balance>;331 /// Weight information for the extrinsics of this pallet.332 type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;333334 type BlockLength = RuntimeBlockLength;335 type SS58Prefix = SS58Prefix;336}337338impl pallet_aura::Config for Runtime {339 type AuthorityId = AuraId;340}341342parameter_types! {343 pub const ChainId: u64 = 8888;344}345346impl pallet_evm::Config for Runtime {347 type BlockGasLimit = BlockGasLimit;348 type FeeCalculator = ();349 type GasWeightMapping = ();350 type CallOrigin = EnsureAddressTruncated;351 type WithdrawOrigin = EnsureAddressTruncated;352 type AddressMapping = HashedAddressMapping<Self::Hashing>;353 type Precompiles = ();354 type Currency = Balances;355 type Event = Event;356 type OnMethodCall = pallet_nft::NftErcSupport<Self>;357 type ChainId = ChainId;358 type Runner = pallet_evm::runner::stack::Runner<Self>;359 type OnChargeTransaction = ();360}361362pub struct EthereumFindAuthor<F>(PhantomData<F>);363impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F>364{365 fn find_author<'a, I>(digests: I) -> Option<H160> where366 I: 'a + IntoIterator<Item=(ConsensusEngineId, &'a [u8])>367 {368 if let Some(author_index) = F::find_author(digests) {369 let authority_id = Aura::authorities()[author_index as usize].clone();370 return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));371 }372 None373 }374}375376parameter_types! {377 pub BlockGasLimit: U256 = U256::from(u32::max_value());378}379380impl pallet_ethereum::Config for Runtime {381 type Event = Event;382 type FindAuthor = EthereumFindAuthor<Aura>;383 type StateRoot = pallet_ethereum::IntermediateStateRoot;384 type EvmSubmitLog = pallet_evm::Module<Runtime>;385}386387impl pallet_grandpa::Config for Runtime {388 type Event = Event;389 type Call = Call;390391 type KeyOwnerProofSystem = ();392393 type KeyOwnerProof =394 <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;395396 type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(397 KeyTypeId,398 GrandpaId,399 )>>::IdentificationTuple;400401 type HandleEquivocation = ();402403 type WeightInfo = ();404}405406parameter_types! {407 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;408}409410impl pallet_timestamp::Config for Runtime {411 /// A timestamp: milliseconds since the unix epoch.412 type Moment = u64;413 type OnTimestampSet = Aura;414 type MinimumPeriod = MinimumPeriod;415 type WeightInfo = ();416}417418parameter_types! {419 // pub const ExistentialDeposit: u128 = 500;420 pub const ExistentialDeposit: u128 = 0;421 pub const MaxLocks: u32 = 50;422}423424impl pallet_balances::Config for Runtime {425 type MaxLocks = MaxLocks;426 /// The type for recording an account's balance.427 type Balance = Balance;428 /// The ubiquitous event type.429 type Event = Event;430 type DustRemoval = Treasury;431 type ExistentialDeposit = ExistentialDeposit;432 type AccountStore = System;433 type WeightInfo = ();434}435436pub const MICROUNIQUE: Balance = 1_000_000_000;437pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;438pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;439pub const UNIQUE: Balance = 100 * CENTIUNIQUE;440441pub const fn deposit(items: u32, bytes: u32) -> Balance {442 items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE443}444445parameter_types! {446 pub const TombstoneDeposit: Balance = deposit(447 0,448 sp_std::mem::size_of::<pallet_contracts::ContractInfo<Runtime>>() as u32449 );450 pub const DepositPerContract: Balance = TombstoneDeposit::get();451 pub const DepositPerStorageByte: Balance = deposit(0, 1);452 pub const DepositPerStorageItem: Balance = deposit(1, 0);453 pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);454 pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;455 pub const SignedClaimHandicap: u32 = 2;456 pub const MaxDepth: u32 = 32;457 pub const MaxValueSize: u32 = 16 * 1024;458 pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb459 // The lazy deletion runs inside on_initialize.460 pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *461 RuntimeBlockWeights::get().max_block;462 // The weight needed for decoding the queue should be less or equal than a fifth463 // of the overall weight dedicated to the lazy deletion.464 pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (465 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -466 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)467 )) / 5) as u32;468}469470471impl pallet_contracts::Config for Runtime {472 type Time = Timestamp;473 type Randomness = RandomnessCollectiveFlip;474 type Currency = Balances;475 type Event = Event;476 type RentPayment = ();477 type SignedClaimHandicap = SignedClaimHandicap;478 type TombstoneDeposit = TombstoneDeposit;479 type DepositPerContract = DepositPerContract;480 type DepositPerStorageByte = DepositPerStorageByte;481 type DepositPerStorageItem = DepositPerStorageItem;482 type RentFraction = RentFraction;483 type SurchargeReward = SurchargeReward;484 type MaxDepth = MaxDepth;485 type MaxValueSize = MaxValueSize;486 type WeightPrice = pallet_transaction_payment::Module<Self>;487 type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;488 type ChainExtension = NFTExtension;489 type DeletionQueueDepth = DeletionQueueDepth;490 type DeletionWeightLimit = DeletionWeightLimit;491 type MaxCodeSize = MaxCodeSize;492}493494parameter_types! {495 pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer496}497498/// Linear implementor of `WeightToFeePolynomial`499pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);500501impl<T> WeightToFeePolynomial for LinearFee<T> where502 T: BaseArithmetic + From<u32> + Copy + Unsigned503{504 type Balance = T;505506 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {507 smallvec!(WeightToFeeCoefficient {508 coeff_integer: 146_700u32.into(), // Targeting 0.1 Unique per NFT transfer509 coeff_frac: Perbill::zero(),510 negative: false,511 degree: 1,512 })513 }514}515516impl pallet_transaction_payment::Config for Runtime {517 type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees>;518 type TransactionByteFee = TransactionByteFee;519 type WeightToFee = LinearFee<Balance>;520 type FeeMultiplierUpdate = ();521}522523parameter_types! {524 pub const ProposalBond: Permill = Permill::from_percent(5);525 pub const ProposalBondMinimum: Balance = 1 * UNIQUE;526 pub const SpendPeriod: BlockNumber = 5 * MINUTES;527 pub const Burn: Permill = Permill::from_percent(0);528 pub const TipCountdown: BlockNumber = 1 * DAYS;529 pub const TipFindersFee: Percent = Percent::from_percent(20);530 pub const TipReportDepositBase: Balance = 1 * UNIQUE;531 pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;532 pub const BountyDepositBase: Balance = 1 * UNIQUE;533 pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;534 pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");535 pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;536 pub const MaximumReasonLength: u32 = 16384;537 pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);538 pub const BountyValueMinimum: Balance = 5 * UNIQUE;539}540541impl pallet_treasury::Config for Runtime {542 type ModuleId = TreasuryModuleId;543 type Currency = Balances;544 type ApproveOrigin = EnsureRoot<AccountId>;545 type RejectOrigin = EnsureRoot<AccountId>;546 type Event = Event;547 type OnSlash = ();548 type ProposalBond = ProposalBond;549 type ProposalBondMinimum = ProposalBondMinimum;550 type SpendPeriod = SpendPeriod;551 type Burn = Burn;552 type BurnDestination = ();553 type SpendFunds = ();554 type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;555}556557impl pallet_sudo::Config for Runtime {558 type Event = Event;559 type Call = Call;560}561562parameter_types! {563 pub const MinVestedTransfer: Balance = 10 * UNIQUE;564}565566impl pallet_vesting::Config for Runtime {567 type Event = Event;568 type Currency = Balances;569 type BlockNumberToBalance = ConvertInto;570 type MinVestedTransfer = MinVestedTransfer;571 type WeightInfo = ();572}573574parameter_types! {575 pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();576 pub const CollectionCreationPrice: Balance = 100 * UNIQUE;577}578579/// Used for the module nft in `./nft.rs`580impl pallet_nft::Config for Runtime {581 type Event = Event;582 type WeightInfo = nft_weights::WeightInfo;583584 type EvmWithdrawOrigin = EnsureAddressTruncated;585 type EvmBackwardsAddressMapping = pallet_nft::MapBackwardsAddressTruncated;586 type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;587 type CrossAccountId = pallet_nft::BasicCrossAccountId<Self>;588589 type Currency = Balances;590 type CollectionCreationPrice = CollectionCreationPrice;591 type TreasuryAccountId = TreasuryAccountId;592593 type EthereumChainId = ChainId;594 type EthereumTransactionSender = pallet_ethereum::Module<Runtime>;595}596597construct_runtime!(598 pub enum Runtime where599 Block = Block,600 NodeBlock = opaque::Block,601 UncheckedExtrinsic = UncheckedExtrinsic602 {603 System: system::{Module, Call, Config, Storage, Event<T>},604 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},605 Contracts: pallet_contracts::{Module, Call, Config<T>, Storage, Event<T>},606 Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},607 Aura: pallet_aura::{Module, Config<T> },608 EVM: pallet_evm::{Module, Config, Call, Storage, Event<T>},609 Ethereum: pallet_ethereum::{Module, Config, Call, Storage, Event, ValidateUnsigned},610 Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},611 Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},612 TransactionPayment: pallet_transaction_payment::{Module, Storage},613 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},614 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},615 Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},616 Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},617 }618);619620pub struct TransactionConverter;621622impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {623 fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {624 UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into())625 }626}627628impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {629 fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic {630 let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into());631 let encoded = extrinsic.encode();632 opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid")633 }634}635636/// The address format for describing accounts.637pub type Address = AccountId;638/// Block header type as expected by this runtime.639pub type Header = generic::Header<BlockNumber, BlakeTwo256>;640/// Block type as expected by this runtime.641pub type Block = generic::Block<Header, UncheckedExtrinsic>;642/// A Block signed with a Justification643pub type SignedBlock = generic::SignedBlock<Block>;644/// BlockId type as expected by this runtime.645pub type BlockId = generic::BlockId<Block>;646/// The SignedExtension to the basic transaction logic.647pub type SignedExtra = (648 system::CheckSpecVersion<Runtime>,649 system::CheckTxVersion<Runtime>,650 system::CheckGenesis<Runtime>,651 system::CheckEra<Runtime>,652 system::CheckNonce<Runtime>,653 system::CheckWeight<Runtime>,654 pallet_nft::ChargeTransactionPayment<Runtime>,655);656/// Unchecked extrinsic type as expected by this runtime.657pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;658/// Extrinsic type that has already been checked.659pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;660/// Executive: handles dispatch to the various modules.661pub type Executive =662 frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;663664impl_runtime_apis! {665 impl pallet_nft::NftApi<Block>666 for Runtime667 {668 fn eth_contract_code(account: H160) -> Option<Vec<u8>> {669 <pallet_nft::NftErcSupport<Runtime>>::get_code(&account)670 }671 }672673 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>674 for Runtime675 {676 fn call(677 origin: AccountId,678 dest: AccountId,679 value: Balance,680 gas_limit: u64,681 input_data: Vec<u8>,682 ) -> pallet_contracts_primitives::ContractExecResult {683 Contracts::bare_call(origin, dest, value, gas_limit, input_data)684 }685686 fn get_storage(687 address: AccountId,688 key: [u8; 32],689 ) -> pallet_contracts_primitives::GetStorageResult {690 Contracts::get_storage(address, key)691 }692693 fn rent_projection(694 address: AccountId,695 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {696 Contracts::rent_projection(address)697 }698 }699700 impl sp_api::Core<Block> for Runtime {701 fn version() -> RuntimeVersion {702 VERSION703 }704705 fn execute_block(block: Block) {706 Executive::execute_block(block)707 }708709 fn initialize_block(header: &<Block as BlockT>::Header) {710 Executive::initialize_block(header)711 }712 }713714 impl sp_api::Metadata<Block> for Runtime {715 fn metadata() -> OpaqueMetadata {716 Runtime::metadata().into()717 }718 }719720 impl sp_block_builder::BlockBuilder<Block> for Runtime {721 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {722 Executive::apply_extrinsic(extrinsic)723 }724725 fn finalize_block() -> <Block as BlockT>::Header {726 Executive::finalize_block()727 }728729 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {730 data.create_extrinsics()731 }732733 fn check_inherents(734 block: Block,735 data: sp_inherents::InherentData,736 ) -> sp_inherents::CheckInherentsResult {737 data.check_extrinsics(&block)738 }739740 fn random_seed() -> <Block as BlockT>::Hash {741 RandomnessCollectiveFlip::random_seed().0742 }743 }744745 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {746 fn validate_transaction(747 source: TransactionSource,748 tx: <Block as BlockT>::Extrinsic,749 ) -> TransactionValidity {750 Executive::validate_transaction(source, tx)751 }752 }753754 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {755 fn offchain_worker(header: &<Block as BlockT>::Header) {756 Executive::offchain_worker(header)757 }758 }759760 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {761 fn slot_duration() -> u64 {762 Aura::slot_duration()763 }764765 fn authorities() -> Vec<AuraId> {766 Aura::authorities()767 }768 }769770 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {771 fn chain_id() -> u64 {772 <Runtime as pallet_evm::Config>::ChainId::get()773 }774775 fn account_basic(address: H160) -> EVMAccount {776 EVM::account_basic(&address)777 }778779 fn gas_price() -> U256 {780 <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()781 }782783 fn account_code_at(address: H160) -> Vec<u8> {784 EVM::account_codes(address)785 }786787 fn author() -> H160 {788 <pallet_ethereum::Module<Runtime>>::find_author()789 }790791 fn storage_at(address: H160, index: U256) -> H256 {792 let mut tmp = [0u8; 32];793 index.to_big_endian(&mut tmp);794 EVM::account_storages(address, H256::from_slice(&tmp[..]))795 }796797 fn call(798 from: H160,799 to: H160,800 data: Vec<u8>,801 value: U256,802 gas_limit: U256,803 gas_price: Option<U256>,804 nonce: Option<U256>,805 estimate: bool,806 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {807 let config = if estimate {808 let mut config = <Runtime as pallet_evm::Config>::config().clone();809 config.estimate = true;810 Some(config)811 } else {812 None813 };814815 <Runtime as pallet_evm::Config>::Runner::call(816 from,817 to,818 data,819 value,820 gas_limit.low_u64(),821 gas_price,822 nonce,823 config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),824 ).map_err(|err| err.into())825 }826827 fn create(828 from: H160,829 data: Vec<u8>,830 value: U256,831 gas_limit: U256,832 gas_price: Option<U256>,833 nonce: Option<U256>,834 estimate: bool,835 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {836 let config = if estimate {837 let mut config = <Runtime as pallet_evm::Config>::config().clone();838 config.estimate = true;839 Some(config)840 } else {841 None842 };843844 <Runtime as pallet_evm::Config>::Runner::create(845 from,846 data,847 value,848 gas_limit.low_u64(),849 gas_price,850 nonce,851 config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),852 ).map_err(|err| err.into())853 }854855 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {856 Ethereum::current_transaction_statuses()857 }858859 fn current_block() -> Option<pallet_ethereum::Block> {860 Ethereum::current_block()861 }862863 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {864 Ethereum::current_receipts()865 }866867 fn current_all() -> (868 Option<pallet_ethereum::Block>,869 Option<Vec<pallet_ethereum::Receipt>>,870 Option<Vec<TransactionStatus>>871 ) {872 (873 Ethereum::current_block(),874 Ethereum::current_receipts(),875 Ethereum::current_transaction_statuses()876 )877 }878 }879880 impl sp_session::SessionKeys<Block> for Runtime {881 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {882 opaque::SessionKeys::generate(seed)883 }884885 fn decode_session_keys(886 encoded: Vec<u8>,887 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {888 opaque::SessionKeys::decode_into_raw_public_keys(&encoded)889 }890 }891892 impl fg_primitives::GrandpaApi<Block> for Runtime {893 fn grandpa_authorities() -> GrandpaAuthorityList {894 Grandpa::grandpa_authorities()895 }896897 fn submit_report_equivocation_unsigned_extrinsic(898 _equivocation_proof: fg_primitives::EquivocationProof<899 <Block as BlockT>::Hash,900 NumberFor<Block>,901 >,902 _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,903 ) -> Option<()> {904 None905 }906907 fn generate_key_ownership_proof(908 _set_id: fg_primitives::SetId,909 _authority_id: GrandpaId,910 ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {911 // NOTE: this is the only implementation possible since we've912 // defined our key owner proof type as a bottom type (i.e. a type913 // with no values).914 None915 }916 }917918 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {919 fn account_nonce(account: AccountId) -> Index {920 System::account_nonce(account)921 }922 }923924 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {925 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {926 TransactionPayment::query_info(uxt, len)927 }928 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {929 TransactionPayment::query_fee_details(uxt, len)930 }931 }932933 #[cfg(feature = "runtime-benchmarks")]934 impl frame_benchmarking::Benchmark<Block> for Runtime {935 fn dispatch_benchmark(936 config: frame_benchmarking::BenchmarkConfig937 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {938 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};939940 let whitelist: Vec<TrackedStorageKey> = vec![941 // Alice account942 hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),943 // // Total Issuance944 // hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),945 // // Execution Phase946 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),947 // // Event Count948 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),949 // // System Events950 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),951 ];952953 let mut batches = Vec::<BenchmarkBatch>::new();954 let params = (&config, &whitelist);955956 add_benchmark!(params, batches, pallet_nft, Nft);957958 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }959 Ok(batches)960 }961 }962}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, H160, U256 };21use sp_runtime::{22 Permill, Perbill, Percent,23 ModuleId,24 create_runtime_str, generic, impl_opaque_keys,25 traits::{26 Convert, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount,27 IdentityLookup, NumberFor, Verify, AccountIdConversion,28 },29 transaction_validity::{TransactionSource, TransactionValidity},30 ApplyExtrinsicResult, MultiSignature,31};32#[cfg(feature = "std")]33use sp_version::NativeVersion;34use sp_version::RuntimeVersion;35pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};36// A few exports that help ease life for downstream crates.37pub use pallet_balances::Call as BalancesCall;38pub use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping, Runner};39pub use pallet_contracts::{Schedule as ContractsSchedule };40pub use frame_support::{41 construct_runtime,42 dispatch::DispatchResult,43 parameter_types,44 StorageValue,45 traits::{46 Currency, ExistenceRequirement, Get, KeyOwnerProofSystem, OnUnbalanced, Randomness,47 LockIdentifier, FindAuthor,48 },49 weights::{50 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},51 DispatchClass, DispatchInfo, GetDispatchInfo, Pays, PostDispatchInfo, Weight,52 WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients53 },54 ConsensusEngineId,55};56use pallet_contracts::weights::WeightInfo;57// #[cfg(any(feature = "std", test))]58use frame_system::{59 self as system,60 EnsureRoot,61 limits::{BlockWeights, BlockLength},62};63use sp_std::{prelude::*, marker::PhantomData};64use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};65use smallvec::smallvec;66use codec::{Encode, Decode};67use pallet_evm::{Account as EVMAccount, FeeCalculator, OnMethodCall};68use fp_rpc::TransactionStatus;69use sp_core::H256;7071pub use pallet_timestamp::Call as TimestampCall;7273mod chain_extension;74use crate::chain_extension::{ NFTExtension, Imbalance };7576/// Struct that handles the conversion of Balance -> `u64`. This is used for77/// staking's election calculation.78pub struct CurrencyToVoteHandler;7980impl CurrencyToVoteHandler {81 fn factor() -> Balance {82 (Balances::total_issuance() / u64::max_value() as Balance).max(1)83 }84}8586impl Convert<Balance, u64> for CurrencyToVoteHandler {87 fn convert(x: Balance) -> u64 {88 (x / Self::factor()) as u6489 }90}9192impl Convert<u128, Balance> for CurrencyToVoteHandler {93 fn convert(x: u128) -> Balance {94 x * Self::factor()95 }96}9798/// Re-export a nft pallet99/// TODO: Check this re-export. Is this safe and good style?100extern crate pallet_nft;101pub use pallet_nft::*;102103/// An index to a block.104pub type BlockNumber = u32;105106/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.107pub type Signature = MultiSignature;108109/// Some way of identifying an account on the chain. We intentionally make it equivalent110/// to the public key of our transaction signing scheme.111pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;112113/// The type for looking up accounts. We don't expect more than 4 billion of them, but you114/// never know...115pub type AccountIndex = u32;116117/// Balance of an account.118pub type Balance = u128;119120/// Index of a transaction in the chain.121pub type Index = u32;122123/// A hash of some data used by the chain.124pub type Hash = sp_core::H256;125126/// Digest item type.127pub type DigestItem = generic::DigestItem<Hash>;128129mod nft_weights;130131/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know132/// the specifics of the runtime. They can then be made to be agnostic over specific formats133/// of data like extrinsics, allowing for them to continue syncing the network through upgrades134/// to even the core data structures.135pub mod opaque {136 use super::*;137138 pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;139140 /// Opaque block header type.141 pub type Header = generic::Header<BlockNumber, BlakeTwo256>;142 /// Opaque block type.143 pub type Block = generic::Block<Header, UncheckedExtrinsic>;144 /// Opaque block identifier type.145 pub type BlockId = generic::BlockId<Block>;146147 impl_opaque_keys! {148 pub struct SessionKeys {149 pub aura: Aura,150 pub grandpa: Grandpa,151 }152 }153}154155/// This runtime version.156pub const VERSION: RuntimeVersion = RuntimeVersion {157 spec_name: create_runtime_str!("nft"),158 impl_name: create_runtime_str!("nft"),159 authoring_version: 1,160 spec_version: 3,161 impl_version: 1,162 apis: RUNTIME_API_VERSIONS,163 transaction_version: 1,164};165166pub const MILLISECS_PER_BLOCK: u64 = 6000;167168pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;169170// These time units are defined in number of blocks.171pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);172pub const HOURS: BlockNumber = MINUTES * 60;173pub const DAYS: BlockNumber = HOURS * 24;174175/// The version information used to identify this runtime when compiled natively.176#[cfg(feature = "std")]177pub fn native_version() -> NativeVersion {178 NativeVersion {179 runtime_version: VERSION,180 can_author_with: Default::default(),181 }182}183184/// Provides a membership set with only the configured aura users185pub struct ValiudatorsOnly<Runtime: pallet_aura::Config>(PhantomData<Runtime>);186impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {187 fn contains(t: &AccountId) -> bool {188 let arr: [u8; 32] = *t.as_ref();189 let raw_key: Vec<u8> = Vec::from(arr);190191 match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {192 Some(_) => true,193 None => false,194 }195 }196 fn sorted_members() -> Vec<AccountId> {197 let mut members: Vec<AccountId> = Vec::new();198 for auth in pallet_aura::Module::<Runtime>::authorities() {199 let mut arr: [u8; 32] = Default::default();200 let bor_arr = auth.clone().to_raw_vec();201 let slice = bor_arr.as_slice();202 arr.copy_from_slice(slice);203 members.push(AccountId::from(arr));204 }205 members206 }207 fn count() -> usize {208 pallet_aura::Module::<Runtime>::authorities().len()209 }210}211212impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {213 fn min_len() -> usize {214 1215 }216 fn max_len() -> usize {217 100218 }219}220221type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;222223pub struct DealWithFees;224impl OnUnbalanced<NegativeImbalance> for DealWithFees {225 fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {226 if let Some(fees) = fees_then_tips.next() {227 // for fees, 100% to treasury228 let mut split = fees.ration(100, 0);229 if let Some(tips) = fees_then_tips.next() {230 // for tips, if any, 100% to treasury231 tips.ration_merge_into(100, 0, &mut split);232 }233 Treasury::on_unbalanced(split.0);234 // Author::on_unbalanced(split.1);235 }236 }237}238239// impl OnUnbalanced<NegativeImbalance> for DealWithFees {240// fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {241// if let Some(fees) = fees_then_tips.next() {242// // for fees, 100% to treasury243// let mut split = fees.ration(100, 0);244// if let Some(tips) = fees_then_tips.next() {245// // for tips, if any, 100% to treasury246// tips.ration_merge_into(100, 0, &mut split);247// }248// Treasury::on_unbalanced(split.0);249// // Author::on_unbalanced(split.1);250// }251// }252// }253254/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.255/// This is used to limit the maximal weight of a single extrinsic.256const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);257/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used258/// by Operational extrinsics.259const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);260/// We allow for 2 seconds of compute with a 6 second average block time.261const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;262263parameter_types! {264 pub const BlockHashCount: BlockNumber = 2400;265 pub RuntimeBlockLength: BlockLength =266 BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);267 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);268 pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;269 pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()270 .base_block(BlockExecutionWeight::get())271 .for_class(DispatchClass::all(), |weights| {272 weights.base_extrinsic = ExtrinsicBaseWeight::get();273 })274 .for_class(DispatchClass::Normal, |weights| {275 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);276 })277 .for_class(DispatchClass::Operational, |weights| {278 weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);279 // Operational transactions have some extra reserved space, so that they280 // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.281 weights.reserved = Some(282 MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT283 );284 })285 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)286 .build_or_panic();287 pub const Version: RuntimeVersion = VERSION;288 pub const SS58Prefix: u8 = 42;289}290291impl system::Config for Runtime {292 /// The basic call filter to use in dispatchable.293 type BaseCallFilter = ();294 /// The identifier used to distinguish between accounts.295 type AccountId = AccountId;296 /// The aggregated dispatch type that is available for extrinsics.297 type Call = Call;298 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.299 type Lookup = IdentityLookup<AccountId>;300 /// The index type for storing how many extrinsics an account has signed.301 type Index = Index;302 /// The index type for blocks.303 type BlockNumber = BlockNumber;304 /// The type for hashing blocks and tries.305 type Hash = Hash;306 /// The hashing algorithm used.307 type Hashing = BlakeTwo256;308 /// The header type.309 type Header = generic::Header<BlockNumber, BlakeTwo256>;310 /// The ubiquitous event type.311 type Event = Event;312 /// The ubiquitous origin type.313 type Origin = Origin;314 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).315 type BlockHashCount = BlockHashCount;316 /// The weight of database operations that the runtime can invoke.317 type DbWeight = RocksDbWeight;318 /// The weight of the overhead invoked on the block import process, independent of the319 /// extrinsics included in that block.320 type BlockWeights = RuntimeBlockWeights;321 /// Version of the runtime.322 type Version = Version;323 /// This type is being generated by `construct_runtime!`.324 type PalletInfo = PalletInfo;325 /// What to do if a new account is created.326 type OnNewAccount = ();327 /// What to do if an account is fully reaped from the system.328 type OnKilledAccount = ();329 /// The data to be stored in an account.330 type AccountData = pallet_balances::AccountData<Balance>;331 /// Weight information for the extrinsics of this pallet.332 type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;333334 type BlockLength = RuntimeBlockLength;335 type SS58Prefix = SS58Prefix;336}337338impl pallet_aura::Config for Runtime {339 type AuthorityId = AuraId;340}341342parameter_types! {343 pub const ChainId: u64 = 8888;344}345346impl pallet_evm::Config for Runtime {347 type BlockGasLimit = BlockGasLimit;348 type FeeCalculator = ();349 type GasWeightMapping = ();350 type CallOrigin = EnsureAddressTruncated;351 type WithdrawOrigin = EnsureAddressTruncated;352 type AddressMapping = HashedAddressMapping<Self::Hashing>;353 type Precompiles = ();354 type Currency = Balances;355 type Event = Event;356 type OnMethodCall = pallet_nft::NftErcSupport<Self>;357 type ChainId = ChainId;358 type Runner = pallet_evm::runner::stack::Runner<Self>;359 type OnChargeTransaction = ();360}361362pub struct EthereumFindAuthor<F>(PhantomData<F>);363impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F>364{365 fn find_author<'a, I>(digests: I) -> Option<H160> where366 I: 'a + IntoIterator<Item=(ConsensusEngineId, &'a [u8])>367 {368 if let Some(author_index) = F::find_author(digests) {369 let authority_id = Aura::authorities()[author_index as usize].clone();370 return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));371 }372 None373 }374}375376parameter_types! {377 pub BlockGasLimit: U256 = U256::from(u32::max_value());378}379380impl pallet_ethereum::Config for Runtime {381 type Event = Event;382 type FindAuthor = EthereumFindAuthor<Aura>;383 type StateRoot = pallet_ethereum::IntermediateStateRoot;384 type EvmSubmitLog = pallet_evm::Module<Runtime>;385}386387impl pallet_grandpa::Config for Runtime {388 type Event = Event;389 type Call = Call;390391 type KeyOwnerProofSystem = ();392393 type KeyOwnerProof =394 <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;395396 type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(397 KeyTypeId,398 GrandpaId,399 )>>::IdentificationTuple;400401 type HandleEquivocation = ();402403 type WeightInfo = ();404}405406parameter_types! {407 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;408}409410impl pallet_timestamp::Config for Runtime {411 /// A timestamp: milliseconds since the unix epoch.412 type Moment = u64;413 type OnTimestampSet = Aura;414 type MinimumPeriod = MinimumPeriod;415 type WeightInfo = ();416}417418parameter_types! {419 // pub const ExistentialDeposit: u128 = 500;420 pub const ExistentialDeposit: u128 = 0;421 pub const MaxLocks: u32 = 50;422}423424impl pallet_balances::Config for Runtime {425 type MaxLocks = MaxLocks;426 /// The type for recording an account's balance.427 type Balance = Balance;428 /// The ubiquitous event type.429 type Event = Event;430 type DustRemoval = Treasury;431 type ExistentialDeposit = ExistentialDeposit;432 type AccountStore = System;433 type WeightInfo = ();434}435436pub const MICROUNIQUE: Balance = 1_000_000_000;437pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;438pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;439pub const UNIQUE: Balance = 100 * CENTIUNIQUE;440441pub const fn deposit(items: u32, bytes: u32) -> Balance {442 items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE443}444445parameter_types! {446 pub const TombstoneDeposit: Balance = deposit(447 0,448 sp_std::mem::size_of::<pallet_contracts::ContractInfo<Runtime>>() as u32449 );450 pub const DepositPerContract: Balance = TombstoneDeposit::get();451 pub const DepositPerStorageByte: Balance = deposit(0, 1);452 pub const DepositPerStorageItem: Balance = deposit(1, 0);453 pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);454 pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;455 pub const SignedClaimHandicap: u32 = 2;456 pub const MaxDepth: u32 = 32;457 pub const MaxValueSize: u32 = 16 * 1024;458 pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb459 // The lazy deletion runs inside on_initialize.460 pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *461 RuntimeBlockWeights::get().max_block;462 // The weight needed for decoding the queue should be less or equal than a fifth463 // of the overall weight dedicated to the lazy deletion.464 pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (465 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -466 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)467 )) / 5) as u32;468}469470471impl pallet_contracts::Config for Runtime {472 type Time = Timestamp;473 type Randomness = RandomnessCollectiveFlip;474 type Currency = Balances;475 type Event = Event;476 type RentPayment = ();477 type SignedClaimHandicap = SignedClaimHandicap;478 type TombstoneDeposit = TombstoneDeposit;479 type DepositPerContract = DepositPerContract;480 type DepositPerStorageByte = DepositPerStorageByte;481 type DepositPerStorageItem = DepositPerStorageItem;482 type RentFraction = RentFraction;483 type SurchargeReward = SurchargeReward;484 type MaxDepth = MaxDepth;485 type MaxValueSize = MaxValueSize;486 type WeightPrice = pallet_transaction_payment::Module<Self>;487 type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;488 type ChainExtension = NFTExtension;489 type DeletionQueueDepth = DeletionQueueDepth;490 type DeletionWeightLimit = DeletionWeightLimit;491 type MaxCodeSize = MaxCodeSize;492}493494parameter_types! {495 pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer496}497498/// Linear implementor of `WeightToFeePolynomial`499pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);500501impl<T> WeightToFeePolynomial for LinearFee<T> where502 T: BaseArithmetic + From<u32> + Copy + Unsigned503{504 type Balance = T;505506 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {507 smallvec!(WeightToFeeCoefficient {508 coeff_integer: 146_700u32.into(), // Targeting 0.1 Unique per NFT transfer509 coeff_frac: Perbill::zero(),510 negative: false,511 degree: 1,512 })513 }514}515516impl pallet_transaction_payment::Config for Runtime {517 type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees>;518 type TransactionByteFee = TransactionByteFee;519 type WeightToFee = LinearFee<Balance>;520 type FeeMultiplierUpdate = ();521}522523parameter_types! {524 pub const ProposalBond: Permill = Permill::from_percent(5);525 pub const ProposalBondMinimum: Balance = 1 * UNIQUE;526 pub const SpendPeriod: BlockNumber = 5 * MINUTES;527 pub const Burn: Permill = Permill::from_percent(0);528 pub const TipCountdown: BlockNumber = 1 * DAYS;529 pub const TipFindersFee: Percent = Percent::from_percent(20);530 pub const TipReportDepositBase: Balance = 1 * UNIQUE;531 pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;532 pub const BountyDepositBase: Balance = 1 * UNIQUE;533 pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;534 pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");535 pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;536 pub const MaximumReasonLength: u32 = 16384;537 pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);538 pub const BountyValueMinimum: Balance = 5 * UNIQUE;539}540541impl pallet_treasury::Config for Runtime {542 type ModuleId = TreasuryModuleId;543 type Currency = Balances;544 type ApproveOrigin = EnsureRoot<AccountId>;545 type RejectOrigin = EnsureRoot<AccountId>;546 type Event = Event;547 type OnSlash = ();548 type ProposalBond = ProposalBond;549 type ProposalBondMinimum = ProposalBondMinimum;550 type SpendPeriod = SpendPeriod;551 type Burn = Burn;552 type BurnDestination = ();553 type SpendFunds = ();554 type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;555}556557impl pallet_sudo::Config for Runtime {558 type Event = Event;559 type Call = Call;560}561562parameter_types! {563 pub const MinVestedTransfer: Balance = 10 * UNIQUE;564}565566impl pallet_vesting::Config for Runtime {567 type Event = Event;568 type Currency = Balances;569 type BlockNumberToBalance = ConvertInto;570 type MinVestedTransfer = MinVestedTransfer;571 type WeightInfo = ();572}573574parameter_types! {575 pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();576 pub const CollectionCreationPrice: Balance = 100 * UNIQUE;577}578579/// Used for the pallet nft in `./nft.rs`580impl pallet_nft::Config for Runtime {581 type Event = Event;582 type WeightInfo = nft_weights::WeightInfo;583584 type EvmWithdrawOrigin = EnsureAddressTruncated;585 type EvmBackwardsAddressMapping = pallet_nft::MapBackwardsAddressTruncated;586 type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;587 type CrossAccountId = pallet_nft::BasicCrossAccountId<Self>;588589 type Currency = Balances;590 type CollectionCreationPrice = CollectionCreationPrice;591 type TreasuryAccountId = TreasuryAccountId;592593 type EthereumChainId = ChainId;594 type EthereumTransactionSender = pallet_ethereum::Module<Runtime>;595}596597/// Reimport pallet inflation598extern crate pallet_inflation;599pub use pallet_inflation::*;600601parameter_types! {602 pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied603}604605/// Used for the pallet inflation606impl pallet_inflation::Config for Runtime {607 type Currency = Balances;608 type TreasuryAccountId = TreasuryAccountId;609 type InflationBlockInterval = InflationBlockInterval;610}611612construct_runtime!(613 pub enum Runtime where614 Block = Block,615 NodeBlock = opaque::Block,616 UncheckedExtrinsic = UncheckedExtrinsic617 {618 System: system::{Module, Call, Config, Storage, Event<T>},619 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},620 Contracts: pallet_contracts::{Module, Call, Config<T>, Storage, Event<T>},621 Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},622 Aura: pallet_aura::{Module, Config<T> },623 EVM: pallet_evm::{Module, Config, Call, Storage, Event<T>},624 Ethereum: pallet_ethereum::{Module, Config, Call, Storage, Event, ValidateUnsigned},625 Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},626 Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},627 TransactionPayment: pallet_transaction_payment::{Module, Storage},628 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},629 Inflation: pallet_inflation::{Module, Call, Storage},630 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},631 Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},632 Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},633 }634);635636pub struct TransactionConverter;637638impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {639 fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {640 UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into())641 }642}643644impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {645 fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic {646 let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into());647 let encoded = extrinsic.encode();648 opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid")649 }650}651652/// The address format for describing accounts.653pub type Address = AccountId;654/// Block header type as expected by this runtime.655pub type Header = generic::Header<BlockNumber, BlakeTwo256>;656/// Block type as expected by this runtime.657pub type Block = generic::Block<Header, UncheckedExtrinsic>;658/// A Block signed with a Justification659pub type SignedBlock = generic::SignedBlock<Block>;660/// BlockId type as expected by this runtime.661pub type BlockId = generic::BlockId<Block>;662/// The SignedExtension to the basic transaction logic.663pub type SignedExtra = (664 system::CheckSpecVersion<Runtime>,665 system::CheckTxVersion<Runtime>,666 system::CheckGenesis<Runtime>,667 system::CheckEra<Runtime>,668 system::CheckNonce<Runtime>,669 system::CheckWeight<Runtime>,670 pallet_nft::ChargeTransactionPayment<Runtime>,671);672/// Unchecked extrinsic type as expected by this runtime.673pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;674/// Extrinsic type that has already been checked.675pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;676/// Executive: handles dispatch to the various modules.677pub type Executive =678 frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;679680impl_runtime_apis! {681 impl pallet_nft::NftApi<Block>682 for Runtime683 {684 fn eth_contract_code(account: H160) -> Option<Vec<u8>> {685 <pallet_nft::NftErcSupport<Runtime>>::get_code(&account)686 }687 }688689 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>690 for Runtime691 {692 fn call(693 origin: AccountId,694 dest: AccountId,695 value: Balance,696 gas_limit: u64,697 input_data: Vec<u8>,698 ) -> pallet_contracts_primitives::ContractExecResult {699 Contracts::bare_call(origin, dest, value, gas_limit, input_data)700 }701702 fn get_storage(703 address: AccountId,704 key: [u8; 32],705 ) -> pallet_contracts_primitives::GetStorageResult {706 Contracts::get_storage(address, key)707 }708709 fn rent_projection(710 address: AccountId,711 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {712 Contracts::rent_projection(address)713 }714 }715716 impl sp_api::Core<Block> for Runtime {717 fn version() -> RuntimeVersion {718 VERSION719 }720721 fn execute_block(block: Block) {722 Executive::execute_block(block)723 }724725 fn initialize_block(header: &<Block as BlockT>::Header) {726 Executive::initialize_block(header)727 }728 }729730 impl sp_api::Metadata<Block> for Runtime {731 fn metadata() -> OpaqueMetadata {732 Runtime::metadata().into()733 }734 }735736 impl sp_block_builder::BlockBuilder<Block> for Runtime {737 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {738 Executive::apply_extrinsic(extrinsic)739 }740741 fn finalize_block() -> <Block as BlockT>::Header {742 Executive::finalize_block()743 }744745 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {746 data.create_extrinsics()747 }748749 fn check_inherents(750 block: Block,751 data: sp_inherents::InherentData,752 ) -> sp_inherents::CheckInherentsResult {753 data.check_extrinsics(&block)754 }755756 fn random_seed() -> <Block as BlockT>::Hash {757 RandomnessCollectiveFlip::random_seed().0758 }759 }760761 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {762 fn validate_transaction(763 source: TransactionSource,764 tx: <Block as BlockT>::Extrinsic,765 ) -> TransactionValidity {766 Executive::validate_transaction(source, tx)767 }768 }769770 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {771 fn offchain_worker(header: &<Block as BlockT>::Header) {772 Executive::offchain_worker(header)773 }774 }775776 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {777 fn slot_duration() -> u64 {778 Aura::slot_duration()779 }780781 fn authorities() -> Vec<AuraId> {782 Aura::authorities()783 }784 }785786 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {787 fn chain_id() -> u64 {788 <Runtime as pallet_evm::Config>::ChainId::get()789 }790791 fn account_basic(address: H160) -> EVMAccount {792 EVM::account_basic(&address)793 }794795 fn gas_price() -> U256 {796 <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()797 }798799 fn account_code_at(address: H160) -> Vec<u8> {800 EVM::account_codes(address)801 }802803 fn author() -> H160 {804 <pallet_ethereum::Module<Runtime>>::find_author()805 }806807 fn storage_at(address: H160, index: U256) -> H256 {808 let mut tmp = [0u8; 32];809 index.to_big_endian(&mut tmp);810 EVM::account_storages(address, H256::from_slice(&tmp[..]))811 }812813 fn call(814 from: H160,815 to: H160,816 data: Vec<u8>,817 value: U256,818 gas_limit: U256,819 gas_price: Option<U256>,820 nonce: Option<U256>,821 estimate: bool,822 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {823 let config = if estimate {824 let mut config = <Runtime as pallet_evm::Config>::config().clone();825 config.estimate = true;826 Some(config)827 } else {828 None829 };830831 <Runtime as pallet_evm::Config>::Runner::call(832 from,833 to,834 data,835 value,836 gas_limit.low_u64(),837 gas_price,838 nonce,839 config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),840 ).map_err(|err| err.into())841 }842843 fn create(844 from: H160,845 data: Vec<u8>,846 value: U256,847 gas_limit: U256,848 gas_price: Option<U256>,849 nonce: Option<U256>,850 estimate: bool,851 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {852 let config = if estimate {853 let mut config = <Runtime as pallet_evm::Config>::config().clone();854 config.estimate = true;855 Some(config)856 } else {857 None858 };859860 <Runtime as pallet_evm::Config>::Runner::create(861 from,862 data,863 value,864 gas_limit.low_u64(),865 gas_price,866 nonce,867 config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),868 ).map_err(|err| err.into())869 }870871 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {872 Ethereum::current_transaction_statuses()873 }874875 fn current_block() -> Option<pallet_ethereum::Block> {876 Ethereum::current_block()877 }878879 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {880 Ethereum::current_receipts()881 }882883 fn current_all() -> (884 Option<pallet_ethereum::Block>,885 Option<Vec<pallet_ethereum::Receipt>>,886 Option<Vec<TransactionStatus>>887 ) {888 (889 Ethereum::current_block(),890 Ethereum::current_receipts(),891 Ethereum::current_transaction_statuses()892 )893 }894 }895896 impl sp_session::SessionKeys<Block> for Runtime {897 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {898 opaque::SessionKeys::generate(seed)899 }900901 fn decode_session_keys(902 encoded: Vec<u8>,903 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {904 opaque::SessionKeys::decode_into_raw_public_keys(&encoded)905 }906 }907908 impl fg_primitives::GrandpaApi<Block> for Runtime {909 fn grandpa_authorities() -> GrandpaAuthorityList {910 Grandpa::grandpa_authorities()911 }912913 fn submit_report_equivocation_unsigned_extrinsic(914 _equivocation_proof: fg_primitives::EquivocationProof<915 <Block as BlockT>::Hash,916 NumberFor<Block>,917 >,918 _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,919 ) -> Option<()> {920 None921 }922923 fn generate_key_ownership_proof(924 _set_id: fg_primitives::SetId,925 _authority_id: GrandpaId,926 ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {927 // NOTE: this is the only implementation possible since we've928 // defined our key owner proof type as a bottom type (i.e. a type929 // with no values).930 None931 }932 }933934 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {935 fn account_nonce(account: AccountId) -> Index {936 System::account_nonce(account)937 }938 }939940 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {941 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {942 TransactionPayment::query_info(uxt, len)943 }944 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {945 TransactionPayment::query_fee_details(uxt, len)946 }947 }948949 #[cfg(feature = "runtime-benchmarks")]950 impl frame_benchmarking::Benchmark<Block> for Runtime {951 fn dispatch_benchmark(952 config: frame_benchmarking::BenchmarkConfig953 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {954 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};955956 let whitelist: Vec<TrackedStorageKey> = vec![957 // Alice account958 hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),959 // // Total Issuance960 // hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),961 // // Execution Phase962 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),963 // // Event Count964 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),965 // // System Events966 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),967 ];968969 let mut batches = Vec::<BenchmarkBatch>::new();970 let params = (&config, &whitelist);971972 add_benchmark!(params, batches, pallet_nft, Nft);973 add_benchmark!(params, batches, pallet_inflation, Inflation);974975 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }976 Ok(batches)977 }978 }979}tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -21,6 +21,7 @@
"test": "mocha --timeout 9999999 -r ts-node/register ./**/*.test.ts",
"load": "mocha --timeout 9999999 -r ts-node/register ./**/*.load.ts",
"loadTransfer": "ts-node src/transfer.nload.ts",
+ "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",
"testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",
"testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",
"testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",
@@ -49,7 +50,9 @@
"testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts",
"testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts",
"testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts",
- "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts"
+ "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts",
+ "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",
+ "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts"
},
"author": "",
"license": "SEE LICENSE IN ../LICENSE",
tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -17,7 +17,7 @@
describe('Create Multiple Items Event event ', () => {
let Alice: IKeyringPair;
- const checkSection = 'ItemCreated (x3)';
+ const checkSection = 'ItemCreated';
const checkTreasury = 'Deposit';
const checkSystem = 'ExtrinsicSuccess';
before(async () => {
tests/src/collision-tests/admVsOwnerChanges.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/admVsOwnerChanges.test.ts
@@ -0,0 +1,55 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Admin vs Owner changes token: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection admin changes the owner of the token and in the same block the current owner transfers the token to another address ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTxBob);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const changeAdminTxFerdie = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
+ await submitTransactionAsync(Bob, changeAdminTxFerdie);
+ const itemId = await createItemExpectSuccess(Ferdie, collectionId, 'NFT');
+ //
+ const changeOwner = api.tx.nft.transferFrom(Ferdie.address, Bob.address, collectionId, itemId, 1);
+ const approve = api.tx.nft.approve(Bob.address, collectionId, itemId, 1);
+ const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+ await Promise.all
+ ([
+ changeOwner.signAndSend(Alice),
+ approve.signAndSend(Bob),
+ sendItem.signAndSend(Ferdie),
+ ]);
+ const itemBefore: any = await api.query.nft.nftItemList(collectionId, itemId);
+ expect(itemBefore.Owner).not.to.be.eq(Bob.address);
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/admVsOwnerData.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/admVsOwnerData.test.ts
@@ -0,0 +1,54 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Admin vs Owner changes the data in the token: ', () => {
+ it('The collection admin changes the data in the token and in the same block the token owner also changes the data in it ', async () => {
+ await usingApi(async (api) => {
+ const AliceData = 1;
+ const BobData = 2;
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ //
+ // tslint:disable-next-line: max-line-length
+ const AliceTx = api.tx.nft.setVariableMetaData(collectionId, itemId, AliceData.toString());
+ // tslint:disable-next-line: max-line-length
+ const BobTx = api.tx.nft.setVariableMetaData(collectionId, itemId, BobData.toString());
+ await Promise.all
+ ([
+ AliceTx.signAndSend(Alice),
+ BobTx.signAndSend(Bob),
+ ]);
+ const item: any = await api.query.nft.nftItemList(collectionId, itemId);
+ expect(item.VariableData).not.to.be.eq(null); // Pseudo-random selection of one of two values
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/admVsOwnerTake.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/admVsOwnerTake.test.ts
@@ -0,0 +1,54 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Admin vs Owner take token: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection admin burns the token and in the same block the token owner performs a transaction on it ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ //
+ const sendItem = api.tx.nft.transfer(Ferdie.address, collectionId, itemId, 1);
+ const burnItem = api.tx.nft.burnItem(collectionId, itemId, 1);
+ await Promise.all
+ ([
+ sendItem.signAndSend(Bob),
+ burnItem.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ let itemBurn: boolean = false;
+ itemBurn = (await (api.query.nft.nftItemList(collectionId, itemId))).toJSON() as boolean;
+ // tslint:disable-next-line: no-unused-expression
+ expect(itemBurn).to.be.null;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/adminDestroyCollection.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/adminDestroyCollection.test.ts
@@ -0,0 +1,61 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+interface ITokenDataType {
+ Owner: number[];
+ ConstData: number[];
+ VariableData: number[];
+}
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+let Charlie: IKeyringPair;
+let Eve: IKeyringPair;
+let Dave: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ Charlie = privateKey('//Charlie');
+ Eve = privateKey('//Eve');
+ Dave = privateKey('//Dave');
+ });
+});
+
+describe('Deleting a collection while add address to whitelist: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('Adding an address to the collection whitelist in a block by the admin, and deleting the collection by the owner ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await timeoutPromise(10000);
+ //
+ const addWhitelistAdm = api.tx.nft.addToWhiteList(collectionId, Ferdie.address);
+ const destroyCollection = api.tx.nft.destroyCollection(collectionId);
+ await Promise.all
+ ([
+ addWhitelistAdm.signAndSend(Bob),
+ destroyCollection.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ let whiteList: boolean = false;
+ whiteList = (await api.query.nft.whiteList(collectionId, Ferdie.address)).toJSON() as boolean;
+ // tslint:disable-next-line: no-unused-expression
+ expect(whiteList).to.be.false;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/adminLimitsOff.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/adminLimitsOff.test.ts
@@ -0,0 +1,74 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+interface ITokenDataType {
+ Owner: number[];
+ ConstData: number[];
+ VariableData: number[];
+}
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+let Charlie: IKeyringPair;
+let Eve: IKeyringPair;
+let Dave: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ Charlie = privateKey('//Charlie');
+ Eve = privateKey('//Eve');
+ Dave = privateKey('//Dave');
+ });
+});
+
+describe('Admin limit exceeded collection: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('In one block, the owner and admin add new admins to the collection more than the limit ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+
+ const chainLimit = await api.query.nft.chainLimit() as unknown as { CollectionAdminsLimit: BN };
+ const chainAdminLimit = chainLimit.CollectionAdminsLimit.toNumber();
+ expect(chainAdminLimit).to.be.equal(5);
+
+ const changeAdminTx1 = api.tx.nft.addCollectionAdmin(collectionId, Eve.address);
+ await submitTransactionAsync(Alice, changeAdminTx1);
+ const changeAdminTx2 = api.tx.nft.addCollectionAdmin(collectionId, Dave.address);
+ await submitTransactionAsync(Alice, changeAdminTx2);
+ const changeAdminTx3 = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx3);
+
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ //
+ const addAdmOne = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
+ const addAdmTwo = api.tx.nft.addCollectionAdmin(collectionId, Charlie.address);
+ await Promise.all
+ ([
+ addAdmOne.signAndSend(Bob),
+ addAdmTwo.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ const changeAdminTx4 = api.tx.nft.addCollectionAdmin(collectionId, Alice.address);
+ // tslint:disable-next-line: no-unused-expression
+ expect(submitTransactionExpectFailAsync(Alice, changeAdminTx4)).to.be.rejected;
+
+ const adminListAfterAddAdmin: any = (await api.query.nft.adminList(collectionId));
+ expect(adminListAfterAddAdmin).to.be.contains(Eve.address);
+ expect(adminListAfterAddAdmin).to.be.contains(Ferdie.address);
+ expect(adminListAfterAddAdmin).not.to.be.contains(Alice.address);
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/adminRightsOff.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/adminRightsOff.test.ts
@@ -0,0 +1,62 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+interface ITokenDataType {
+ Owner: number[];
+ ConstData: number[];
+ VariableData: number[];
+}
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+let Charlie: IKeyringPair;
+let Eve: IKeyringPair;
+let Dave: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ Charlie = privateKey('//Charlie');
+ Eve = privateKey('//Eve');
+ Dave = privateKey('//Dave');
+ });
+});
+
+describe('Deprivation of admin rights: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('In the block, the collection admin adds a token or changes data, and the collection owner deprives the admin of rights ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await timeoutPromise(10000);
+ //
+ const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
+ const addItemAdm = api.tx.nft.createMultipleItems(collectionId, Bob.address, args);
+ const removeAdm = api.tx.nft.removeCollectionAdmin(collectionId, Bob.address);
+ await Promise.all
+ ([
+ addItemAdm.signAndSend(Bob),
+ removeAdm.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ const itemsListIndex = await api.query.nft.itemListIndex(collectionId) as unknown as BN;
+ expect(itemsListIndex.toNumber()).to.be.equal(0);
+ const adminList: any = (await api.query.nft.adminList(collectionId));
+ expect(adminList).not.to.be.contains(Bob.address);
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/setSponsorNewOwner.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/setSponsorNewOwner.test.ts
@@ -0,0 +1,53 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess, createItemExpectSuccess, setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+interface ITokenDataType {
+ Owner: number[];
+ ConstData: number[];
+ VariableData: number[];
+}
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Sponsored with new owner ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('Confirmation of sponsorship of a collection in a block with a change in the owner of the collection: ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await timeoutPromise(10000);
+ //
+ const confirmSponsorship = api.tx.nft.confirmSponsorship(collectionId);
+ const changeCollectionOwner = api.tx.nft.changeCollectionOwner(collectionId, Ferdie.address);
+ await Promise.all
+ ([
+ confirmSponsorship.signAndSend(Bob),
+ changeCollectionOwner.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
+ expect(collection.Sponsorship.Confirmed).to.be.eq(Bob.address);
+ expect(collection.Owner).to.be.eq(Ferdie.address);
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/sponsorPayments.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/sponsorPayments.test.ts
@@ -0,0 +1,58 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import {
+ confirmSponsorshipExpectSuccess,
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Payment of commission if one block: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('Payment of commission if one block contains transactions for payment from the sponsor\'s balance and his (sponsor\'s) exclusion from the collection ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTxBob);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
+ await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
+ //
+ const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+ const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+ const revokeSponsor = api.tx.nft.removeCollectionSponsor(collectionId);
+ await Promise.all
+ ([
+ sendItem.signAndSend(Bob),
+ revokeSponsor.signAndSend(Alice),
+ ]);
+ const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+ // tslint:disable-next-line:no-unused-expression
+ expect(alicesBalanceAfter === alicesBalanceBefore).to.be.true;
+ // tslint:disable-next-line:no-unused-expression
+ expect(bobsBalanceAfter === bobsBalanceBefore).to.be.true;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/tokenLimitsOff.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/tokenLimitsOff.test.ts
@@ -0,0 +1,84 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+ addToWhiteListExpectSuccess,
+ createCollectionExpectSuccess,
+ getCreateItemResult,
+ setMintPermissionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+interface ITokenDataType {
+ Owner: number[];
+ ConstData: number[];
+ VariableData: number[];
+}
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+const AccountTokenOwnershipLimit = 4;
+const SponsoredMintSize = 4294967295;
+const TokenLimit = 4;
+const SponsorTimeout = 14400;
+const OwnerCanTransfer = false;
+const OwnerCanDestroy = false;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Token limit exceeded collection: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The number of tokens created in the collection from different addresses exceeds the allowed collection limit ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ await setMintPermissionExpectSuccess(Alice, collectionId, true);
+ await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
+ await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+ const setCollectionLim = api.tx.nft.setCollectionLimits(
+ collectionId,
+ {
+ AccountTokenOwnershipLimit,
+ SponsoredMintSize,
+ TokenLimit,
+ // tslint:disable-next-line: object-literal-sort-keys
+ SponsorTimeout,
+ OwnerCanTransfer,
+ OwnerCanDestroy,
+ },
+ );
+ const subTx = await submitTransactionAsync(Alice, setCollectionLim);
+ const subTxTesult = getCreateItemResult(subTx);
+ // tslint:disable-next-line:no-unused-expression
+ expect(subTxTesult.success).to.be.true;
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await timeoutPromise(10000);
+ //
+ const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
+ const mintItemOne = api.tx.nft
+ .createMultipleItems(collectionId, Ferdie.address, args);
+ const mintItemTwo = api.tx.nft
+ .createMultipleItems(collectionId, Bob.address, args);
+ await Promise.all
+ ([
+ mintItemOne.signAndSend(Ferdie),
+ mintItemTwo.signAndSend(Bob),
+ ]);
+ await timeoutPromise(10000);
+ const itemsListIndexAfter = await api.query.nft.itemListIndex(collectionId) as unknown as BN;
+ expect(itemsListIndexAfter.toNumber()).to.be.equal(3);
+ // TokenLimit = 4. The first transaction is successful. The second should fail.
+ await timeoutPromise(10000);
+ });
+ });
+});
tests/src/collision-tests/turnsOffMinting.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/collision-tests/turnsOffMinting.test.ts
@@ -0,0 +1,50 @@
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import {
+ addToWhiteListExpectSuccess,
+ createCollectionExpectSuccess,
+ setMintPermissionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Turns off minting mode: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await setMintPermissionExpectSuccess(Alice, collectionId, true);
+ await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
+ //
+ const mintItem = api.tx.nft.createItem(collectionId, Ferdie.address, 'NFT');
+ const offMinting = api.tx.nft.setMintPermission(collectionId, false);
+ await Promise.all
+ ([
+ mintItem.signAndSend(Ferdie),
+ offMinting.signAndSend(Alice),
+ ]);
+ let itemList: boolean = false;
+ itemList = (await (api.query.nft.nftItemList(collectionId, mintItem))).toJSON() as boolean;
+ // tslint:disable-next-line: no-unused-expression
+ expect(itemList).to.be.null;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -18,6 +18,7 @@
} from './util/helpers';
import { default as waitNewBlocks } from './substrate/wait-new-blocks';
+import { ApiPromise } from '@polkadot/api';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -30,6 +31,25 @@
let alice: IKeyringPair;
let bob: IKeyringPair;
+// Skip the inflation block pauses if the block is close to inflation block
+// until the inflation happens
+function skipInflationBlock(api: ApiPromise): Promise<void> {
+ const promise = new Promise<void>(async (resolve, reject) => {
+ const blockInterval = parseInt((await api.consts.inflation.inflationBlockInterval).toString());
+ const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
+ const currentBlock = parseInt(head.number.toString());
+ if (currentBlock % blockInterval < blockInterval - 10) {
+ unsubscribe();
+ resolve();
+ } else {
+ console.log(`Skipping inflation block, current block: ${currentBlock}`);
+ }
+ });
+ });
+
+ return promise;
+}
+
describe('integration test: Fees must be credited to Treasury:', () => {
before(async () => {
await usingApi(async (api) => {
@@ -40,6 +60,7 @@
it('Total issuance does not change', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const totalBefore = new BigNumber((await api.query.balances.totalIssuance()).toString());
@@ -59,6 +80,7 @@
it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const alicePrivateKey = privateKey('//Alice');
@@ -81,6 +103,7 @@
it('Treasury balance increased by failed tx fee', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const bobPrivateKey = privateKey('//Bob');
@@ -101,6 +124,7 @@
it('NFT Transactions also send fees to Treasury', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());
@@ -119,6 +143,7 @@
it('Fees are sane', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());
@@ -135,6 +160,7 @@
it('NFT Transfer fee is close to 0.1 Unique', async () => {
await usingApi(async (api) => {
+ await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const collectionId = await createCollectionExpectSuccess();
@@ -147,7 +173,7 @@
// console.log(fee.toString());
const expectedTransferFee = 0.1;
- const tolerance = 0.00001;
+ const tolerance = 0.001;
expect(fee.dividedBy(1e15).minus(expectedTransferFee).abs().toNumber()).to.be.lessThan(tolerance);
});
});
tests/src/inflation.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/inflation.test.ts
@@ -0,0 +1,43 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { default as usingApi } from "./substrate/substrate-api";
+import privateKey from "./substrate/privateKey";
+import { BigNumber } from 'bignumber.js';
+import { IKeyringPair } from '@polkadot/types/types';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let alice: IKeyringPair;
+let bob: IKeyringPair;
+
+describe('integration test: Inflation', () => {
+ before(async () => {
+ await usingApi(async (api) => {
+ alice = privateKey('//Alice');
+ bob = privateKey('//Bob');
+ });
+ });
+
+ it('First year inflation is 10%', async () => {
+ await usingApi(async (api) => {
+
+ const blockInterval = parseInt((await api.consts.inflation.inflationBlockInterval).toString());
+ const totalIssuanceStart = new BigNumber((await api.query.inflation.startingYearTotalIssuance()).toString());
+ const blockInflation = new BigNumber((await api.query.inflation.blockInflation()).toString());
+
+ const YEAR = 5259600; // Blocks in one year
+ const totalExpectedInflation = totalIssuanceStart.multipliedBy(0.1);
+ const totalActualInflation = blockInflation.multipliedBy(YEAR / blockInterval);
+
+ const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation
+ expect(totalExpectedInflation.dividedBy(totalActualInflation).minus(1).abs().toNumber()).to.be.lessThan(tolerance);
+ });
+ });
+
+});
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -13,7 +13,7 @@
// Pallets that must always be present
const requiredPallets = [
- 'nft', 'balances', 'contracts', 'randomnesscollectiveflip', 'system', 'timestamp', 'transactionpayment', 'treasury', 'vesting'
+ 'nft', 'inflation', 'balances', 'contracts', 'randomnesscollectiveflip', 'system', 'timestamp', 'transactionpayment', 'treasury', 'vesting'
];
// Pallets that depend on consensus and governance configuration