difftreelog
Merge branch 'develop' into tests/eth-helpers
in: master
96 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -18,7 +18,16 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
dependencies = [
- "gimli",
+ "gimli 0.26.2",
+]
+
+[[package]]
+name = "addr2line"
+version = "0.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97"
+dependencies = [
+ "gimli 0.27.0",
]
[[package]]
@@ -108,9 +117,9 @@
[[package]]
name = "anyhow"
-version = "1.0.66"
+version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
+checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
[[package]]
name = "app-promotion-rpc"
@@ -142,19 +151,16 @@
checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6"
[[package]]
+name = "array-bytes"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22f72e9d6fac4bc80778ea470b20197b88d28c292bb7d60c3fb099280003cd19"
+
+[[package]]
name = "arrayref"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
-dependencies = [
- "nodrop",
-]
[[package]]
name = "arrayvec"
@@ -289,7 +295,6 @@
"async-global-executor",
"async-io",
"async-lock",
- "async-process",
"crossbeam-utils",
"futures-channel",
"futures-core",
@@ -304,21 +309,6 @@
"pin-utils",
"slab",
"wasm-bindgen-futures",
-]
-
-[[package]]
-name = "async-std-resolver"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ba50e24d9ee0a8950d3d03fc6d0dd10aa14b5de3b101949b4e160f7fee7c723"
-dependencies = [
- "async-std",
- "async-trait",
- "futures-io",
- "futures-util",
- "pin-utils",
- "socket2",
- "trust-dns-resolver",
]
[[package]]
@@ -329,9 +319,9 @@
[[package]]
name = "async-trait"
-version = "0.1.59"
+version = "0.1.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364"
+checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"
dependencies = [
"proc-macro2",
"quote",
@@ -387,31 +377,17 @@
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
-name = "backoff"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1"
-dependencies = [
- "futures-core",
- "getrandom 0.2.8",
- "instant",
- "pin-project-lite 0.2.9",
- "rand 0.8.5",
- "tokio",
-]
-
-[[package]]
name = "backtrace"
-version = "0.3.66"
+version = "0.3.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7"
+checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca"
dependencies = [
- "addr2line",
+ "addr2line 0.19.0",
"cc",
"cfg-if",
"libc",
- "miniz_oxide 0.5.4",
- "object",
+ "miniz_oxide",
+ "object 0.30.0",
"rustc-demangle",
]
@@ -457,11 +433,10 @@
[[package]]
name = "beefy-gadget"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"async-trait",
- "beefy-primitives",
"fnv",
"futures 0.3.25",
"futures-timer",
@@ -480,6 +455,7 @@
"sp-api",
"sp-application-crypto",
"sp-arithmetic",
+ "sp-beefy",
"sp-blockchain",
"sp-consensus",
"sp-core",
@@ -494,10 +470,9 @@
[[package]]
name = "beefy-gadget-rpc"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"beefy-gadget",
- "beefy-primitives",
"futures 0.3.25",
"jsonrpsee",
"log",
@@ -506,6 +481,7 @@
"sc-rpc",
"sc-utils",
"serde",
+ "sp-beefy",
"sp-core",
"sp-runtime",
"thiserror",
@@ -514,28 +490,11 @@
[[package]]
name = "beefy-merkle-tree"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "beefy-primitives",
"sp-api",
- "sp-runtime",
-]
-
-[[package]]
-name = "beefy-primitives"
-version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
-dependencies = [
- "parity-scale-codec 3.2.1",
- "scale-info",
- "serde",
- "sp-api",
- "sp-application-crypto",
- "sp-core",
- "sp-io",
- "sp-mmr-primitives",
+ "sp-beefy",
"sp-runtime",
- "sp-std",
]
[[package]]
@@ -598,24 +557,14 @@
[[package]]
name = "blake2"
-version = "0.10.5"
+version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e"
+checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
dependencies = [
"digest 0.10.6",
]
[[package]]
-name = "blake2-rfc"
-version = "0.2.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
-dependencies = [
- "arrayvec 0.4.12",
- "constant_time_eq 0.1.5",
-]
-
-[[package]]
name = "blake2b_simd"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -826,16 +775,16 @@
dependencies = [
"camino",
"cargo-platform",
- "semver 1.0.14",
+ "semver 1.0.16",
"serde",
"serde_json",
]
[[package]]
name = "cc"
-version = "1.0.77"
+version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
+checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
dependencies = [
"jobserver",
]
@@ -905,7 +854,7 @@
"js-sys",
"num-integer",
"num-traits",
- "time 0.1.45",
+ "time",
"wasm-bindgen",
"winapi",
]
@@ -954,9 +903,9 @@
[[package]]
name = "clap"
-version = "4.0.29"
+version = "4.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d"
+checksum = "656ad1e55e23d287773f7d8192c300dc715c3eeded93b3da651d11c42cfd74d2"
dependencies = [
"bitflags",
"clap_derive",
@@ -1103,6 +1052,16 @@
]
[[package]]
+name = "cpu-time"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
name = "cpufeatures"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1133,7 +1092,7 @@
"cranelift-codegen-shared",
"cranelift-entity",
"cranelift-isle",
- "gimli",
+ "gimli 0.26.2",
"log",
"regalloc2",
"smallvec",
@@ -1341,7 +1300,7 @@
[[package]]
name = "cumulus-client-cli"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"clap",
"parity-scale-codec 3.2.1",
@@ -1356,7 +1315,7 @@
[[package]]
name = "cumulus-client-collator"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-client-consensus-common",
"cumulus-client-network",
@@ -1379,7 +1338,7 @@
[[package]]
name = "cumulus-client-consensus-aura"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
"cumulus-client-consensus-common",
@@ -1408,12 +1367,15 @@
[[package]]
name = "cumulus-client-consensus-common"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
+ "cumulus-client-pov-recovery",
+ "cumulus-primitives-core",
"cumulus-relay-chain-interface",
"dyn-clone",
"futures 0.3.25",
+ "log",
"parity-scale-codec 3.2.1",
"polkadot-primitives",
"sc-client-api",
@@ -1428,7 +1390,7 @@
[[package]]
name = "cumulus-client-network"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
"cumulus-relay-chain-interface",
@@ -1451,7 +1413,7 @@
[[package]]
name = "cumulus-client-pov-recovery"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
@@ -1474,19 +1436,24 @@
[[package]]
name = "cumulus-client-service"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-common",
"cumulus-client-pov-recovery",
"cumulus-primitives-core",
+ "cumulus-relay-chain-inprocess-interface",
"cumulus-relay-chain-interface",
+ "cumulus-relay-chain-minimal-node",
+ "futures 0.3.25",
"parking_lot 0.12.1",
"polkadot-primitives",
"sc-client-api",
"sc-consensus",
"sc-service",
+ "sc-sysinfo",
+ "sc-telemetry",
"sp-api",
"sp-blockchain",
"sp-consensus",
@@ -1497,7 +1464,7 @@
[[package]]
name = "cumulus-pallet-aura-ext"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"frame-support",
"frame-system",
@@ -1513,7 +1480,7 @@
[[package]]
name = "cumulus-pallet-dmp-queue"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"frame-support",
@@ -1530,7 +1497,7 @@
[[package]]
name = "cumulus-pallet-parachain-system"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"bytes",
"cumulus-pallet-parachain-system-proc-macro",
@@ -1558,7 +1525,7 @@
[[package]]
name = "cumulus-pallet-parachain-system-proc-macro"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -1569,7 +1536,7 @@
[[package]]
name = "cumulus-pallet-xcm"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"frame-support",
@@ -1585,7 +1552,7 @@
[[package]]
name = "cumulus-pallet-xcmp-queue"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"frame-support",
@@ -1603,7 +1570,7 @@
[[package]]
name = "cumulus-primitives-core"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"parity-scale-codec 3.2.1",
"polkadot-core-primitives",
@@ -1618,7 +1585,7 @@
[[package]]
name = "cumulus-primitives-parachain-inherent"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
"cumulus-primitives-core",
@@ -1641,7 +1608,7 @@
[[package]]
name = "cumulus-primitives-timestamp"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"futures 0.3.25",
@@ -1654,7 +1621,7 @@
[[package]]
name = "cumulus-primitives-utility"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"frame-support",
@@ -1670,7 +1637,7 @@
[[package]]
name = "cumulus-relay-chain-inprocess-interface"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
"cumulus-primitives-core",
@@ -1695,7 +1662,7 @@
[[package]]
name = "cumulus-relay-chain-interface"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
"cumulus-primitives-core",
@@ -1709,24 +1676,23 @@
"sp-blockchain",
"sp-state-machine",
"thiserror",
+ "tokio",
]
[[package]]
name = "cumulus-relay-chain-minimal-node"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
- "array-bytes",
+ "array-bytes 6.0.0",
"async-trait",
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
"cumulus-relay-chain-rpc-interface",
"futures 0.3.25",
"lru",
- "polkadot-availability-distribution",
"polkadot-core-primitives",
"polkadot-network-bridge",
- "polkadot-node-core-av-store",
"polkadot-node-network-protocol",
"polkadot-node-subsystem-util",
"polkadot-overseer",
@@ -1738,8 +1704,6 @@
"sc-keystore",
"sc-network",
"sc-network-common",
- "sc-network-light",
- "sc-network-sync",
"sc-service",
"sc-telemetry",
"sc-tracing",
@@ -1758,24 +1722,25 @@
[[package]]
name = "cumulus-relay-chain-rpc-interface"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"async-trait",
- "backoff",
"cumulus-primitives-core",
"cumulus-relay-chain-interface",
"futures 0.3.25",
"futures-timer",
"jsonrpsee",
+ "lru",
"parity-scale-codec 3.2.1",
"polkadot-service",
"sc-client-api",
"sc-rpc-api",
+ "serde",
+ "serde_json",
"sp-api",
"sp-authority-discovery",
"sp-consensus-babe",
"sp-core",
- "sp-runtime",
"sp-state-machine",
"sp-storage",
"tokio",
@@ -1786,7 +1751,7 @@
[[package]]
name = "cumulus-test-relay-sproof-builder"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"parity-scale-codec 3.2.1",
@@ -1824,22 +1789,23 @@
[[package]]
name = "curve25519-dalek"
-version = "4.0.0-pre.1"
+version = "4.0.0-pre.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf"
+checksum = "67bc65846be335cb20f4e52d49a437b773a2c1fdb42b19fc84e79e6f6771536f"
dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.6.4",
+ "cfg-if",
+ "fiat-crypto",
+ "packed_simd_2",
+ "platforms 3.0.2",
"subtle",
"zeroize",
]
[[package]]
name = "cxx"
-version = "1.0.83"
+version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf"
+checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd"
dependencies = [
"cc",
"cxxbridge-flags",
@@ -1849,9 +1815,9 @@
[[package]]
name = "cxx-build"
-version = "1.0.83"
+version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39"
+checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0"
dependencies = [
"cc",
"codespan-reporting",
@@ -1864,15 +1830,15 @@
[[package]]
name = "cxxbridge-flags"
-version = "1.0.83"
+version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12"
+checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59"
[[package]]
name = "cxxbridge-macro"
-version = "1.0.83"
+version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6"
+checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6"
dependencies = [
"proc-macro2",
"quote",
@@ -1907,9 +1873,9 @@
[[package]]
name = "der"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f"
+checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de"
dependencies = [
"const-oid",
"zeroize",
@@ -2039,9 +2005,9 @@
[[package]]
name = "dtoa"
-version = "1.0.4"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8a6eee2d5d0d113f015688310da018bd1d864d86bd567c8fca9c266889e1bfa"
+checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313"
[[package]]
name = "dyn-clonable"
@@ -2066,9 +2032,9 @@
[[package]]
name = "dyn-clone"
-version = "1.0.9"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2"
+checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60"
[[package]]
name = "ecdsa"
@@ -2184,9 +2150,9 @@
[[package]]
name = "enumn"
-version = "0.1.5"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2"
+checksum = "e88bcb3a067a6555d577aba299e75eff9942da276e6506fc6274327daa026132"
dependencies = [
"proc-macro2",
"quote",
@@ -2336,7 +2302,7 @@
[[package]]
name = "evm"
version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.33#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
dependencies = [
"auto_impl",
"environmental",
@@ -2387,7 +2353,7 @@
[[package]]
name = "evm-core"
version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.33#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
dependencies = [
"parity-scale-codec 3.2.1",
"primitive-types 0.12.1",
@@ -2398,7 +2364,7 @@
[[package]]
name = "evm-gasometer"
version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.33#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
dependencies = [
"environmental",
"evm-core",
@@ -2409,7 +2375,7 @@
[[package]]
name = "evm-runtime"
version = "0.35.0"
-source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.33#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
+source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.36#a68cd3ea5ee2eb310e3452e660a8e9e56a474d2a"
dependencies = [
"auto_impl",
"environmental",
@@ -2501,7 +2467,7 @@
[[package]]
name = "fc-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"async-trait",
"fc-db",
@@ -2520,15 +2486,16 @@
[[package]]
name = "fc-db"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"fp-storage",
"kvdb-rocksdb",
"log",
- "parity-db 0.3.17",
+ "parity-db",
"parity-scale-codec 3.2.1",
"parking_lot 0.12.1",
"sc-client-db",
+ "smallvec",
"sp-blockchain",
"sp-core",
"sp-database",
@@ -2538,7 +2505,7 @@
[[package]]
name = "fc-mapping-sync"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"fc-db",
"fp-consensus",
@@ -2555,7 +2522,7 @@
[[package]]
name = "fc-rpc"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"ethereum-types 0.14.1",
@@ -2598,7 +2565,7 @@
[[package]]
name = "fc-rpc-core"
version = "1.1.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"ethereum-types 0.14.1",
@@ -2629,6 +2596,12 @@
]
[[package]]
+name = "fiat-crypto"
+version = "0.1.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a214f5bb88731d436478f3ae1f8a277b62124089ba9fb67f4f93fb100ef73c90"
+
+[[package]]
name = "file-per-thread-logger"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2640,9 +2613,9 @@
[[package]]
name = "filetime"
-version = "0.2.18"
+version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3"
+checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
dependencies = [
"cfg-if",
"libc",
@@ -2703,24 +2676,23 @@
dependencies = [
"crc32fast",
"libz-sys",
- "miniz_oxide 0.6.2",
+ "miniz_oxide",
]
[[package]]
name = "flexi_logger"
-version = "0.22.6"
+version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c76a80dd14a27fc3d8bc696502132cb52b3f227256fd8601166c3a35e45f409"
+checksum = "ade8e86c48285f138a4d6ca15a2912e39bd6c74d62db42da4f1985f651a0b057"
dependencies = [
- "ansi_term",
"atty",
+ "chrono",
"glob",
"lazy_static",
"log",
+ "nu-ansi-term",
"regex",
- "rustversion",
"thiserror",
- "time 0.3.9",
]
[[package]]
@@ -2741,7 +2713,7 @@
[[package]]
name = "fork-tree"
version = "3.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
]
@@ -2758,7 +2730,7 @@
[[package]]
name = "fp-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"parity-scale-codec 3.2.1",
@@ -2770,7 +2742,7 @@
[[package]]
name = "fp-ethereum"
version = "1.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"ethereum-types 0.14.1",
@@ -2785,7 +2757,7 @@
[[package]]
name = "fp-evm"
version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"evm",
"frame-support",
@@ -2799,7 +2771,7 @@
[[package]]
name = "fp-evm-mapping"
version = "0.1.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"frame-support",
"sp-core",
@@ -2808,7 +2780,7 @@
[[package]]
name = "fp-rpc"
version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"ethereum-types 0.14.1",
@@ -2825,12 +2797,11 @@
[[package]]
name = "fp-self-contained"
version = "1.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"frame-support",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"scale-info",
"serde",
"sp-runtime",
@@ -2839,7 +2810,7 @@
[[package]]
name = "fp-storage"
version = "2.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"parity-scale-codec 3.2.1",
"serde",
@@ -2854,7 +2825,7 @@
[[package]]
name = "frame-benchmarking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -2877,10 +2848,10 @@
[[package]]
name = "frame-benchmarking-cli"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"Inflector",
- "array-bytes",
+ "array-bytes 4.2.0",
"chrono",
"clap",
"comfy-table",
@@ -2929,7 +2900,7 @@
[[package]]
name = "frame-election-provider-solution-type"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -2940,7 +2911,7 @@
[[package]]
name = "frame-election-provider-support"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-election-provider-solution-type",
"frame-support",
@@ -2948,6 +2919,7 @@
"parity-scale-codec 3.2.1",
"scale-info",
"sp-arithmetic",
+ "sp-core",
"sp-npos-elections",
"sp-runtime",
"sp-std",
@@ -2956,7 +2928,7 @@
[[package]]
name = "frame-executive"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -2983,9 +2955,28 @@
]
[[package]]
+name = "frame-remote-externalities"
+version = "0.10.0-dev"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
+dependencies = [
+ "env_logger",
+ "futures 0.3.25",
+ "log",
+ "parity-scale-codec 3.2.1",
+ "serde",
+ "serde_json",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-version",
+ "substrate-rpc-client",
+ "tokio",
+]
+
+[[package]]
name = "frame-support"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"bitflags",
"frame-metadata",
@@ -3017,7 +3008,7 @@
[[package]]
name = "frame-support-procedural"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"Inflector",
"cfg-expr",
@@ -3031,7 +3022,7 @@
[[package]]
name = "frame-support-procedural-tools"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support-procedural-tools-derive",
"proc-macro-crate",
@@ -3043,7 +3034,7 @@
[[package]]
name = "frame-support-procedural-tools-derive"
version = "3.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro2",
"quote",
@@ -3053,7 +3044,7 @@
[[package]]
name = "frame-system"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"log",
@@ -3071,7 +3062,7 @@
[[package]]
name = "frame-system-benchmarking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -3086,7 +3077,7 @@
[[package]]
name = "frame-system-rpc-runtime-api"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"sp-api",
@@ -3095,7 +3086,7 @@
[[package]]
name = "frame-try-runtime"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"parity-scale-codec 3.2.1",
@@ -3351,6 +3342,12 @@
]
[[package]]
+name = "gimli"
+version = "0.27.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793"
+
+[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3413,9 +3410,9 @@
[[package]]
name = "handlebars"
-version = "4.3.5"
+version = "4.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd"
+checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a"
dependencies = [
"log",
"pest",
@@ -3559,6 +3556,12 @@
]
[[package]]
+name = "http-range-header"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29"
+
+[[package]]
name = "httparse"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3602,9 +3605,9 @@
[[package]]
name = "hyper-rustls"
-version = "0.23.1"
+version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d"
+checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
dependencies = [
"http",
"hyper",
@@ -3797,15 +3800,15 @@
[[package]]
name = "ipnet"
-version = "2.5.1"
+version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745"
+checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
[[package]]
name = "is-terminal"
-version = "0.4.1"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330"
+checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
dependencies = [
"hermit-abi 0.2.6",
"io-lifetimes 1.0.3",
@@ -3824,9 +3827,9 @@
[[package]]
name = "itoa"
-version = "1.0.4"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
+checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
[[package]]
name = "jobserver"
@@ -3848,24 +3851,23 @@
[[package]]
name = "jsonrpsee"
-version = "0.15.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a"
+checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e"
dependencies = [
"jsonrpsee-core",
- "jsonrpsee-http-server",
"jsonrpsee-proc-macros",
+ "jsonrpsee-server",
"jsonrpsee-types",
"jsonrpsee-ws-client",
- "jsonrpsee-ws-server",
"tracing",
]
[[package]]
name = "jsonrpsee-client-transport"
-version = "0.15.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74"
+checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb"
dependencies = [
"futures-util",
"http",
@@ -3884,9 +3886,9 @@
[[package]]
name = "jsonrpsee-core"
-version = "0.15.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca"
+checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b"
dependencies = [
"anyhow",
"arrayvec 0.7.2",
@@ -3897,10 +3899,8 @@
"futures-timer",
"futures-util",
"globset",
- "http",
"hyper",
"jsonrpsee-types",
- "lazy_static",
"parking_lot 0.12.1",
"rand 0.8.5",
"rustc-hash",
@@ -3910,45 +3910,48 @@
"thiserror",
"tokio",
"tracing",
- "tracing-futures",
- "unicase",
]
[[package]]
-name = "jsonrpsee-http-server"
-version = "0.15.1"
+name = "jsonrpsee-proc-macros"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03802f0373a38c2420c70b5144742d800b509e2937edc4afb116434f07120117"
+checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c"
dependencies = [
+ "heck",
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "jsonrpsee-server"
+version = "0.16.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc"
+dependencies = [
"futures-channel",
"futures-util",
+ "http",
"hyper",
"jsonrpsee-core",
"jsonrpsee-types",
"serde",
"serde_json",
+ "soketto",
"tokio",
+ "tokio-stream",
+ "tokio-util",
+ "tower",
"tracing",
- "tracing-futures",
]
[[package]]
-name = "jsonrpsee-proc-macros"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "jsonrpsee-types"
-version = "0.15.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d"
+checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c"
dependencies = [
"anyhow",
"beef",
@@ -3960,34 +3963,14 @@
[[package]]
name = "jsonrpsee-ws-client"
-version = "0.15.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ee5feddd5188e62ac08fcf0e56478138e581509d4730f3f7be9b57dd402a4ff"
+checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9"
dependencies = [
"http",
"jsonrpsee-client-transport",
- "jsonrpsee-core",
- "jsonrpsee-types",
-]
-
-[[package]]
-name = "jsonrpsee-ws-server"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d488ba74fb369e5ab68926feb75a483458b88e768d44319f37e4ecad283c7325"
-dependencies = [
- "futures-channel",
- "futures-util",
- "http",
"jsonrpsee-core",
"jsonrpsee-types",
- "serde_json",
- "soketto",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "tracing-futures",
]
[[package]]
@@ -4013,10 +3996,9 @@
[[package]]
name = "kusama-runtime"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
"bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
@@ -4043,13 +4025,13 @@
"pallet-election-provider-support-benchmarking",
"pallet-elections-phragmen",
"pallet-fast-unstake",
- "pallet-gilt",
"pallet-grandpa",
"pallet-identity",
"pallet-im-online",
"pallet-indices",
"pallet-membership",
"pallet-multisig",
+ "pallet-nis",
"pallet-nomination-pools",
"pallet-nomination-pools-benchmarking",
"pallet-nomination-pools-runtime-api",
@@ -4087,6 +4069,7 @@
"sp-api",
"sp-arithmetic",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-consensus-babe",
"sp-core",
@@ -4110,8 +4093,8 @@
[[package]]
name = "kusama-runtime-constants"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"polkadot-primitives",
@@ -4133,35 +4116,31 @@
[[package]]
name = "kvdb"
-version = "0.12.0"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b"
+checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9"
dependencies = [
- "parity-util-mem",
"smallvec",
]
[[package]]
name = "kvdb-memorydb"
-version = "0.12.0"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873"
+checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2"
dependencies = [
"kvdb",
- "parity-util-mem",
"parking_lot 0.12.1",
]
[[package]]
name = "kvdb-rocksdb"
-version = "0.16.0"
+version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597"
+checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844"
dependencies = [
"kvdb",
- "log",
"num_cpus",
- "parity-util-mem",
"parking_lot 0.12.1",
"regex",
"rocksdb",
@@ -4182,9 +4161,9 @@
[[package]]
name = "libc"
-version = "0.2.138"
+version = "0.2.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
+checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
[[package]]
name = "libloading"
@@ -4198,6 +4177,12 @@
[[package]]
name = "libm"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
+
+[[package]]
+name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
@@ -4275,7 +4260,6 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720"
dependencies = [
- "async-std-resolver",
"futures 0.3.25",
"libp2p-core",
"log",
@@ -4339,7 +4323,6 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "761704e727f7d68d58d7bc2231eafae5fc1b9814de24290f126df09d4bd37a15"
dependencies = [
- "async-io",
"data-encoding",
"dns-parser",
"futures 0.3.25",
@@ -4350,6 +4333,7 @@
"rand 0.8.5",
"smallvec",
"socket2",
+ "tokio",
"void",
]
@@ -4478,7 +4462,6 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92"
dependencies = [
- "async-io",
"futures 0.3.25",
"futures-timer",
"if-watch",
@@ -4486,6 +4469,7 @@
"libp2p-core",
"log",
"socket2",
+ "tokio",
]
[[package]]
@@ -4611,9 +4595,9 @@
[[package]]
name = "link-cplusplus"
-version = "1.0.7"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369"
+checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5"
dependencies = [
"cc",
]
@@ -4651,9 +4635,9 @@
[[package]]
name = "linux-raw-sys"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
+checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
[[package]]
name = "lock_api"
@@ -4806,22 +4790,12 @@
[[package]]
name = "memory-db"
-version = "0.30.0"
+version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269"
+checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66"
dependencies = [
"hash-db",
"hashbrown",
- "parity-util-mem",
-]
-
-[[package]]
-name = "memory-lru"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce95ae042940bad7e312857b929ee3d11b8f799a80cb7b9c7ec5125516906395"
-dependencies = [
- "lru",
]
[[package]]
@@ -4861,15 +4835,6 @@
[[package]]
name = "miniz_oxide"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "miniz_oxide"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
@@ -4890,6 +4855,42 @@
]
[[package]]
+name = "mmr-gadget"
+version = "4.0.0-dev"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
+dependencies = [
+ "futures 0.3.25",
+ "log",
+ "parity-scale-codec 3.2.1",
+ "sc-client-api",
+ "sc-offchain",
+ "sp-api",
+ "sp-beefy",
+ "sp-blockchain",
+ "sp-consensus",
+ "sp-core",
+ "sp-io",
+ "sp-mmr-primitives",
+ "sp-runtime",
+]
+
+[[package]]
+name = "mmr-rpc"
+version = "4.0.0-dev"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
+dependencies = [
+ "anyhow",
+ "jsonrpsee",
+ "parity-scale-codec 3.2.1",
+ "serde",
+ "sp-api",
+ "sp-blockchain",
+ "sp-core",
+ "sp-mmr-primitives",
+ "sp-runtime",
+]
+
+[[package]]
name = "mockall"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5116,12 +5117,6 @@
"cfg-if",
"libc",
]
-
-[[package]]
-name = "nodrop"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
[[package]]
name = "nohash-hasher"
@@ -5146,6 +5141,16 @@
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
[[package]]
+name = "nu-ansi-term"
+version = "0.46.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
+dependencies = [
+ "overload",
+ "winapi",
+]
+
+[[package]]
name = "num-bigint"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5204,16 +5209,16 @@
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
- "libm",
+ "libm 0.2.6",
]
[[package]]
name = "num_cpus"
-version = "1.14.0"
+version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
+checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [
- "hermit-abi 0.1.19",
+ "hermit-abi 0.2.6",
"libc",
]
@@ -5239,23 +5244,23 @@
]
[[package]]
-name = "num_threads"
-version = "0.1.6"
+name = "object"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
+checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
dependencies = [
- "libc",
+ "crc32fast",
+ "hashbrown",
+ "indexmap",
+ "memchr",
]
[[package]]
name = "object"
-version = "0.29.0"
+version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
+checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb"
dependencies = [
- "crc32fast",
- "hashbrown",
- "indexmap",
"memchr",
]
@@ -5267,7 +5272,7 @@
[[package]]
name = "opal-runtime"
-version = "0.9.33"
+version = "0.9.36"
dependencies = [
"app-promotion-rpc",
"cumulus-pallet-aura-ext",
@@ -5426,7 +5431,7 @@
[[package]]
name = "orml-tokens"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
"frame-system",
@@ -5441,7 +5446,7 @@
[[package]]
name = "orml-traits"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
"impl-trait-for-tuples",
@@ -5459,7 +5464,7 @@
[[package]]
name = "orml-utilities"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
"parity-scale-codec 3.2.1",
@@ -5473,7 +5478,7 @@
[[package]]
name = "orml-vesting"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
"frame-system",
@@ -5488,7 +5493,7 @@
[[package]]
name = "orml-xcm-support"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"frame-support",
"orml-traits",
@@ -5502,7 +5507,7 @@
[[package]]
name = "orml-xtokens"
version = "0.4.1-dev"
-source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.33#0256c9e9365cebd297e8b0c9f639d068c24b5af0"
+source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=feature/polkadot-v0.9.36#3f70b9adb6c0599db7b8688abb49d0d459634b68"
dependencies = [
"cumulus-primitives-core",
"frame-support",
@@ -5527,9 +5532,25 @@
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
[[package]]
-name = "pallet-app-promotion"
+name = "overload"
version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
+
+[[package]]
+name = "packed_simd_2"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282"
dependencies = [
+ "cfg-if",
+ "libm 0.1.4",
+]
+
+[[package]]
+name = "pallet-app-promotion"
+version = "0.1.2"
+dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -5555,7 +5576,7 @@
[[package]]
name = "pallet-aura"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -5571,7 +5592,7 @@
[[package]]
name = "pallet-authority-discovery"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -5587,7 +5608,7 @@
[[package]]
name = "pallet-authorship"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -5602,7 +5623,7 @@
[[package]]
name = "pallet-babe"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5626,7 +5647,7 @@
[[package]]
name = "pallet-bags-list"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -5646,7 +5667,7 @@
[[package]]
name = "pallet-balances"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5661,7 +5682,7 @@
[[package]]
name = "pallet-base-fee"
version = "1.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"fp-evm",
"frame-support",
@@ -5676,15 +5697,15 @@
[[package]]
name = "pallet-beefy"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "beefy-primitives",
"frame-support",
"frame-system",
"pallet-session",
"parity-scale-codec 3.2.1",
"scale-info",
"serde",
+ "sp-beefy",
"sp-runtime",
"sp-std",
]
@@ -5692,11 +5713,10 @@
[[package]]
name = "pallet-beefy-mmr"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"beefy-merkle-tree",
- "beefy-primitives",
"frame-support",
"frame-system",
"log",
@@ -5706,6 +5726,7 @@
"parity-scale-codec 3.2.1",
"scale-info",
"serde",
+ "sp-beefy",
"sp-core",
"sp-io",
"sp-runtime",
@@ -5715,7 +5736,7 @@
[[package]]
name = "pallet-bounties"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5733,7 +5754,7 @@
[[package]]
name = "pallet-child-bounties"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5752,7 +5773,7 @@
[[package]]
name = "pallet-collective"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5807,7 +5828,7 @@
[[package]]
name = "pallet-conviction-voting"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"assert_matches",
"frame-benchmarking",
@@ -5824,7 +5845,7 @@
[[package]]
name = "pallet-democracy"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5842,7 +5863,7 @@
[[package]]
name = "pallet-election-provider-multi-phase"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -5866,7 +5887,7 @@
[[package]]
name = "pallet-election-provider-support-benchmarking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -5879,7 +5900,7 @@
[[package]]
name = "pallet-elections-phragmen"
version = "5.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -5897,7 +5918,7 @@
[[package]]
name = "pallet-ethereum"
version = "4.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"ethereum 0.14.0",
"ethereum-types 0.14.1",
@@ -5925,7 +5946,7 @@
[[package]]
name = "pallet-evm"
version = "6.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"environmental",
"evm",
@@ -6011,7 +6032,7 @@
[[package]]
name = "pallet-evm-precompile-simple"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.33#c37ced433a29baad45899d6ab364fe437f97570e"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.36#db60b911813df1d82e60e0de7f3dfa290e60d2f0"
dependencies = [
"fp-evm",
"ripemd",
@@ -6040,7 +6061,7 @@
[[package]]
name = "pallet-fast-unstake"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -6102,27 +6123,12 @@
"sp-runtime",
"sp-std",
"up-data-structs",
-]
-
-[[package]]
-name = "pallet-gilt"
-version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
-dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
- "parity-scale-codec 3.2.1",
- "scale-info",
- "sp-arithmetic",
- "sp-runtime",
- "sp-std",
]
[[package]]
name = "pallet-grandpa"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6145,7 +6151,7 @@
[[package]]
name = "pallet-identity"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"enumflags2",
"frame-benchmarking",
@@ -6161,7 +6167,7 @@
[[package]]
name = "pallet-im-online"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6181,7 +6187,7 @@
[[package]]
name = "pallet-indices"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6229,7 +6235,7 @@
[[package]]
name = "pallet-membership"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6246,9 +6252,8 @@
[[package]]
name = "pallet-mmr"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "ckb-merkle-mountain-range",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -6262,33 +6267,33 @@
]
[[package]]
-name = "pallet-mmr-rpc"
-version = "3.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+name = "pallet-multisig"
+version = "4.0.0-dev"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "anyhow",
- "jsonrpsee",
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "log",
"parity-scale-codec 3.2.1",
- "serde",
- "sp-api",
- "sp-blockchain",
- "sp-core",
- "sp-mmr-primitives",
+ "scale-info",
+ "sp-io",
"sp-runtime",
+ "sp-std",
]
[[package]]
-name = "pallet-multisig"
+name = "pallet-nis"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "log",
"parity-scale-codec 3.2.1",
"scale-info",
- "sp-io",
+ "sp-arithmetic",
+ "sp-core",
"sp-runtime",
"sp-std",
]
@@ -6296,7 +6301,7 @@
[[package]]
name = "pallet-nomination-pools"
version = "1.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6313,7 +6318,7 @@
[[package]]
name = "pallet-nomination-pools-benchmarking"
version = "1.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -6333,7 +6338,7 @@
[[package]]
name = "pallet-nomination-pools-runtime-api"
version = "1.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"sp-api",
@@ -6365,7 +6370,7 @@
[[package]]
name = "pallet-offences"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6382,7 +6387,7 @@
[[package]]
name = "pallet-offences-benchmarking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -6405,7 +6410,7 @@
[[package]]
name = "pallet-preimage"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6422,7 +6427,7 @@
[[package]]
name = "pallet-proxy"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6437,7 +6442,7 @@
[[package]]
name = "pallet-randomness-collective-flip"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6451,7 +6456,7 @@
[[package]]
name = "pallet-ranked-collective"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6469,7 +6474,7 @@
[[package]]
name = "pallet-recovery"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6484,12 +6489,13 @@
[[package]]
name = "pallet-referenda"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"assert_matches",
"frame-benchmarking",
"frame-support",
"frame-system",
+ "log",
"parity-scale-codec 3.2.1",
"scale-info",
"serde",
@@ -6566,7 +6572,7 @@
[[package]]
name = "pallet-scheduler"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6577,12 +6583,13 @@
"sp-io",
"sp-runtime",
"sp-std",
+ "sp-weights",
]
[[package]]
name = "pallet-session"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6603,7 +6610,7 @@
[[package]]
name = "pallet-session-benchmarking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6619,7 +6626,7 @@
[[package]]
name = "pallet-society"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6633,7 +6640,7 @@
[[package]]
name = "pallet-staking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
@@ -6656,7 +6663,7 @@
[[package]]
name = "pallet-staking-reward-curve"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -6667,7 +6674,7 @@
[[package]]
name = "pallet-staking-reward-fn"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
"sp-arithmetic",
@@ -6676,7 +6683,7 @@
[[package]]
name = "pallet-state-trie-migration"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6708,7 +6715,7 @@
[[package]]
name = "pallet-sudo"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6722,7 +6729,7 @@
[[package]]
name = "pallet-template-transaction-payment"
version = "3.0.0"
-source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.33#994d4a8dc6cc630b73d19f97315272a8795317e7"
+source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.36#55943b982e9b0b80465885f31f76db3dba91dac4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6754,7 +6761,7 @@
[[package]]
name = "pallet-timestamp"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6772,7 +6779,7 @@
[[package]]
name = "pallet-tips"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6791,7 +6798,7 @@
[[package]]
name = "pallet-transaction-payment"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-support",
"frame-system",
@@ -6807,7 +6814,7 @@
[[package]]
name = "pallet-transaction-payment-rpc"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"jsonrpsee",
"pallet-transaction-payment-rpc-runtime-api",
@@ -6823,7 +6830,7 @@
[[package]]
name = "pallet-transaction-payment-rpc-runtime-api"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"pallet-transaction-payment",
"parity-scale-codec 3.2.1",
@@ -6835,7 +6842,7 @@
[[package]]
name = "pallet-treasury"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6894,7 +6901,7 @@
[[package]]
name = "pallet-utility"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6910,7 +6917,7 @@
[[package]]
name = "pallet-vesting"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6925,7 +6932,7 @@
[[package]]
name = "pallet-whitelist"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6939,8 +6946,8 @@
[[package]]
name = "pallet-xcm"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"frame-system",
@@ -6957,8 +6964,8 @@
[[package]]
name = "pallet-xcm-benchmarks"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -6975,32 +6982,13 @@
[[package]]
name = "parachain-info"
version = "0.1.0"
-source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.33#27721d794ee63aae42317a7eeda21595dd3200d9"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.36#a4e825c9500acab6cc3deccffea7b01350f12ed1"
dependencies = [
"cumulus-primitives-core",
"frame-support",
"frame-system",
"parity-scale-codec 3.2.1",
"scale-info",
-]
-
-[[package]]
-name = "parity-db"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c8fdb726a43661fa54b43e7114e6b88b2289cae388eb3ad766d9d1754d83fce"
-dependencies = [
- "blake2-rfc",
- "crc32fast",
- "fs2",
- "hex",
- "libc",
- "log",
- "lz4",
- "memmap2",
- "parking_lot 0.12.1",
- "rand 0.8.5",
- "snap",
]
[[package]]
@@ -7082,35 +7070,6 @@
checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f"
[[package]]
-name = "parity-util-mem"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8"
-dependencies = [
- "cfg-if",
- "ethereum-types 0.14.1",
- "hashbrown",
- "impl-trait-for-tuples",
- "lru",
- "parity-util-mem-derive",
- "parking_lot 0.12.1",
- "primitive-types 0.12.1",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "parity-util-mem-derive"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2"
-dependencies = [
- "proc-macro2",
- "syn",
- "synstructure",
-]
-
-[[package]]
name = "parity-wasm"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -7130,7 +7089,7 @@
dependencies = [
"instant",
"lock_api",
- "parking_lot_core 0.8.5",
+ "parking_lot_core 0.8.6",
]
[[package]]
@@ -7145,9 +7104,9 @@
[[package]]
name = "parking_lot_core"
-version = "0.8.5"
+version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
+checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
dependencies = [
"cfg-if",
"instant",
@@ -7172,9 +7131,9 @@
[[package]]
name = "paste"
-version = "1.0.9"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1"
+checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
[[package]]
name = "pbkdf2"
@@ -7321,9 +7280,15 @@
checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94"
[[package]]
+name = "platforms"
+version = "3.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630"
+
+[[package]]
name = "polkadot-approval-distribution"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"polkadot-node-network-protocol",
@@ -7337,8 +7302,8 @@
[[package]]
name = "polkadot-availability-bitfield-distribution"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"polkadot-node-network-protocol",
@@ -7351,8 +7316,8 @@
[[package]]
name = "polkadot-availability-distribution"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"derive_more",
"fatality",
@@ -7374,8 +7339,8 @@
[[package]]
name = "polkadot-availability-recovery"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"fatality",
"futures 0.3.25",
@@ -7395,8 +7360,8 @@
[[package]]
name = "polkadot-cli"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"clap",
"frame-benchmarking-cli",
@@ -7408,12 +7373,13 @@
"polkadot-performance-test",
"polkadot-service",
"sc-cli",
+ "sc-executor",
"sc-service",
"sc-sysinfo",
"sc-tracing",
"sp-core",
+ "sp-io",
"sp-keyring",
- "sp-trie",
"substrate-build-script-utils",
"thiserror",
"try-runtime-cli",
@@ -7421,14 +7387,15 @@
[[package]]
name = "polkadot-client"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
+ "async-trait",
"frame-benchmarking",
"frame-benchmarking-cli",
"frame-system",
"frame-system-rpc-runtime-api",
+ "futures 0.3.25",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"polkadot-core-primitives",
@@ -7442,6 +7409,7 @@
"sc-service",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
@@ -7461,8 +7429,8 @@
[[package]]
name = "polkadot-collator-protocol"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"always-assert",
"bitvec 1.0.1",
@@ -7483,11 +7451,10 @@
[[package]]
name = "polkadot-core-primitives"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"scale-info",
"sp-core",
"sp-runtime",
@@ -7496,8 +7463,8 @@
[[package]]
name = "polkadot-dispute-distribution"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"derive_more",
"fatality",
@@ -7521,8 +7488,8 @@
[[package]]
name = "polkadot-erasure-coding"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"parity-scale-codec 3.2.1",
"polkadot-node-primitives",
@@ -7535,8 +7502,8 @@
[[package]]
name = "polkadot-gossip-support"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"futures-timer",
@@ -7555,8 +7522,8 @@
[[package]]
name = "polkadot-network-bridge"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"always-assert",
"async-trait",
@@ -7579,8 +7546,8 @@
[[package]]
name = "polkadot-node-collation-generation"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"parity-scale-codec 3.2.1",
@@ -7597,8 +7564,8 @@
[[package]]
name = "polkadot-node-core-approval-voting"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitvec 1.0.1",
"derive_more",
@@ -7626,8 +7593,8 @@
[[package]]
name = "polkadot-node-core-av-store"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitvec 1.0.1",
"futures 0.3.25",
@@ -7646,8 +7613,8 @@
[[package]]
name = "polkadot-node-core-backing"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitvec 1.0.1",
"fatality",
@@ -7665,8 +7632,8 @@
[[package]]
name = "polkadot-node-core-bitfield-signing"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"polkadot-node-subsystem",
@@ -7680,8 +7647,8 @@
[[package]]
name = "polkadot-node-core-candidate-validation"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -7699,8 +7666,8 @@
[[package]]
name = "polkadot-node-core-chain-api"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"polkadot-node-subsystem",
@@ -7714,8 +7681,8 @@
[[package]]
name = "polkadot-node-core-chain-selection"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"futures-timer",
@@ -7731,8 +7698,8 @@
[[package]]
name = "polkadot-node-core-dispute-coordinator"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"fatality",
"futures 0.3.25",
@@ -7750,13 +7717,14 @@
[[package]]
name = "polkadot-node-core-parachains-inherent"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"futures 0.3.25",
"futures-timer",
"polkadot-node-subsystem",
+ "polkadot-overseer",
"polkadot-primitives",
"sp-blockchain",
"sp-inherents",
@@ -7767,8 +7735,8 @@
[[package]]
name = "polkadot-node-core-provisioner"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitvec 1.0.1",
"fatality",
@@ -7785,13 +7753,14 @@
[[package]]
name = "polkadot-node-core-pvf"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"always-assert",
"assert_matches",
"async-process",
"async-std",
+ "cpu-time",
"futures 0.3.25",
"futures-timer",
"parity-scale-codec 3.2.1",
@@ -7817,8 +7786,8 @@
[[package]]
name = "polkadot-node-core-pvf-checker"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
"polkadot-node-primitives",
@@ -7833,12 +7802,11 @@
[[package]]
name = "polkadot-node-core-runtime-api"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"futures 0.3.25",
- "memory-lru",
- "parity-util-mem",
+ "lru",
"polkadot-node-subsystem",
"polkadot-node-subsystem-types",
"polkadot-node-subsystem-util",
@@ -7849,10 +7817,9 @@
[[package]]
name = "polkadot-node-jaeger"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "async-std",
"lazy_static",
"log",
"mick-jaeger",
@@ -7863,12 +7830,13 @@
"sc-network",
"sp-core",
"thiserror",
+ "tokio",
]
[[package]]
name = "polkadot-node-metrics"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bs58",
"futures 0.3.25",
@@ -7886,8 +7854,8 @@
[[package]]
name = "polkadot-node-network-protocol"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"derive_more",
@@ -7909,8 +7877,8 @@
[[package]]
name = "polkadot-node-primitives"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bounded-vec",
"futures 0.3.25",
@@ -7931,8 +7899,8 @@
[[package]]
name = "polkadot-node-subsystem"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"polkadot-node-jaeger",
"polkadot-node-subsystem-types",
@@ -7941,8 +7909,8 @@
[[package]]
name = "polkadot-node-subsystem-types"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"derive_more",
@@ -7964,8 +7932,8 @@
[[package]]
name = "polkadot-node-subsystem-util"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"derive_more",
@@ -7974,9 +7942,8 @@
"itertools",
"kvdb",
"lru",
- "parity-db 0.4.2",
+ "parity-db",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"parking_lot 0.11.2",
"pin-project",
"polkadot-node-jaeger",
@@ -7997,15 +7964,14 @@
[[package]]
name = "polkadot-overseer"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"futures 0.3.25",
"futures-timer",
"lru",
"orchestra",
- "parity-util-mem",
"parking_lot 0.12.1",
"polkadot-node-metrics",
"polkadot-node-network-protocol",
@@ -8015,18 +7981,18 @@
"sc-client-api",
"sp-api",
"sp-core",
+ "tikv-jemalloc-ctl",
"tracing-gum",
]
[[package]]
name = "polkadot-parachain"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"derive_more",
"frame-support",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"polkadot-core-primitives",
"scale-info",
"serde",
@@ -8037,8 +8003,8 @@
[[package]]
name = "polkadot-performance-test"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"env_logger",
"kusama-runtime",
@@ -8052,13 +8018,12 @@
[[package]]
name = "polkadot-primitives"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitvec 1.0.1",
"hex-literal",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"polkadot-core-primitives",
"polkadot-parachain",
"scale-info",
@@ -8079,13 +8044,13 @@
[[package]]
name = "polkadot-rpc"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"beefy-gadget",
"beefy-gadget-rpc",
"jsonrpsee",
- "pallet-mmr-rpc",
+ "mmr-rpc",
"pallet-transaction-payment-rpc",
"polkadot-primitives",
"sc-chain-spec",
@@ -8111,10 +8076,9 @@
[[package]]
name = "polkadot-runtime"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
"bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
@@ -8177,6 +8141,7 @@
"smallvec",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-consensus-babe",
"sp-core",
@@ -8200,10 +8165,9 @@
[[package]]
name = "polkadot-runtime-common"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
"bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
@@ -8234,6 +8198,7 @@
"serde_derive",
"slot-range-helper",
"sp-api",
+ "sp-beefy",
"sp-core",
"sp-inherents",
"sp-io",
@@ -8248,8 +8213,8 @@
[[package]]
name = "polkadot-runtime-constants"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"polkadot-primitives",
@@ -8262,8 +8227,8 @@
[[package]]
name = "polkadot-runtime-metrics"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bs58",
"parity-scale-codec 3.2.1",
@@ -8274,8 +8239,8 @@
[[package]]
name = "polkadot-runtime-parachains"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"bitflags",
"bitvec 1.0.1",
@@ -8317,12 +8282,11 @@
[[package]]
name = "polkadot-service"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"async-trait",
"beefy-gadget",
- "beefy-primitives",
"frame-support",
"frame-system-rpc-runtime-api",
"futures 0.3.25",
@@ -8331,11 +8295,12 @@
"kvdb",
"kvdb-rocksdb",
"lru",
+ "mmr-gadget",
"pallet-babe",
"pallet-im-online",
"pallet-staking",
"pallet-transaction-payment-rpc-runtime-api",
- "parity-db 0.4.2",
+ "parity-db",
"polkadot-approval-distribution",
"polkadot-availability-bitfield-distribution",
"polkadot-availability-distribution",
@@ -8396,6 +8361,7 @@
"serde_json",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
@@ -8405,6 +8371,7 @@
"sp-inherents",
"sp-io",
"sp-keystore",
+ "sp-mmr-primitives",
"sp-offchain",
"sp-runtime",
"sp-session",
@@ -8421,8 +8388,8 @@
[[package]]
name = "polkadot-statement-distribution"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"arrayvec 0.5.2",
"fatality",
@@ -8442,8 +8409,8 @@
[[package]]
name = "polkadot-statement-table"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"parity-scale-codec 3.2.1",
"polkadot-primitives",
@@ -8452,10 +8419,9 @@
[[package]]
name = "polkadot-test-runtime"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
"bitvec 1.0.1",
"frame-election-provider-support",
"frame-executive",
@@ -8491,6 +8457,7 @@
"smallvec",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-consensus-babe",
"sp-core",
@@ -8513,8 +8480,8 @@
[[package]]
name = "polkadot-test-service"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-benchmarking",
"frame-system",
@@ -8567,9 +8534,9 @@
[[package]]
name = "polling"
-version = "2.5.1"
+version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748"
+checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6"
dependencies = [
"autocfg",
"cfg-if",
@@ -8651,9 +8618,9 @@
[[package]]
name = "prettyplease"
-version = "0.1.21"
+version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51"
+checksum = "2c8992a85d8e93a28bdf76137db888d3874e3b230dee5ed8bebac4c9f7617773"
dependencies = [
"proc-macro2",
"syn",
@@ -8739,9 +8706,9 @@
[[package]]
name = "proc-macro2"
-version = "1.0.47"
+version = "1.0.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
+checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
dependencies = [
"unicode-ident",
]
@@ -8785,9 +8752,9 @@
[[package]]
name = "prost"
-version = "0.11.3"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0b18e655c21ff5ac2084a5ad0611e827b3f92badf79f4910b5a5c58f4d87ff0"
+checksum = "c01db6702aa05baa3f57dec92b8eeeeb4cb19e894e73996b32a4093289e54592"
dependencies = [
"bytes",
"prost-derive",
@@ -8795,9 +8762,9 @@
[[package]]
name = "prost-build"
-version = "0.11.3"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e330bf1316db56b12c2bcfa399e8edddd4821965ea25ddb2c134b610b1c1c604"
+checksum = "cb5320c680de74ba083512704acb90fe00f28f79207286a848e730c45dd73ed6"
dependencies = [
"bytes",
"heck",
@@ -8830,9 +8797,9 @@
[[package]]
name = "prost-derive"
-version = "0.11.2"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306"
+checksum = "c8842bad1a5419bca14eac663ba798f6bc19c413c2fdceb5f3ba3b0932d96720"
dependencies = [
"anyhow",
"itertools",
@@ -8843,9 +8810,9 @@
[[package]]
name = "prost-types"
-version = "0.11.2"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a"
+checksum = "017f79637768cde62820bc2d4fe0e45daaa027755c323ad077767c6c5f173091"
dependencies = [
"bytes",
"prost",
@@ -8862,7 +8829,7 @@
[[package]]
name = "quartz-runtime"
-version = "0.9.33"
+version = "0.9.36"
dependencies = [
"app-promotion-rpc",
"cumulus-pallet-aura-ext",
@@ -8976,9 +8943,9 @@
[[package]]
name = "quote"
-version = "1.0.21"
+version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
+checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
dependencies = [
"proc-macro2",
]
@@ -9103,11 +9070,10 @@
[[package]]
name = "rayon"
-version = "1.6.0"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b"
+checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7"
dependencies = [
- "crossbeam-deque",
"either",
"rayon-core",
]
@@ -9159,18 +9125,18 @@
[[package]]
name = "ref-cast"
-version = "1.0.13"
+version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53b15debb4f9d60d767cd8ca9ef7abb2452922f3214671ff052defc7f3502c44"
+checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed"
dependencies = [
"ref-cast-impl",
]
[[package]]
name = "ref-cast-impl"
-version = "1.0.13"
+version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abfa8511e9e94fd3de6585a3d3cd00e01ed556dc9814829280af0e8dc72a8f36"
+checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f"
dependencies = [
"proc-macro2",
"quote",
@@ -9216,23 +9182,6 @@
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
[[package]]
-name = "remote-externalities"
-version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
-dependencies = [
- "env_logger",
- "log",
- "parity-scale-codec 3.2.1",
- "serde",
- "serde_json",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-version",
- "substrate-rpc-client",
-]
-
-[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -9342,11 +9291,10 @@
[[package]]
name = "rococo-runtime"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"beefy-merkle-tree",
- "beefy-primitives",
"frame-benchmarking",
"frame-executive",
"frame-support",
@@ -9366,7 +9314,6 @@
"pallet-collective",
"pallet-democracy",
"pallet-elections-phragmen",
- "pallet-gilt",
"pallet-grandpa",
"pallet-identity",
"pallet-im-online",
@@ -9374,6 +9321,7 @@
"pallet-membership",
"pallet-mmr",
"pallet-multisig",
+ "pallet-nis",
"pallet-offences",
"pallet-preimage",
"pallet-proxy",
@@ -9405,6 +9353,7 @@
"smallvec",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-consensus-babe",
"sp-core",
@@ -9427,8 +9376,8 @@
[[package]]
name = "rococo-runtime-constants"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"polkadot-primitives",
@@ -9508,7 +9457,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
- "semver 1.0.14",
+ "semver 1.0.16",
]
[[package]]
@@ -9535,7 +9484,7 @@
"errno",
"io-lifetimes 1.0.3",
"libc",
- "linux-raw-sys 0.1.3",
+ "linux-raw-sys 0.1.4",
"windows-sys 0.42.0",
]
@@ -9574,9 +9523,9 @@
[[package]]
name = "rustversion"
-version = "1.0.9"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"
+checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70"
[[package]]
name = "rw-stream-sink"
@@ -9591,9 +9540,9 @@
[[package]]
name = "ryu"
-version = "1.0.11"
+version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
+checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
[[package]]
name = "safe-mix"
@@ -9616,7 +9565,7 @@
[[package]]
name = "sc-allocator"
version = "4.1.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
"sp-core",
@@ -9627,7 +9576,7 @@
[[package]]
name = "sc-authority-discovery"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -9654,7 +9603,7 @@
[[package]]
name = "sc-basic-authorship"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"futures-timer",
@@ -9677,7 +9626,7 @@
[[package]]
name = "sc-block-builder"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"sc-client-api",
@@ -9693,7 +9642,7 @@
[[package]]
name = "sc-chain-spec"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-trait-for-tuples",
"memmap2",
@@ -9710,7 +9659,7 @@
[[package]]
name = "sc-chain-spec-derive"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -9721,9 +9670,9 @@
[[package]]
name = "sc-cli"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"chrono",
"clap",
"fdlimit",
@@ -9761,7 +9710,7 @@
[[package]]
name = "sc-client-api"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"fnv",
"futures 0.3.25",
@@ -9789,7 +9738,7 @@
[[package]]
name = "sc-client-db"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"hash-db",
"kvdb",
@@ -9797,7 +9746,7 @@
"kvdb-rocksdb",
"linked-hash-map",
"log",
- "parity-db 0.4.2",
+ "parity-db",
"parity-scale-codec 3.2.1",
"parking_lot 0.12.1",
"sc-client-api",
@@ -9814,13 +9763,14 @@
[[package]]
name = "sc-consensus"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
"futures-timer",
"libp2p",
"log",
+ "mockall",
"parking_lot 0.12.1",
"sc-client-api",
"sc-utils",
@@ -9838,7 +9788,7 @@
[[package]]
name = "sc-consensus-aura"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -9867,7 +9817,7 @@
[[package]]
name = "sc-consensus-babe"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"fork-tree",
@@ -9908,7 +9858,7 @@
[[package]]
name = "sc-consensus-babe-rpc"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"jsonrpsee",
@@ -9930,7 +9880,7 @@
[[package]]
name = "sc-consensus-epochs"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"fork-tree",
"parity-scale-codec 3.2.1",
@@ -9943,7 +9893,7 @@
[[package]]
name = "sc-consensus-manual-seal"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"assert_matches",
"async-trait",
@@ -9977,7 +9927,7 @@
[[package]]
name = "sc-consensus-slots"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -10001,9 +9951,8 @@
[[package]]
name = "sc-executor"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "lazy_static",
"lru",
"parity-scale-codec 3.2.1",
"parking_lot 0.12.1",
@@ -10012,7 +9961,6 @@
"sc-executor-wasmtime",
"sp-api",
"sp-core",
- "sp-core-hashing-proc-macro",
"sp-externalities",
"sp-io",
"sp-panic-handler",
@@ -10027,13 +9975,10 @@
[[package]]
name = "sc-executor-common"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "environmental",
- "parity-scale-codec 3.2.1",
"sc-allocator",
"sp-maybe-compressed-blob",
- "sp-sandbox",
"sp-wasm-interface",
"thiserror",
"wasm-instrument",
@@ -10043,14 +9988,12 @@
[[package]]
name = "sc-executor-wasmi"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
- "parity-scale-codec 3.2.1",
"sc-allocator",
"sc-executor-common",
"sp-runtime-interface",
- "sp-sandbox",
"sp-wasm-interface",
"wasmi",
]
@@ -10058,19 +10001,16 @@
[[package]]
name = "sc-executor-wasmtime"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"cfg-if",
"libc",
"log",
"once_cell",
- "parity-scale-codec 3.2.1",
- "parity-wasm",
"rustix 0.35.13",
"sc-allocator",
"sc-executor-common",
"sp-runtime-interface",
- "sp-sandbox",
"sp-wasm-interface",
"wasmtime",
]
@@ -10078,10 +10018,10 @@
[[package]]
name = "sc-finality-grandpa"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ahash",
- "array-bytes",
+ "array-bytes 4.2.0",
"async-trait",
"dyn-clone",
"finality-grandpa",
@@ -10119,7 +10059,7 @@
[[package]]
name = "sc-finality-grandpa-rpc"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"finality-grandpa",
"futures 0.3.25",
@@ -10140,13 +10080,12 @@
[[package]]
name = "sc-informant"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ansi_term",
"futures 0.3.25",
"futures-timer",
"log",
- "parity-util-mem",
"sc-client-api",
"sc-network-common",
"sc-transaction-pool-api",
@@ -10157,9 +10096,9 @@
[[package]]
name = "sc-keystore"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"async-trait",
"parking_lot 0.12.1",
"serde_json",
@@ -10172,9 +10111,9 @@
[[package]]
name = "sc-network"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"async-trait",
"asynchronous-codec",
"bitflags",
@@ -10219,7 +10158,7 @@
[[package]]
name = "sc-network-bitswap"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"cid",
"futures 0.3.25",
@@ -10239,7 +10178,7 @@
[[package]]
name = "sc-network-common"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"bitflags",
@@ -10265,7 +10204,7 @@
[[package]]
name = "sc-network-gossip"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ahash",
"futures 0.3.25",
@@ -10283,9 +10222,9 @@
[[package]]
name = "sc-network-light"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"futures 0.3.25",
"libp2p",
"log",
@@ -10304,9 +10243,10 @@
[[package]]
name = "sc-network-sync"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
+ "async-trait",
"fork-tree",
"futures 0.3.25",
"libp2p",
@@ -10328,15 +10268,16 @@
"sp-core",
"sp-finality-grandpa",
"sp-runtime",
+ "substrate-prometheus-endpoint",
"thiserror",
]
[[package]]
name = "sc-network-transactions"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"futures 0.3.25",
"hex",
"libp2p",
@@ -10353,9 +10294,9 @@
[[package]]
name = "sc-offchain"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"bytes",
"fnv",
"futures 0.3.25",
@@ -10383,7 +10324,7 @@
[[package]]
name = "sc-peerset"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"libp2p",
@@ -10396,7 +10337,7 @@
[[package]]
name = "sc-proposer-metrics"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
"substrate-prometheus-endpoint",
@@ -10405,7 +10346,7 @@
[[package]]
name = "sc-rpc"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"hash-db",
@@ -10435,7 +10376,7 @@
[[package]]
name = "sc-rpc-api"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"jsonrpsee",
@@ -10458,20 +10399,23 @@
[[package]]
name = "sc-rpc-server"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
+ "http",
"jsonrpsee",
"log",
"serde_json",
"substrate-prometheus-endpoint",
"tokio",
+ "tower",
+ "tower-http",
]
[[package]]
name = "sc-rpc-spec-v2"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"hex",
@@ -10490,7 +10434,7 @@
[[package]]
name = "sc-service"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"directories",
@@ -10501,7 +10445,6 @@
"jsonrpsee",
"log",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"parking_lot 0.12.1",
"pin-project",
"rand 0.7.3",
@@ -10561,12 +10504,10 @@
[[package]]
name = "sc-state-db"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"log",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
- "parity-util-mem-derive",
"parking_lot 0.12.1",
"sc-client-api",
"sp-core",
@@ -10575,7 +10516,7 @@
[[package]]
name = "sc-sync-state-rpc"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"jsonrpsee",
"parity-scale-codec 3.2.1",
@@ -10594,7 +10535,7 @@
[[package]]
name = "sc-sysinfo"
version = "6.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"libc",
@@ -10613,7 +10554,7 @@
[[package]]
name = "sc-telemetry"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"chrono",
"futures 0.3.25",
@@ -10631,7 +10572,7 @@
[[package]]
name = "sc-tracing"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ansi_term",
"atty",
@@ -10662,7 +10603,7 @@
[[package]]
name = "sc-tracing-proc-macro"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -10673,7 +10614,7 @@
[[package]]
name = "sc-transaction-pool"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -10681,7 +10622,6 @@
"linked-hash-map",
"log",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"parking_lot 0.12.1",
"sc-client-api",
"sc-transaction-pool-api",
@@ -10700,7 +10640,7 @@
[[package]]
name = "sc-transaction-pool-api"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -10714,7 +10654,7 @@
[[package]]
name = "sc-utils"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"futures-timer",
@@ -10726,9 +10666,9 @@
[[package]]
name = "scale-info"
-version = "2.3.0"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d8a765117b237ef233705cc2cc4c6a27fccd46eea6ef0c8c6dae5f3ef407f8"
+checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608"
dependencies = [
"bitvec 1.0.1",
"cfg-if",
@@ -10740,9 +10680,9 @@
[[package]]
name = "scale-info-derive"
-version = "2.3.0"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496"
+checksum = "303959cf613a6f6efd19ed4b4ad5bf79966a13352716299ad532cfb115f4205c"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -10786,9 +10726,9 @@
[[package]]
name = "scratch"
-version = "1.0.2"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
+checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
[[package]]
name = "sct"
@@ -10816,9 +10756,9 @@
[[package]]
name = "secp256k1"
-version = "0.24.1"
+version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964"
+checksum = "d9512ffd81e3a3503ed401f79c33168b9148c75038956039166cd750eaa037c3"
dependencies = [
"secp256k1-sys",
]
@@ -10884,9 +10824,9 @@
[[package]]
name = "semver"
-version = "1.0.14"
+version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
+checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
dependencies = [
"serde",
]
@@ -10899,18 +10839,18 @@
[[package]]
name = "serde"
-version = "1.0.149"
+version = "1.0.151"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055"
+checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.149"
+version = "1.0.151"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4"
+checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8"
dependencies = [
"proc-macro2",
"quote",
@@ -10919,9 +10859,9 @@
[[package]]
name = "serde_json"
-version = "1.0.89"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
+checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
dependencies = [
"itoa",
"ryu",
@@ -11119,8 +11059,8 @@
[[package]]
name = "slot-range-helper"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"enumn",
"parity-scale-codec 3.2.1",
@@ -11159,7 +11099,7 @@
"aes-gcm",
"blake2",
"chacha20poly1305",
- "curve25519-dalek 4.0.0-pre.1",
+ "curve25519-dalek 4.0.0-pre.5",
"rand_core 0.6.4",
"ring",
"rustc_version 0.4.0",
@@ -11187,6 +11127,7 @@
"bytes",
"flate2",
"futures 0.3.25",
+ "http",
"httparse",
"log",
"rand 0.8.5",
@@ -11196,7 +11137,7 @@
[[package]]
name = "sp-api"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"hash-db",
"log",
@@ -11214,7 +11155,7 @@
[[package]]
name = "sp-api-proc-macro"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"blake2",
"proc-macro-crate",
@@ -11225,8 +11166,8 @@
[[package]]
name = "sp-application-crypto"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11238,8 +11179,8 @@
[[package]]
name = "sp-arithmetic"
-version = "5.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "6.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"integer-sqrt",
"num-traits",
@@ -11254,7 +11195,7 @@
[[package]]
name = "sp-authority-discovery"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11267,7 +11208,7 @@
[[package]]
name = "sp-authorship"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"parity-scale-codec 3.2.1",
@@ -11277,9 +11218,26 @@
]
[[package]]
+name = "sp-beefy"
+version = "4.0.0-dev"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
+dependencies = [
+ "parity-scale-codec 3.2.1",
+ "scale-info",
+ "serde",
+ "sp-api",
+ "sp-application-crypto",
+ "sp-core",
+ "sp-io",
+ "sp-mmr-primitives",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
name = "sp-block-builder"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"sp-api",
@@ -11291,7 +11249,7 @@
[[package]]
name = "sp-blockchain"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"log",
@@ -11309,7 +11267,7 @@
[[package]]
name = "sp-consensus"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -11328,7 +11286,7 @@
[[package]]
name = "sp-consensus-aura"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"parity-scale-codec 3.2.1",
@@ -11346,7 +11304,7 @@
[[package]]
name = "sp-consensus-babe"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"merlin",
@@ -11369,7 +11327,7 @@
[[package]]
name = "sp-consensus-slots"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11383,7 +11341,7 @@
[[package]]
name = "sp-consensus-vrf"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11395,10 +11353,10 @@
[[package]]
name = "sp-core"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"base58",
"bitflags",
"blake2",
@@ -11440,8 +11398,8 @@
[[package]]
name = "sp-core-hashing"
-version = "4.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "5.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"blake2",
"byteorder",
@@ -11455,7 +11413,7 @@
[[package]]
name = "sp-core-hashing-proc-macro"
version = "5.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro2",
"quote",
@@ -11466,7 +11424,7 @@
[[package]]
name = "sp-database"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"kvdb",
"parking_lot 0.12.1",
@@ -11474,8 +11432,8 @@
[[package]]
name = "sp-debug-derive"
-version = "4.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "5.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro2",
"quote",
@@ -11484,8 +11442,8 @@
[[package]]
name = "sp-externalities"
-version = "0.12.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "0.13.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"environmental",
"parity-scale-codec 3.2.1",
@@ -11496,7 +11454,7 @@
[[package]]
name = "sp-finality-grandpa"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"finality-grandpa",
"log",
@@ -11514,7 +11472,7 @@
[[package]]
name = "sp-inherents"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"impl-trait-for-tuples",
@@ -11527,10 +11485,11 @@
[[package]]
name = "sp-io"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"bytes",
+ "ed25519-dalek",
"futures 0.3.25",
"hash-db",
"libsecp256k1",
@@ -11553,8 +11512,8 @@
[[package]]
name = "sp-keyring"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"lazy_static",
"sp-core",
@@ -11564,8 +11523,8 @@
[[package]]
name = "sp-keystore"
-version = "0.12.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "0.13.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures 0.3.25",
@@ -11582,7 +11541,7 @@
[[package]]
name = "sp-maybe-compressed-blob"
version = "4.1.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"thiserror",
"zstd",
@@ -11591,8 +11550,9 @@
[[package]]
name = "sp-mmr-primitives"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
+ "ckb-merkle-mountain-range",
"log",
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11608,7 +11568,7 @@
[[package]]
name = "sp-npos-elections"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11622,7 +11582,7 @@
[[package]]
name = "sp-offchain"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"sp-api",
"sp-core",
@@ -11631,8 +11591,8 @@
[[package]]
name = "sp-panic-handler"
-version = "4.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "5.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"backtrace",
"lazy_static",
@@ -11642,7 +11602,7 @@
[[package]]
name = "sp-rpc"
version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"rustc-hash",
"serde",
@@ -11651,15 +11611,14 @@
[[package]]
name = "sp-runtime"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"either",
"hash256-std-hasher",
"impl-trait-for-tuples",
"log",
"parity-scale-codec 3.2.1",
- "parity-util-mem",
"paste",
"rand 0.7.3",
"scale-info",
@@ -11674,8 +11633,8 @@
[[package]]
name = "sp-runtime-interface"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"bytes",
"impl-trait-for-tuples",
@@ -11692,34 +11651,20 @@
[[package]]
name = "sp-runtime-interface-proc-macro"
-version = "5.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "6.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"Inflector",
"proc-macro-crate",
"proc-macro2",
"quote",
"syn",
-]
-
-[[package]]
-name = "sp-sandbox"
-version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
-dependencies = [
- "log",
- "parity-scale-codec 3.2.1",
- "sp-core",
- "sp-io",
- "sp-std",
- "sp-wasm-interface",
- "wasmi",
]
[[package]]
name = "sp-session"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
@@ -11733,18 +11678,19 @@
[[package]]
name = "sp-staking"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"scale-info",
+ "sp-core",
"sp-runtime",
"sp-std",
]
[[package]]
name = "sp-state-machine"
-version = "0.12.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "0.13.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"hash-db",
"log",
@@ -11765,13 +11711,13 @@
[[package]]
name = "sp-std"
-version = "4.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "5.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
[[package]]
name = "sp-storage"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-serde",
"parity-scale-codec 3.2.1",
@@ -11784,7 +11730,7 @@
[[package]]
name = "sp-timestamp"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"futures-timer",
@@ -11799,8 +11745,8 @@
[[package]]
name = "sp-tracing"
-version = "5.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "6.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"sp-std",
@@ -11812,7 +11758,7 @@
[[package]]
name = "sp-transaction-pool"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"sp-api",
"sp-runtime",
@@ -11821,7 +11767,7 @@
[[package]]
name = "sp-transaction-storage-proof"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"log",
@@ -11836,8 +11782,8 @@
[[package]]
name = "sp-trie"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ahash",
"hash-db",
@@ -11860,7 +11806,7 @@
[[package]]
name = "sp-version"
version = "5.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-serde",
"parity-scale-codec 3.2.1",
@@ -11877,7 +11823,7 @@
[[package]]
name = "sp-version-proc-macro"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"parity-scale-codec 3.2.1",
"proc-macro2",
@@ -11887,8 +11833,8 @@
[[package]]
name = "sp-wasm-interface"
-version = "6.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+version = "7.0.0"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-trait-for-tuples",
"log",
@@ -11901,7 +11847,7 @@
[[package]]
name = "sp-weights"
version = "4.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"impl-trait-for-tuples",
"parity-scale-codec 3.2.1",
@@ -11932,9 +11878,9 @@
[[package]]
name = "ss58-registry"
-version = "1.35.0"
+version = "1.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa0813c10b9dbdc842c2305f949f724c64866e4ef4d09c9151e96f6a2106773c"
+checksum = "23d92659e7d18d82b803824a9ba5a6022cff101c3491d027c1c1d8d30e749284"
dependencies = [
"Inflector",
"num-format",
@@ -11979,7 +11925,7 @@
"cfg_aliases",
"libc",
"parking_lot 0.11.2",
- "parking_lot_core 0.8.5",
+ "parking_lot_core 0.8.6",
"static_init_macro 1.0.2",
"winapi",
]
@@ -12075,15 +12021,15 @@
[[package]]
name = "substrate-build-script-utils"
version = "3.0.0"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "platforms",
+ "platforms 2.0.0",
]
[[package]]
name = "substrate-frame-rpc-system"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"frame-system-rpc-runtime-api",
"futures 0.3.25",
@@ -12104,7 +12050,7 @@
[[package]]
name = "substrate-prometheus-endpoint"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures-util",
"hyper",
@@ -12117,7 +12063,7 @@
[[package]]
name = "substrate-rpc-client"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"async-trait",
"jsonrpsee",
@@ -12130,7 +12076,7 @@
[[package]]
name = "substrate-state-trie-migration-rpc"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"jsonrpsee",
"log",
@@ -12151,9 +12097,9 @@
[[package]]
name = "substrate-test-client"
version = "2.0.1"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
- "array-bytes",
+ "array-bytes 4.2.0",
"async-trait",
"futures 0.3.25",
"parity-scale-codec 3.2.1",
@@ -12177,7 +12123,7 @@
[[package]]
name = "substrate-test-utils"
version = "4.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"futures 0.3.25",
"substrate-test-utils-derive",
@@ -12187,7 +12133,7 @@
[[package]]
name = "substrate-test-utils-derive"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -12198,7 +12144,7 @@
[[package]]
name = "substrate-wasm-builder"
version = "5.0.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"ansi_term",
"build-helper",
@@ -12220,9 +12166,9 @@
[[package]]
name = "syn"
-version = "1.0.105"
+version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
+checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
dependencies = [
"proc-macro2",
"quote",
@@ -12315,8 +12261,8 @@
[[package]]
name = "test-runtime-constants"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"polkadot-primitives",
@@ -12359,18 +12305,18 @@
[[package]]
name = "thiserror"
-version = "1.0.37"
+version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
+checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.37"
+version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
+checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
dependencies = [
"proc-macro2",
"quote",
@@ -12415,6 +12361,17 @@
]
[[package]]
+name = "tikv-jemalloc-ctl"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1"
+dependencies = [
+ "libc",
+ "paste",
+ "tikv-jemalloc-sys",
+]
+
+[[package]]
name = "tikv-jemalloc-sys"
version = "0.5.2+5.3.0-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -12434,25 +12391,7 @@
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi",
-]
-
-[[package]]
-name = "time"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd"
-dependencies = [
- "itoa",
- "libc",
- "num_threads",
- "time-macros",
]
-
-[[package]]
-name = "time-macros"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792"
[[package]]
name = "tiny-bip39"
@@ -12567,14 +12506,49 @@
[[package]]
name = "toml"
-version = "0.5.9"
+version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
+checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f"
dependencies = [
"serde",
]
[[package]]
+name = "tower"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
+dependencies = [
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
+dependencies = [
+ "bitflags",
+ "bytes",
+ "futures-core",
+ "futures-util",
+ "http",
+ "http-body",
+ "http-range-header",
+ "pin-project-lite 0.2.9",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "tower-layer"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
+
+[[package]]
name = "tower-service"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -12587,6 +12561,7 @@
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
+ "log",
"pin-project-lite 0.2.9",
"tracing-attributes",
"tracing-core",
@@ -12625,8 +12600,8 @@
[[package]]
name = "tracing-gum"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"polkadot-node-jaeger",
"polkadot-primitives",
@@ -12636,8 +12611,8 @@
[[package]]
name = "tracing-gum-proc-macro"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"expander 0.0.6",
"proc-macro-crate",
@@ -12742,6 +12717,7 @@
"smallvec",
"thiserror",
"tinyvec",
+ "tokio",
"tracing",
"url",
]
@@ -12761,6 +12737,7 @@
"resolv-conf",
"smallvec",
"thiserror",
+ "tokio",
"tracing",
"trust-dns-proto",
]
@@ -12774,22 +12751,26 @@
[[package]]
name = "try-runtime-cli"
version = "0.10.0-dev"
-source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2dff067e9f7f6f3cc4dbfdaaa97753eccc407689"
+source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51"
dependencies = [
"clap",
+ "frame-remote-externalities",
"frame-try-runtime",
+ "hex",
"log",
"parity-scale-codec 3.2.1",
- "remote-externalities",
"sc-chain-spec",
"sc-cli",
"sc-executor",
"sc-service",
"serde",
+ "sp-api",
"sp-core",
+ "sp-debug-derive",
"sp-externalities",
"sp-io",
"sp-keystore",
+ "sp-rpc",
"sp-runtime",
"sp-state-machine",
"sp-version",
@@ -12800,9 +12781,9 @@
[[package]]
name = "trybuild"
-version = "1.0.72"
+version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db29f438342820400f2d9acfec0d363e987a38b2950bdb50a7069ed17b2148ee"
+checksum = "ed01de3de062db82c0920b5cabe804f88d599a3f217932292597c678c903754d"
dependencies = [
"glob",
"once_cell",
@@ -12815,9 +12796,9 @@
[[package]]
name = "tt-call"
-version = "1.0.8"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055"
+checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df"
[[package]]
name = "twox-hash"
@@ -12876,15 +12857,6 @@
]
[[package]]
-name = "unicase"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
-dependencies = [
- "version_check",
-]
-
-[[package]]
name = "unicode-bidi"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -12892,9 +12864,9 @@
[[package]]
name = "unicode-ident"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
+checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
[[package]]
name = "unicode-normalization"
@@ -12925,7 +12897,7 @@
[[package]]
name = "unique-node"
-version = "0.9.33"
+version = "0.9.36"
dependencies = [
"app-promotion-rpc",
"clap",
@@ -13064,7 +13036,7 @@
[[package]]
name = "unique-runtime"
-version = "0.9.33"
+version = "0.9.36"
dependencies = [
"app-promotion-rpc",
"cumulus-pallet-aura-ext",
@@ -13189,7 +13161,7 @@
[[package]]
name = "up-common"
-version = "0.9.33"
+version = "0.9.36"
dependencies = [
"cumulus-primitives-core",
"fp-rpc",
@@ -13237,7 +13209,7 @@
[[package]]
name = "up-sponsorship"
version = "0.1.0"
-source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.33#994d4a8dc6cc630b73d19f97315272a8795317e7"
+source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.36#55943b982e9b0b80465885f31f76db3dba91dac4"
dependencies = [
"impl-trait-for-tuples",
]
@@ -13490,7 +13462,7 @@
checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7"
dependencies = [
"downcast-rs",
- "libm",
+ "libm 0.2.6",
"memory_units",
"num-rational",
"num-traits",
@@ -13517,7 +13489,7 @@
"indexmap",
"libc",
"log",
- "object",
+ "object 0.29.0",
"once_cell",
"paste",
"psm",
@@ -13574,9 +13546,9 @@
"cranelift-frontend",
"cranelift-native",
"cranelift-wasm",
- "gimli",
+ "gimli 0.26.2",
"log",
- "object",
+ "object 0.29.0",
"target-lexicon",
"thiserror",
"wasmparser",
@@ -13591,10 +13563,10 @@
dependencies = [
"anyhow",
"cranelift-entity",
- "gimli",
+ "gimli 0.26.2",
"indexmap",
"log",
- "object",
+ "object 0.29.0",
"serde",
"target-lexicon",
"thiserror",
@@ -13608,14 +13580,14 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681"
dependencies = [
- "addr2line",
+ "addr2line 0.17.0",
"anyhow",
"bincode",
"cfg-if",
"cpp_demangle",
- "gimli",
+ "gimli 0.26.2",
"log",
- "object",
+ "object 0.29.0",
"rustc-demangle",
"rustix 0.35.13",
"serde",
@@ -13633,7 +13605,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731"
dependencies = [
- "object",
+ "object 0.29.0",
"once_cell",
"rustix 0.35.13",
]
@@ -13697,9 +13669,9 @@
[[package]]
name = "webpki-roots"
-version = "0.22.5"
+version = "0.22.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be"
+checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
dependencies = [
"webpki",
]
@@ -13715,10 +13687,9 @@
[[package]]
name = "westend-runtime"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
- "beefy-primitives",
"bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
@@ -13782,6 +13753,7 @@
"smallvec",
"sp-api",
"sp-authority-discovery",
+ "sp-beefy",
"sp-block-builder",
"sp-consensus-babe",
"sp-core",
@@ -13805,8 +13777,8 @@
[[package]]
name = "westend-runtime-constants"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"polkadot-primitives",
@@ -14045,8 +14017,8 @@
[[package]]
name = "xcm"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"derivative",
"impl-trait-for-tuples",
@@ -14059,8 +14031,8 @@
[[package]]
name = "xcm-builder"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-support",
"frame-system",
@@ -14079,8 +14051,8 @@
[[package]]
name = "xcm-executor"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -14097,8 +14069,8 @@
[[package]]
name = "xcm-procedural"
-version = "0.9.33"
-source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.33#c7d6c21242fc654f6f069e12c00951484dff334d"
+version = "0.9.36"
+source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc"
dependencies = [
"Inflector",
"proc-macro2",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,3 @@
-cargo-features = ["workspace-inheritance"]
-
[workspace]
resolver = "2"
members = [
@@ -14,26 +12,27 @@
'runtime/tests',
]
default-members = ['node/*', 'runtime/opal']
+package.version = "0.9.36"
[profile.release]
panic = 'unwind'
[workspace.dependencies.orml-vesting]
git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "polkadot-v0.9.33"
+branch = "feature/polkadot-v0.9.36"
default-features = false
[workspace.dependencies.orml-xtokens]
git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "polkadot-v0.9.33"
+branch = "feature/polkadot-v0.9.36"
default-features = false
[workspace.dependencies.orml-tokens]
git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "polkadot-v0.9.33"
+branch = "feature/polkadot-v0.9.36"
default-features = false
[workspace.dependencies.orml-traits]
git = "https://github.com/uniquenetwork/open-runtime-module-library"
-branch = "polkadot-v0.9.33"
+branch = "feature/polkadot-v0.9.36"
default-features = false
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@
```
git clone https://github.com/paritytech/polkadot.git
cd polkadot
-git checkout release-v0.9.33
+git checkout release-v0.9.36
cargo build --release
```
client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -8,15 +8,15 @@
pallet-common = { default-features = false, path = '../../pallets/common' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
up-rpc = { path = "../../primitives/rpc" }
-app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"}
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc" }
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
codec = { package = "parity-scale-codec", version = "3.1.2" }
-jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
+jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
anyhow = "1.0.57"
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
crates/evm-coder/Cargo.tomldiffbeforeafterboth--- a/crates/evm-coder/Cargo.toml
+++ b/crates/evm-coder/Cargo.toml
@@ -12,14 +12,14 @@
primitive-types = { version = "0.12.1", default-features = false }
# Evm doesn't have reexports for log and others
ethereum = { version = "0.14.0", default-features = false }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
# Error types for execution
-evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.33" }
+evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.36" }
# We have tuple-heavy code in solidity.rs
impl-trait-for-tuples = "0.2.2"
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[dev-dependencies]
# We want to assert some large binary blobs equality in tests
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -3,7 +3,7 @@
[build-dependencies.substrate-build-script-utils]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
################################################################################
# Substrate Dependecies
@@ -16,158 +16,155 @@
[dependencies.frame-benchmarking]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-benchmarking-cli]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.try-runtime-cli]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment-rpc]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.substrate-prometheus-endpoint]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-basic-authorship]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-chain-spec]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-cli]
-features = ['wasmtime']
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-client-api]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-consensus]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-consensus-aura]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-executor]
-features = ['wasmtime']
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-finality-grandpa]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-keystore]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-rpc]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-rpc-api]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-service]
-features = ['wasmtime']
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-telemetry]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-transaction-pool]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-tracing]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-sysinfo]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-block-builder]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-api]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-blockchain]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus-aura]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-finality-grandpa]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-inherents]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-keystore]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-offchain]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-session]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-timestamp]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-transaction-pool]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-trie]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.substrate-frame-rpc-system]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sc-network]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.serde]
features = ['derive']
@@ -178,76 +175,76 @@
[dependencies.sc-consensus-manual-seal]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
################################################################################
# Cumulus dependencies
[dependencies.cumulus-client-consensus-aura]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-client-consensus-common]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-client-collator]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-client-cli]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-client-network]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-primitives-core]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-primitives-parachain-inherent]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-client-service]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-relay-chain-interface]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-relay-chain-inprocess-interface]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-relay-chain-minimal-node]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
################################################################################
# Polkadot dependencies
[dependencies.polkadot-primitives]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
[dependencies.polkadot-service]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
[dependencies.polkadot-cli]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
[dependencies.polkadot-test-service]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
[dependencies.polkadot-parachain]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
################################################################################
@@ -277,7 +274,7 @@
[dependencies.pallet-transaction-payment-rpc-runtime-api]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
################################################################################
# Package
@@ -291,7 +288,7 @@
license = 'GPLv3'
name = 'unique-node'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = "0.9.33"
+version.workspace = true
[[bin]]
name = 'unique-collator'
@@ -303,19 +300,19 @@
[dependencies]
futures = '0.3.17'
log = '0.4.16'
-flexi_logger = "0.22.5"
+flexi_logger = "0.24.2"
parking_lot = '0.12.1'
clap = "4.0.9"
-jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
+jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
tokio = { version = "1.19.2", features = ["time"] }
-fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
unique-rpc = { default-features = false, path = "../rpc" }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
@@ -337,7 +334,4 @@
'opal-runtime?/try-runtime',
'try-runtime-cli/try-runtime',
]
-sapphire-runtime = [
- 'opal-runtime',
- 'opal-runtime/become-sapphire',
-]
+sapphire-runtime = ['opal-runtime', 'opal-runtime/become-sapphire']
node/cli/src/command.rsdiffbeforeafterboth--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -472,10 +472,9 @@
let autoseal_interval = Duration::from_millis(cli.idle_autoseal_interval);
let mut config = config;
- if config.state_pruning == None {
- config.state_pruning = Some(sc_service::PruningMode::ArchiveAll);
- }
+ config.state_pruning = Some(sc_service::PruningMode::ArchiveAll);
+
return start_node_using_chain_runtime! {
start_dev_node(config, autoseal_interval).map_err(Into::into)
};
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -58,6 +58,7 @@
use sp_runtime::traits::BlakeTwo256;
use substrate_prometheus_endpoint::Registry;
use sc_client_api::BlockchainEvents;
+use sc_consensus::ImportQueue;
use polkadot_service::CollatorPair;
@@ -191,7 +192,7 @@
type FullBackend = sc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
type ParachainBlockImport<RuntimeApi, ExecutorDispatch> =
- TParachainBlockImport<Arc<FullClient<RuntimeApi, ExecutorDispatch>>>;
+ TParachainBlockImport<Block, Arc<FullClient<RuntimeApi, ExecutorDispatch>>, FullBackend>;
/// Starts a `ServiceBuilder` for a full service.
///
@@ -228,6 +229,7 @@
ExecutorDispatch: NativeExecutionDispatch + 'static,
BIQ: FnOnce(
Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+ Arc<FullBackend>,
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
@@ -298,6 +300,7 @@
let import_queue = build_import_queue(
client.clone(),
+ backend.clone(),
config,
telemetry.as_ref().map(|telemetry| telemetry.handle()),
&task_manager,
@@ -335,17 +338,21 @@
Arc<(dyn RelayChainInterface + 'static)>,
Option<CollatorPair>,
)> {
- match collator_options.relay_chain_rpc_url {
- Some(relay_chain_url) => {
- build_minimal_relay_chain_node(polkadot_config, task_manager, relay_chain_url).await
- }
- None => build_inprocess_relay_chain(
+ if collator_options.relay_chain_rpc_urls.is_empty() {
+ build_inprocess_relay_chain(
polkadot_config,
parachain_config,
telemetry_worker_handle,
task_manager,
hwbench,
- ),
+ )
+ } else {
+ build_minimal_relay_chain_node(
+ polkadot_config,
+ task_manager,
+ collator_options.relay_chain_rpc_urls,
+ )
+ .await
}
}
@@ -397,6 +404,7 @@
ExecutorDispatch: NativeExecutionDispatch + 'static,
BIQ: FnOnce(
Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+ Arc<FullBackend>,
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
@@ -406,6 +414,7 @@
>,
BIC: FnOnce(
Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+ Arc<FullBackend>,
Option<&Registry>,
Option<TelemetryHandle>,
&TaskManager,
@@ -447,7 +456,7 @@
let validator = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
- let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
+ let import_queue_service = params.import_queue.service();
let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
@@ -455,7 +464,7 @@
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
- import_queue: import_queue.clone(),
+ import_queue: params.import_queue,
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
@@ -560,6 +569,7 @@
if validator {
let parachain_consensus = build_consensus(
client.clone(),
+ backend.clone(),
prometheus_registry.as_ref(),
telemetry.as_ref().map(|t| t.handle()),
&task_manager,
@@ -580,7 +590,7 @@
task_manager: &mut task_manager,
spawner,
parachain_consensus,
- import_queue,
+ import_queue: import_queue_service,
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_interface,
relay_chain_slot_duration,
@@ -593,7 +603,7 @@
announce_block,
task_manager: &mut task_manager,
para_id: id,
- import_queue,
+ import_queue: import_queue_service,
relay_chain_interface,
relay_chain_slot_duration,
};
@@ -609,6 +619,7 @@
/// Build the import queue for the the parachain runtime.
pub fn parachain_build_import_queue<RuntimeApi, ExecutorDispatch>(
client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+ backend: Arc<FullBackend>,
config: &Configuration,
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
@@ -629,7 +640,7 @@
{
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
- let block_import = ParachainBlockImport::new(client.clone());
+ let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
cumulus_client_consensus_aura::import_queue::<
sp_consensus_aura::sr25519::AuthorityPair,
@@ -708,6 +719,7 @@
id,
parachain_build_import_queue,
|client,
+ backend,
prometheus_registry,
telemetry,
task_manager,
@@ -726,7 +738,7 @@
telemetry.clone(),
);
- let block_import = ParachainBlockImport::new(client.clone());
+ let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
Ok(AuraConsensus::build::<
sp_consensus_aura::sr25519::AuthorityPair,
@@ -785,6 +797,7 @@
fn dev_build_import_queue<RuntimeApi, ExecutorDispatch>(
client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+ _: Arc<FullBackend>,
config: &Configuration,
_: Option<TelemetryHandle>,
task_manager: &TaskManager,
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -11,42 +11,42 @@
[dependencies]
futures = { version = "0.3.17", features = ["compat"] }
-jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
+jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
# pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' }
-pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
tokio = { version = "1.19.2", features = ["macros", "sync"] }
-pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-common = { default-features = false, path = "../../pallets/common" }
up-common = { path = "../../primitives/common" }
pallets/app-promotion/CHANGELOG.mddiffbeforeafterboth--- a/pallets/app-promotion/CHANGELOG.md
+++ b/pallets/app-promotion/CHANGELOG.md
@@ -4,6 +4,13 @@
<!-- bureaucrate goes here -->
+## [0.1.2] - 2022-12-20
+
+### Fixed
+
+- The behaviour of the `payoutStakers` extrinsic
+ in which only one stake is calculated for the last processed staker.
+
## [0.1.1] - 2022-12-13
### Added
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -9,7 +9,7 @@
license = 'GPLv3'
name = 'pallet-app-promotion'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.1'
+version = '0.1.2'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@@ -50,17 +50,17 @@
codec = { default-features = false, features = [
'derive',
], package = 'parity-scale-codec', version = '3.1.2' }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
serde = { default-features = false, features = ['derive'], version = '1.0.130' }
################################################################################
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -301,6 +301,7 @@
/// # Arguments
///
/// * `admin`: account of the new admin.
+ #[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::set_admin_address())]
pub fn set_admin_address(origin: OriginFor<T>, admin: T::CrossAccountId) -> DispatchResult {
ensure_root(origin)?;
@@ -319,6 +320,7 @@
/// # Arguments
///
/// * `amount`: in native tokens.
+ #[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::stake())]
pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
let staker_id = ensure_signed(staker)?;
@@ -393,6 +395,7 @@
/// Moves the sum of all stakes to the `reserved` state.
/// After the end of `PendingInterval` this sum becomes completely
/// free for further use.
+ #[pallet::call_index(2)]
#[pallet::weight(<T as Config>::WeightInfo::unstake())]
pub fn unstake(staker: OriginFor<T>) -> DispatchResultWithPostInfo {
let staker_id = ensure_signed(staker)?;
@@ -454,6 +457,7 @@
/// # Arguments
///
/// * `collection_id`: ID of the collection that will be sponsored by `pallet_id`
+ #[pallet::call_index(3)]
#[pallet::weight(<T as Config>::WeightInfo::sponsor_collection())]
pub fn sponsor_collection(
admin: OriginFor<T>,
@@ -479,6 +483,7 @@
/// # Arguments
///
/// * `collection_id`: ID of the collection that is sponsored by `pallet_id`
+ #[pallet::call_index(4)]
#[pallet::weight(<T as Config>::WeightInfo::stop_sponsoring_collection())]
pub fn stop_sponsoring_collection(
admin: OriginFor<T>,
@@ -508,6 +513,7 @@
/// # Arguments
///
/// * `contract_id`: the contract address that will be sponsored by `pallet_id`
+ #[pallet::call_index(5)]
#[pallet::weight(<T as Config>::WeightInfo::sponsor_contract())]
pub fn sponsor_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
let admin_id = ensure_signed(admin)?;
@@ -534,6 +540,7 @@
/// # Arguments
///
/// * `contract_id`: the contract address that is sponsored by `pallet_id`
+ #[pallet::call_index(6)]
#[pallet::weight(<T as Config>::WeightInfo::stop_sponsoring_contract())]
pub fn stop_sponsoring_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
let admin_id = ensure_signed(admin)?;
@@ -564,6 +571,7 @@
/// # Arguments
///
/// * `stakers_number`: the number of stakers for which recalculation will be performed
+ #[pallet::call_index(7)]
#[pallet::weight(<T as Config>::WeightInfo::payout_stakers(stakers_number.unwrap_or(DEFAULT_NUMBER_PAYOUTS) as u32))]
pub fn payout_stakers(admin: OriginFor<T>, stakers_number: Option<u8>) -> DispatchResult {
let admin_id = ensure_signed(admin)?;
@@ -600,6 +608,8 @@
{
// Address handled in the last payout loop iteration (below)
let last_id = RefCell::new(None);
+ // Block number (as a part of the key) for which calculation was performed in the last payout loop iteration
+ let mut last_staked_calculated_block = Default::default();
// Reward balance for the address in the iteration
let income_acc = RefCell::new(BalanceOf::<T>::default());
// Staked balance for the address in the iteration (before stake is recalculated)
@@ -658,9 +668,22 @@
// or just start handling the very first address. In the latter case last_id will be None and
// flush_stake will do nothing
if last_id.borrow().as_ref() != Some(¤t_id) {
- flush_stake()?;
- *last_id.borrow_mut() = Some(current_id.clone());
- stakers_number -= 1;
+ if stakers_number > 0 {
+ flush_stake()?;
+ *last_id.borrow_mut() = Some(current_id.clone());
+ stakers_number -= 1;
+ }
+ // Break out if we reached the address limit
+ else {
+ if let Some(staker) = &*last_id.borrow() {
+ // Save the last calculated record to pick up in the next extrinsic call
+ PreviousCalculatedRecord::<T>::set(Some((
+ staker.clone(),
+ last_staked_calculated_block,
+ )));
+ }
+ break;
+ };
};
// Increase accumulated reward for current address and update current staking record, i.e. (address, staked_block) -> amount
@@ -677,15 +700,7 @@
&mut *income_acc.borrow_mut(),
);
}
-
- // Break out if we reached the address limit
- if stakers_number == 0 {
- if storage_iterator.next().is_some() {
- // Save the last calculated record to pick up in the next extrinsic call
- PreviousCalculatedRecord::<T>::set(Some((current_id, staked_block)));
- }
- break;
- }
+ last_staked_calculated_block = staked_block;
}
flush_stake()?;
}
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -11,18 +11,18 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
ethereum = { version = "0.14.0", default-features = false }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
serde = { version = "1.0.130", default-features = false }
scale-info = { version = "2.0.1", default-features = false, features = [
pallets/configuration/Cargo.tomldiffbeforeafterboth--- a/pallets/configuration/Cargo.toml
+++ b/pallets/configuration/Cargo.toml
@@ -10,15 +10,15 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
smallvec = "1.6.1"
-xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
+xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
[features]
default = ["std"]
pallets/configuration/src/lib.rsdiffbeforeafterboth--- a/pallets/configuration/src/lib.rs
+++ b/pallets/configuration/src/lib.rs
@@ -88,6 +88,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+ #[pallet::call_index(0)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn set_weight_to_fee_coefficient_override(
origin: OriginFor<T>,
@@ -102,6 +103,7 @@
Ok(())
}
+ #[pallet::call_index(1)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn set_min_gas_price_override(
origin: OriginFor<T>,
@@ -116,6 +118,7 @@
Ok(())
}
+ #[pallet::call_index(2)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn set_xcm_allowed_locations(
origin: OriginFor<T>,
@@ -126,6 +129,7 @@
Ok(())
}
+ #[pallet::call_index(3)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn set_app_promotion_configuration_override(
origin: OriginFor<T>,
pallets/evm-coder-substrate/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-coder-substrate/Cargo.toml
+++ b/pallets/evm-coder-substrate/Cargo.toml
@@ -8,15 +8,15 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
ethereum = { version = "0.14.0", default-features = false }
evm-coder = { default-features = false, path = "../../crates/evm-coder" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
[dependencies.codec]
pallets/evm-coder-substrate/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-coder-substrate/src/lib.rs
+++ b/pallets/evm-coder-substrate/src/lib.rs
@@ -73,6 +73,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+ #[pallet::call_index(0)]
#[pallet::weight(0)]
pub fn empty_call(origin: OriginFor<T>) -> DispatchResult {
let _sender = ensure_signed(origin)?;
pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -12,16 +12,16 @@
ethereum = { version = "0.14.0", default-features = false }
# Substrate
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
# Unique
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
# Locals
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallets/evm-migration/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-migration/Cargo.toml
+++ b/pallets/evm-migration/Cargo.toml
@@ -9,15 +9,15 @@
"derive",
] }
ethereum = { version = "0.14.0", default-features = false }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[dependencies.codec]
default-features = false
pallets/evm-migration/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-migration/src/lib.rs
+++ b/pallets/evm-migration/src/lib.rs
@@ -73,6 +73,7 @@
impl<T: Config> Pallet<T> {
/// Start contract migration, inserts contract stub at target address,
/// and marks account as pending, allowing to insert storage
+ #[pallet::call_index(0)]
#[pallet::weight(<SelfWeightOf<T>>::begin())]
pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {
ensure_root(origin)?;
@@ -87,6 +88,7 @@
/// Insert items into contract storage, this method can be called
/// multiple times
+ #[pallet::call_index(1)]
#[pallet::weight(<SelfWeightOf<T>>::set_data(data.len() as u32))]
pub fn set_data(
origin: OriginFor<T>,
@@ -108,6 +110,7 @@
/// Finish contract migration, allows it to be called.
/// It is not possible to alter contract storage via [`Self::set_data`]
/// after this call.
+ #[pallet::call_index(2)]
#[pallet::weight(<SelfWeightOf<T>>::finish(code.len() as u32))]
pub fn finish(origin: OriginFor<T>, address: H160, code: Vec<u8>) -> DispatchResult {
ensure_root(origin)?;
@@ -122,6 +125,7 @@
}
/// Create ethereum events attached to the fake transaction
+ #[pallet::call_index(3)]
#[pallet::weight(<SelfWeightOf<T>>::insert_eth_logs(logs.len() as u32))]
pub fn insert_eth_logs(origin: OriginFor<T>, logs: Vec<ethereum::Log>) -> DispatchResult {
ensure_root(origin)?;
@@ -133,6 +137,7 @@
}
/// Create substrate events
+ #[pallet::call_index(4)]
#[pallet::weight(<SelfWeightOf<T>>::insert_events(events.len() as u32))]
pub fn insert_events(origin: OriginFor<T>, events: Vec<Vec<u8>>) -> DispatchResult {
ensure_root(origin)?;
pallets/evm-transaction-payment/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-transaction-payment/Cargo.toml
+++ b/pallets/evm-transaction-payment/Cargo.toml
@@ -8,17 +8,17 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[dependencies.codec]
default-features = false
pallets/foreign-assets/Cargo.tomldiffbeforeafterboth--- a/pallets/foreign-assets/Cargo.toml
+++ b/pallets/foreign-assets/Cargo.toml
@@ -1,5 +1,3 @@
-cargo-features = ["workspace-inheritance"]
-
[package]
name = "pallet-foreign-assets"
version = "0.1.0"
@@ -13,27 +11,27 @@
"derive",
] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
-sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
-sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
-frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
-frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false }
pallet-common = { default-features = false, path = '../common' }
pallet-fungible = { default-features = false, path = '../fungible' }
-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33", default-features = false }
-xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33", default-features = false }
-xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33", default-features = false }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false }
orml-tokens.workspace = true
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[dev-dependencies]
serde_json = "1.0.68"
hex = { version = "0.4" }
-sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
pallets/foreign-assets/src/impl_fungibles.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/impl_fungibles.rs
+++ b/pallets/foreign-assets/src/impl_fungibles.rs
@@ -258,6 +258,13 @@
},
}
}
+
+ fn asset_exists(asset: AssetIds) -> bool {
+ match asset {
+ AssetIds::NativeAssetId(_) => true,
+ AssetIds::ForeignAssetId(fid) => <AssetBinding<T>>::contains_key(fid),
+ }
+ }
}
impl<T: Config> fungibles::Mutate<<T as SystemConfig>::AccountId> for Pallet<T>
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -283,6 +283,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+ #[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::register_foreign_asset())]
pub fn register_foreign_asset(
origin: OriginFor<T>,
@@ -323,6 +324,7 @@
Ok(())
}
+ #[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::update_foreign_asset())]
pub fn update_foreign_asset(
origin: OriginFor<T>,
pallets/fungible/Cargo.tomldiffbeforeafterboth--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -11,19 +11,19 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-common = { default-features = false, path = '../common' }
pallet-structure = { default-features = false, path = '../structure' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
ethereum = { version = "0.14.0", default-features = false }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
pallets/inflation/Cargo.tomldiffbeforeafterboth--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -44,37 +44,37 @@
default-features = false
optional = true
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-balances]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-timestamp]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.serde]
default-features = false
@@ -84,17 +84,17 @@
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-io]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies]
scale-info = { version = "2.0.1", default-features = false, features = [
pallets/inflation/src/lib.rsdiffbeforeafterboth--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -163,6 +163,7 @@
/// # Arguments
///
/// * inflation_start_relay_block: The relay chain block at which inflation should start
+ #[pallet::call_index(0)]
#[pallet::weight(0)]
pub fn start_inflation(
origin: OriginFor<T>,
pallets/maintenance/Cargo.tomldiffbeforeafterboth--- a/pallets/maintenance/Cargo.toml
+++ b/pallets/maintenance/Cargo.toml
@@ -10,12 +10,16 @@
readme = "README.md"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
-scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
+ "derive",
+] }
+scale-info = { version = "2.1.1", default-features = false, features = [
+ "derive",
+] }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
pallets/maintenance/src/lib.rsdiffbeforeafterboth--- a/pallets/maintenance/src/lib.rs
+++ b/pallets/maintenance/src/lib.rs
@@ -55,6 +55,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+ #[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::enable())]
pub fn enable(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
@@ -66,6 +67,7 @@
Ok(())
}
+ #[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::disable())]
pub fn disable(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
pallets/nonfungible/Cargo.tomldiffbeforeafterboth--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -11,19 +11,19 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-common = { default-features = false, path = '../common' }
pallet-structure = { default-features = false, path = '../structure' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
ethereum = { version = "0.14.0", default-features = false }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
pallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-core/Cargo.toml
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -11,17 +11,17 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-common = { default-features = false, path = '../common' }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-structure = { default-features = false, path = "../../pallets/structure" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # RMRK Core Proxy Pallet18//!19//! A pallet used as proxy for RMRK Core (<https://rmrk-team.github.io/rmrk-substrate/#/pallets/rmrk-core>).20//!21//! - [`Config`]22//! - [`Call`]23//! - [`Pallet`]24//!25//! ## Overview26//!27//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core,28//! binding its externalities to Unique's own underlying structure.29//! It is purposed to mimic RMRK Core exactly, allowing seamless integrations30//! of solutions based on RMRK.31//!32//! RMRK Core itself contains essential functionality for RMRK's nested and33//! multi-resourced NFTs.34//!35//! *Note*, that while RMRK itself is subject to active development and restructuring,36//! the proxy may be caught temporarily out of date.37//!38//! ### What is RMRK?39//!40//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives.41//! Putting these legos together allows a user to create NFT systems of arbitrary complexity.42//!43//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy,44//! make use of specific changeable and partially shared metadata in the form of resources,45//! and more.46//!47//! Visit RMRK documentation and repositories to learn more:48//! - Docs: <https://docs.rmrk.app/getting-started/>49//! - FAQ: <https://coda.io/@rmrk/faq>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>52//!53//! ## Terminology54//!55//! For more information on RMRK, see RMRK's own documentation.56//!57//! ### Intro to RMRK58//!59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add60//! a piece of media on top of the root metadata (NFT's own), be it a different wing61//! on the root template bird or something entirely unrelated.62//!63//! - **Base:** A list of possible "components" - Parts, a combination of which can64//! be appended/equipped to/on an NFT.65//!66//! - **Part:** Something that, together with other Parts, can constitute an NFT.67//! Parts are defined in the Base to which they belong. Parts can be either68//! of the `slot` type or `fixed` type. Slots are intended for equippables.69//! Note that "part of something" and "Part of a Base" can be easily confused,70//! and so in this documentation these words are distinguished by the capital letter.71//!72//! - **Theme:** Named objects of variable => value pairs which get interpolated into73//! the Base's `themable` Parts. Themes can hold any value, but are often represented74//! in RMRK's examples as colors applied to visible Parts.75//!76//! ### Peculiarities in Unique77//!78//! - **Scoped properties:** Properties that are normally obscured from users.79//! Their purpose is to contain structured metadata that was not included in the Unique standard80//! for collections and tokens, meant to be operated on by proxies and other outliers.81//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is82//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined83//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with.84//!85//! - **Auxiliary properties:** A slightly different structure of properties,86//! trading universality of use for more convenient storage, writes and access.87//! Meant to be inaccessible to end users.88//!89//! ## Proxy Implementation90//!91//! An external user is supposed to be able to utilize this proxy as they would92//! utilize RMRK, and get exactly the same results. Normally, Unique transactions93//! are off-limits to RMRK collections and tokens, and vice versa. However,94//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs.95//!96//! ### ID Mapping97//!98//! RMRK's collections' IDs are counted independently of Unique's and start at 0.99//! Note that tokens' IDs still start at 1.100//! The collections themselves, as well as tokens, are stored as Unique collections,101//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa).102//!103//! ### External/Internal Collection Insulation104//!105//! A Unique transaction cannot target collections purposed for RMRK,106//! and they are flagged as `external` to specify that. On the other hand,107//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections.108//!109//! ### Native Properties110//!111//! Many of RMRK's native parameters are stored as scoped properties of a collection112//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:`113//! is an unacceptable symbol in user-defined properties, which, along with other safeguards,114//! makes them impossible to tamper with.115//!116//! ### Collection and NFT Types, or Base, Parts and Themes Handling117//!118//! RMRK introduces the concept of a Base, which is a catalogue of Parts,119//! possible components of an NFT. Due to its similarity with the functionality120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes121//! are this collection's NFTs. See [`CollectionType`] and [`NftType`].122//!123//! ## Interface124//!125//! ### Dispatchables126//!127//! - `create_collection` - Create a new collection of NFTs.128//! - `destroy_collection` - Destroy a collection.129//! - `change_collection_issuer` - Change the issuer of a collection.130//! Analogous to Unique's collection's [`owner`](up_data_structs::Collection).131//! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.**132//! - `mint_nft` - Mint an NFT in a specified collection.133//! - `burn_nft` - Burn an NFT, destroying it and its nested tokens.134//! - `send` - Transfer an NFT from an account/NFT A to another account/NFT B.135//! - `accept_nft` - Accept an NFT sent from another account to self or an owned NFT.136//! - `reject_nft` - Reject an NFT sent from another account to self or owned NFT and **burn it**.137//! - `accept_resource` - Accept the addition of a newly created pending resource to an existing NFT.138//! - `accept_resource_removal` - Accept the removal of a removal-pending resource from an NFT.139//! - `set_property` - Add or edit a custom user property of a token or a collection.140//! - `set_priority` - Set a different order of resource priorities for an NFT.141//! - `add_basic_resource` - Create and set/propose a basic resource for an NFT.142//! - `add_composable_resource` - Create and set/propose a composable resource for an NFT.143//! - `add_slot_resource` - Create and set/propose a slot resource for an NFT.144//! - `remove_resource` - Remove and erase a resource from an NFT.145146#![cfg_attr(not(feature = "std"), no_std)]147148use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};149use frame_system::{pallet_prelude::*, ensure_signed};150use sp_runtime::{DispatchError, Permill, traits::StaticLookup};151use sp_std::{152 vec::Vec,153 collections::{btree_set::BTreeSet, btree_map::BTreeMap},154};155use up_data_structs::{*, mapping::TokenAddressMapping};156use pallet_common::{157 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,158};159use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle, TokenData};160use pallet_structure::{Pallet as PalletStructure, Error as StructureError};161use pallet_evm::account::CrossAccountId;162use core::convert::AsRef;163164pub use pallet::*;165166#[cfg(feature = "runtime-benchmarks")]167pub mod benchmarking;168pub mod misc;169pub mod property;170pub mod rpc;171pub mod weights;172173pub type SelfWeightOf<T> = <T as Config>::WeightInfo;174175use weights::WeightInfo;176use misc::*;177pub use property::*;178179use RmrkProperty::*;180181/// A maximum number of levels of depth in the token nesting tree.182pub const NESTING_BUDGET: u32 = 5;183184type PendingTarget = (CollectionId, TokenId);185type PendingChild = (RmrkCollectionId, RmrkNftId);186type PendingChildrenSet = BTreeSet<PendingChild>;187188type BasesMap = BTreeMap<RmrkBaseId, u32>;189190#[frame_support::pallet]191pub mod pallet {192 use super::*;193194 #[pallet::config]195 pub trait Config:196 frame_system::Config197 + pallet_common::Config198 + pallet_nonfungible::Config199 + pallet_evm::Config200 {201 /// Overarching event type.202 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;203204 /// The weight information of this pallet.205 type WeightInfo: WeightInfo;206 }207208 /// Latest yet-unused collection ID.209 #[pallet::storage]210 #[pallet::getter(fn collection_index)]211 pub type CollectionIndex<T: Config> = StorageValue<_, RmrkCollectionId, ValueQuery>;212213 /// Mapping from RMRK collection ID to Unique's.214 #[pallet::storage]215 pub type UniqueCollectionId<T: Config> =216 StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>;217218 #[pallet::pallet]219 #[pallet::generate_store(pub(super) trait Store)]220 pub struct Pallet<T>(_);221222 #[pallet::event]223 #[pallet::generate_deposit(pub(super) fn deposit_event)]224 pub enum Event<T: Config> {225 CollectionCreated {226 issuer: T::AccountId,227 collection_id: RmrkCollectionId,228 },229 CollectionDestroyed {230 issuer: T::AccountId,231 collection_id: RmrkCollectionId,232 },233 IssuerChanged {234 old_issuer: T::AccountId,235 new_issuer: T::AccountId,236 collection_id: RmrkCollectionId,237 },238 CollectionLocked {239 issuer: T::AccountId,240 collection_id: RmrkCollectionId,241 },242 NftMinted {243 owner: T::AccountId,244 collection_id: RmrkCollectionId,245 nft_id: RmrkNftId,246 },247 NFTBurned {248 owner: T::AccountId,249 nft_id: RmrkNftId,250 },251 NFTSent {252 sender: T::AccountId,253 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,254 collection_id: RmrkCollectionId,255 nft_id: RmrkNftId,256 approval_required: bool,257 },258 NFTAccepted {259 sender: T::AccountId,260 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,261 collection_id: RmrkCollectionId,262 nft_id: RmrkNftId,263 },264 NFTRejected {265 sender: T::AccountId,266 collection_id: RmrkCollectionId,267 nft_id: RmrkNftId,268 },269 PropertySet {270 collection_id: RmrkCollectionId,271 maybe_nft_id: Option<RmrkNftId>,272 key: RmrkKeyString,273 value: RmrkValueString,274 },275 ResourceAdded {276 nft_id: RmrkNftId,277 resource_id: RmrkResourceId,278 },279 ResourceRemoval {280 nft_id: RmrkNftId,281 resource_id: RmrkResourceId,282 },283 ResourceAccepted {284 nft_id: RmrkNftId,285 resource_id: RmrkResourceId,286 },287 ResourceRemovalAccepted {288 nft_id: RmrkNftId,289 resource_id: RmrkResourceId,290 },291 PrioritySet {292 collection_id: RmrkCollectionId,293 nft_id: RmrkNftId,294 },295 }296297 #[pallet::error]298 pub enum Error<T> {299 /* Unique proxy-specific events */300 /// Property of the type of RMRK collection could not be read successfully.301 CorruptedCollectionType,302 // NftTypeEncodeError,303 /// Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH).304 RmrkPropertyKeyIsTooLong,305 /// Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH).306 RmrkPropertyValueIsTooLong,307 /// Could not find a property by the supplied key.308 RmrkPropertyIsNotFound,309 /// Something went wrong when decoding encoded data from the storage.310 /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored.311 UnableToDecodeRmrkData,312313 /* RMRK compatible events */314 /// Only destroying collections without tokens is allowed.315 CollectionNotEmpty,316 /// Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow.317 NoAvailableCollectionId,318 /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow.319 NoAvailableNftId,320 /// Collection does not exist, has a wrong type, or does not map to a Unique ID.321 CollectionUnknown,322 /// No permission to perform action.323 NoPermission,324 /// Token is marked as non-transferable, and thus cannot be transferred.325 NonTransferable,326 /// Too many tokens created in the collection, no new ones are allowed.327 CollectionFullOrLocked,328 /// No such resource found.329 ResourceDoesntExist,330 /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros.331 /// Sending to self is redundant.332 CannotSendToDescendentOrSelf,333 /// Not the target owner of the sent NFT.334 CannotAcceptNonOwnedNft,335 /// Not the target owner of the sent NFT.336 CannotRejectNonOwnedNft,337 /// NFT was not sent and is not pending.338 CannotRejectNonPendingNft,339 /// Resource is not pending for the operation.340 ResourceNotPending,341 /// Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow.342 NoAvailableResourceId,343 }344345 #[pallet::call]346 impl<T: Config> Pallet<T> {347 // todo :refactor replace every collection_id with rmrk_collection_id (and nft_id) in arguments for uniformity?348349 /// Create a new collection of NFTs.350 ///351 /// # Permissions:352 /// * Anyone - will be assigned as the issuer of the collection.353 ///354 /// # Arguments:355 /// - `origin`: sender of the transaction356 /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed.357 /// - `max`: Optional maximum number of tokens.358 /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs.359 /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed.360 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]361 pub fn create_collection(362 origin: OriginFor<T>,363 metadata: RmrkString,364 max: Option<u32>,365 symbol: RmrkCollectionSymbol,366 ) -> DispatchResult {367 let sender = ensure_signed(origin)?;368369 let limits = CollectionLimits {370 owner_can_transfer: Some(false),371 token_limit: max,372 ..Default::default()373 };374375 let data = CreateCollectionData {376 limits: Some(limits),377 token_prefix: symbol378 .into_inner()379 .try_into()380 .map_err(|_| <CommonError<T>>::CollectionTokenPrefixLimitExceeded)?,381 permissions: Some(CollectionPermissions {382 nesting: Some(NestingPermissions {383 token_owner: true,384 collection_admin: false,385 restricted: None,386 #[cfg(feature = "runtime-benchmarks")]387 permissive: false,388 }),389 ..Default::default()390 }),391 ..Default::default()392 };393394 let unique_collection_id = Self::init_collection(395 T::CrossAccountId::from_sub(sender.clone()),396 data,397 [398 Self::encode_rmrk_property(Metadata, &metadata)?,399 Self::encode_rmrk_property(CollectionType, &misc::CollectionType::Regular)?,400 ]401 .into_iter(),402 )?;403 let rmrk_collection_id = <CollectionIndex<T>>::get();404405 <UniqueCollectionId<T>>::insert(rmrk_collection_id, unique_collection_id);406407 <PalletCommon<T>>::set_scoped_collection_property(408 unique_collection_id,409 RMRK_SCOPE,410 Self::encode_rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?,411 )?;412413 <CollectionIndex<T>>::mutate(|n| *n += 1);414415 Self::deposit_event(Event::CollectionCreated {416 issuer: sender,417 collection_id: rmrk_collection_id,418 });419420 Ok(())421 }422423 /// Destroy a collection.424 ///425 /// Only empty collections can be destroyed. If it has any tokens, they must be burned first.426 ///427 /// # Permissions:428 /// * Collection issuer429 ///430 /// # Arguments:431 /// - `origin`: sender of the transaction432 /// - `collection_id`: RMRK ID of the collection to destroy.433 #[pallet::weight(<SelfWeightOf<T>>::destroy_collection())]434 pub fn destroy_collection(435 origin: OriginFor<T>,436 collection_id: RmrkCollectionId,437 ) -> DispatchResult {438 let sender = ensure_signed(origin)?;439 let cross_sender = T::CrossAccountId::from_sub(sender.clone());440441 let collection = Self::get_typed_nft_collection(442 Self::unique_collection_id(collection_id)?,443 misc::CollectionType::Regular,444 )?;445 collection.check_is_external()?;446447 <PalletNft<T>>::destroy_collection(collection, &cross_sender)448 .map_err(Self::map_unique_err_to_proxy)?;449450 Self::deposit_event(Event::CollectionDestroyed {451 issuer: sender,452 collection_id,453 });454455 Ok(())456 }457458 /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection).459 ///460 /// # Permissions:461 /// * Collection issuer462 ///463 /// # Arguments:464 /// - `origin`: sender of the transaction465 /// - `collection_id`: RMRK collection ID to change the issuer of.466 /// - `new_issuer`: Collection's new issuer.467 #[pallet::weight(<SelfWeightOf<T>>::change_collection_issuer())]468 pub fn change_collection_issuer(469 origin: OriginFor<T>,470 collection_id: RmrkCollectionId,471 new_issuer: <T::Lookup as StaticLookup>::Source,472 ) -> DispatchResult {473 let sender = ensure_signed(origin)?;474475 let collection = Self::get_nft_collection(Self::unique_collection_id(collection_id)?)?;476 collection.check_is_external()?;477478 let new_issuer = T::Lookup::lookup(new_issuer)?;479480 Self::change_collection_owner(481 Self::unique_collection_id(collection_id)?,482 misc::CollectionType::Regular,483 sender.clone(),484 new_issuer.clone(),485 )?;486487 Self::deposit_event(Event::IssuerChanged {488 old_issuer: sender,489 new_issuer,490 collection_id,491 });492493 Ok(())494 }495496 /// "Lock" the collection and prevent new token creation. Cannot be undone.497 ///498 /// # Permissions:499 /// * Collection issuer500 ///501 /// # Arguments:502 /// - `origin`: sender of the transaction503 /// - `collection_id`: RMRK ID of the collection to lock.504 #[pallet::weight(<SelfWeightOf<T>>::lock_collection())]505 pub fn lock_collection(506 origin: OriginFor<T>,507 collection_id: RmrkCollectionId,508 ) -> DispatchResult {509 let sender = ensure_signed(origin)?;510 let cross_sender = T::CrossAccountId::from_sub(sender.clone());511512 let collection = Self::get_typed_nft_collection(513 Self::unique_collection_id(collection_id)?,514 misc::CollectionType::Regular,515 )?;516 collection.check_is_external()?;517518 Self::check_collection_owner(&collection, &cross_sender)?;519520 let token_count = collection.total_supply();521522 let mut collection = collection.into_inner();523 collection.limits.token_limit = Some(token_count);524 collection.save()?;525526 Self::deposit_event(Event::CollectionLocked {527 issuer: sender,528 collection_id,529 });530531 Ok(())532 }533534 /// Mint an NFT in a specified collection.535 ///536 /// # Permissions:537 /// * Collection issuer538 ///539 /// # Arguments:540 /// - `origin`: sender of the transaction541 /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer).542 /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed.543 /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed.544 /// - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed.545 /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed.546 /// - `transferable`: Can this NFT be transferred? Cannot be changed.547 /// - `resources`: Resource data to be added to the NFT immediately after minting.548 #[pallet::weight(<SelfWeightOf<T>>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))]549 pub fn mint_nft(550 origin: OriginFor<T>,551 owner: Option<T::AccountId>,552 collection_id: RmrkCollectionId,553 recipient: Option<T::AccountId>,554 royalty_amount: Option<Permill>,555 metadata: RmrkString,556 transferable: bool,557 resources: Option<BoundedVec<RmrkResourceTypes, MaxResourcesOnMint>>,558 ) -> DispatchResult {559 let sender = ensure_signed(origin)?;560 let cross_sender = T::CrossAccountId::from_sub(sender.clone());561562 let owner = owner.unwrap_or(sender.clone());563 let cross_owner = T::CrossAccountId::from_sub(owner.clone());564565 let collection = Self::get_typed_nft_collection(566 Self::unique_collection_id(collection_id)?,567 misc::CollectionType::Regular,568 )?;569 collection.check_is_external()?;570571 let royalty_info = royalty_amount.map(|amount| rmrk_traits::RoyaltyInfo {572 recipient: recipient.unwrap_or_else(|| owner.clone()),573 amount,574 });575576 let nft_id = Self::create_nft(577 &cross_sender,578 &cross_owner,579 &collection,580 [581 Self::encode_rmrk_property(TokenType, &NftType::Regular)?,582 Self::encode_rmrk_property(Transferable, &transferable)?,583 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,584 Self::encode_rmrk_property(RoyaltyInfo, &royalty_info)?,585 Self::encode_rmrk_property(Metadata, &metadata)?,586 Self::encode_rmrk_property(Equipped, &false)?,587 Self::encode_rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,588 Self::encode_rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,589 Self::encode_rmrk_property(PendingChildren, &PendingChildrenSet::new())?,590 Self::encode_rmrk_property(AssociatedBases, &BasesMap::new())?,591 ]592 .into_iter(),593 )594 .map_err(|err| match err {595 DispatchError::Arithmetic(_) => <Error<T>>::NoAvailableNftId.into(),596 err => Self::map_unique_err_to_proxy(err),597 })?;598599 if let Some(resources) = resources {600 for resource in resources {601 Self::resource_add(sender.clone(), collection.id, nft_id, resource)?;602 }603 }604605 Self::deposit_event(Event::NftMinted {606 owner,607 collection_id,608 nft_id: nft_id.0,609 });610611 Ok(())612 }613614 /// Burn an NFT, destroying it and its nested tokens up to the specified limit.615 /// If the burning budget is exceeded, the transaction is reverted.616 ///617 /// This is the way to burn a nested token as well.618 ///619 /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively).620 ///621 /// # Permissions:622 /// * Token owner623 ///624 /// # Arguments:625 /// - `origin`: sender of the transaction626 /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to.627 /// - `nft_id`: ID of the NFT to be destroyed.628 /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction629 /// is reverted if there are more tokens to burn in the nesting tree than this number.630 /// This is primarily a mechanism of transaction weight control.631 #[pallet::weight(<SelfWeightOf<T>>::burn_nft(*max_burns))]632 pub fn burn_nft(633 origin: OriginFor<T>,634 collection_id: RmrkCollectionId,635 nft_id: RmrkNftId,636 max_burns: u32,637 ) -> DispatchResult {638 let sender = ensure_signed(origin)?;639 let cross_sender = T::CrossAccountId::from_sub(sender.clone());640641 let collection = Self::get_typed_nft_collection(642 Self::unique_collection_id(collection_id)?,643 misc::CollectionType::Regular,644 )?;645 collection.check_is_external()?;646647 Self::destroy_nft(648 cross_sender,649 Self::unique_collection_id(collection_id)?,650 nft_id.into(),651 max_burns,652 <Error<T>>::NoPermission,653 )654 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;655656 Self::deposit_event(Event::NFTBurned {657 owner: sender,658 nft_id,659 });660661 Ok(())662 }663664 /// Transfer an NFT from an account/NFT A to another account/NFT B.665 /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`].666 ///667 /// If the target owner is an NFT owned by another account, then the NFT will enter668 /// the pending state and will have to be accepted by the other account.669 ///670 /// # Permissions:671 /// - Token owner672 ///673 /// # Arguments:674 /// - `origin`: sender of the transaction675 /// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred.676 /// - `rmrk_nft_id`: ID of the NFT to be transferred.677 /// - `new_owner`: New owner of the nft which can be either an account or a NFT.678 #[pallet::weight(<SelfWeightOf<T>>::send())]679 pub fn send(680 origin: OriginFor<T>,681 rmrk_collection_id: RmrkCollectionId,682 rmrk_nft_id: RmrkNftId,683 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,684 ) -> DispatchResult {685 let sender = ensure_signed(origin.clone())?;686 let cross_sender = T::CrossAccountId::from_sub(sender.clone());687688 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;689 let nft_id = rmrk_nft_id.into();690691 let collection =692 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;693 collection.check_is_external()?;694695 let token_data =696 <TokenData<T>>::get((collection_id, nft_id)).ok_or(<Error<T>>::NoAvailableNftId)?;697698 let from = token_data.owner;699700 ensure!(701 Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)?,702 <Error<T>>::NonTransferable703 );704705 ensure!(706 Self::get_nft_property_decoded::<Option<PendingTarget>>(707 collection_id,708 nft_id,709 RmrkProperty::PendingNftAccept710 )?711 .is_none(),712 <Error<T>>::NoPermission713 );714715 let target_owner;716 let approval_required;717718 match new_owner {719 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {720 target_owner = T::CrossAccountId::from_sub(account_id.clone());721 approval_required = false;722 }723 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(724 target_collection_id,725 target_nft_id,726 ) => {727 let target_collection_id = Self::unique_collection_id(target_collection_id)?;728729 let target_nft_budget = budget::Value::new(NESTING_BUDGET);730731 let target_nft_owner = <PalletStructure<T>>::get_checked_topmost_owner(732 target_collection_id,733 target_nft_id.into(),734 Some((collection_id, nft_id)),735 &target_nft_budget,736 )737 .map_err(Self::map_unique_err_to_proxy)?;738739 approval_required = cross_sender != target_nft_owner;740741 if approval_required {742 target_owner = target_nft_owner;743744 <PalletNft<T>>::set_scoped_token_property(745 collection.id,746 nft_id,747 RMRK_SCOPE,748 Self::encode_rmrk_property::<Option<PendingTarget>>(749 PendingNftAccept,750 &Some((target_collection_id, target_nft_id.into())),751 )?,752 )?;753754 Self::insert_pending_child(755 (target_collection_id, target_nft_id.into()),756 (rmrk_collection_id, rmrk_nft_id),757 )?;758 } else {759 target_owner = T::CrossTokenAddressMapping::token_to_address(760 target_collection_id,761 target_nft_id.into(),762 );763 }764 }765 }766767 let src_nft_budget = budget::Value::new(NESTING_BUDGET);768769 <PalletNft<T>>::transfer_from(770 &collection,771 &cross_sender,772 &from,773 &target_owner,774 nft_id,775 &src_nft_budget,776 )777 .map_err(Self::map_unique_err_to_proxy)?;778779 Self::deposit_event(Event::NFTSent {780 sender,781 recipient: new_owner,782 collection_id: rmrk_collection_id,783 nft_id: rmrk_nft_id,784 approval_required,785 });786787 Ok(())788 }789790 /// Accept an NFT sent from another account to self or an owned NFT.791 ///792 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.793 ///794 /// # Permissions:795 /// - Token-owner-to-be796 ///797 /// # Arguments:798 /// - `origin`: sender of the transaction799 /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted.800 /// - `rmrk_nft_id`: ID of the NFT to be accepted.801 /// - `new_owner`: Either the sender's account ID or a sender-owned NFT,802 /// whichever the accepted NFT was sent to.803 #[pallet::weight(<SelfWeightOf<T>>::accept_nft())]804 pub fn accept_nft(805 origin: OriginFor<T>,806 rmrk_collection_id: RmrkCollectionId,807 rmrk_nft_id: RmrkNftId,808 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,809 ) -> DispatchResult {810 let sender = ensure_signed(origin.clone())?;811 let cross_sender = T::CrossAccountId::from_sub(sender.clone());812813 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;814 let nft_id = rmrk_nft_id.into();815816 let collection =817 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;818 collection.check_is_external()?;819820 let new_cross_owner = match new_owner {821 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {822 T::CrossAccountId::from_sub(account_id.clone())823 }824 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(825 target_collection_id,826 target_nft_id,827 ) => {828 let target_collection_id = Self::unique_collection_id(target_collection_id)?;829830 T::CrossTokenAddressMapping::token_to_address(831 target_collection_id,832 TokenId(target_nft_id),833 )834 }835 };836837 let budget = budget::Value::new(NESTING_BUDGET);838839 <PalletNft<T>>::transfer(840 &collection,841 &cross_sender,842 &new_cross_owner,843 nft_id,844 &budget,845 )846 .map_err(|err| {847 if err == <CommonError<T>>::UserIsNotAllowedToNest.into() {848 <Error<T>>::CannotAcceptNonOwnedNft.into()849 } else {850 Self::map_unique_err_to_proxy(err)851 }852 })?;853854 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(855 collection_id,856 nft_id,857 RmrkProperty::PendingNftAccept,858 )?;859860 if let Some(pending_target) = pending_target {861 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?;862863 <PalletNft<T>>::set_scoped_token_property(864 collection.id,865 nft_id,866 RMRK_SCOPE,867 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,868 )?;869 }870871 Self::deposit_event(Event::NFTAccepted {872 sender,873 recipient: new_owner,874 collection_id: rmrk_collection_id,875 nft_id: rmrk_nft_id,876 });877878 Ok(())879 }880881 /// Reject an NFT sent from another account to self or owned NFT.882 /// The NFT in question will not be sent back and burnt instead.883 ///884 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.885 ///886 /// # Permissions:887 /// - Token-owner-to-be-not888 ///889 /// # Arguments:890 /// - `origin`: sender of the transaction891 /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected.892 /// - `rmrk_nft_id`: ID of the NFT to be rejected.893 #[pallet::weight(<SelfWeightOf<T>>::reject_nft())]894 pub fn reject_nft(895 origin: OriginFor<T>,896 rmrk_collection_id: RmrkCollectionId,897 rmrk_nft_id: RmrkNftId,898 ) -> DispatchResult {899 let sender = ensure_signed(origin)?;900 let cross_sender = T::CrossAccountId::from_sub(sender.clone());901902 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;903 let nft_id = rmrk_nft_id.into();904905 let collection =906 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;907 collection.check_is_external()?;908909 ensure!(910 <TokenData<T>>::get((collection_id, nft_id)).is_some(),911 <Error<T>>::NoAvailableNftId912 );913914 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(915 collection_id,916 nft_id,917 RmrkProperty::PendingNftAccept,918 )?;919920 match pending_target {921 Some(pending_target) => {922 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?923 }924 None => return Err(<Error<T>>::CannotRejectNonPendingNft.into()),925 }926927 Self::destroy_nft(928 cross_sender,929 collection_id,930 nft_id,931 NESTING_BUDGET,932 <Error<T>>::CannotRejectNonOwnedNft,933 )934 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;935936 Self::deposit_event(Event::NFTRejected {937 sender,938 collection_id: rmrk_collection_id,939 nft_id: rmrk_nft_id,940 });941942 Ok(())943 }944945 /// Accept the addition of a newly created pending resource to an existing NFT.946 ///947 /// This transaction is needed when a resource is created and assigned to an NFT948 /// by a non-owner, i.e. the collection issuer, with one of the949 /// [`add_...` transactions](Pallet::add_basic_resource).950 ///951 /// # Permissions:952 /// - Token owner953 ///954 /// # Arguments:955 /// - `origin`: sender of the transaction956 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.957 /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted.958 /// - `resource_id`: ID of the newly created pending resource.959 /// accept the addition of a new resource to an existing NFT960 #[pallet::weight(<SelfWeightOf<T>>::accept_resource())]961 pub fn accept_resource(962 origin: OriginFor<T>,963 rmrk_collection_id: RmrkCollectionId,964 rmrk_nft_id: RmrkNftId,965 resource_id: RmrkResourceId,966 ) -> DispatchResult {967 let sender = ensure_signed(origin)?;968 let cross_sender = T::CrossAccountId::from_sub(sender);969970 let collection_id = Self::unique_collection_id(rmrk_collection_id)971 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;972 let collection =973 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;974 collection.check_is_external()?;975976 let nft_id = rmrk_nft_id.into();977978 let budget = budget::Value::new(NESTING_BUDGET);979980 let nft_owner =981 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)982 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;983984 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {985 ensure!(res.pending, <Error<T>>::ResourceNotPending);986 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);987988 res.pending = false;989990 Ok(())991 })?;992993 Self::deposit_event(Event::<T>::ResourceAccepted {994 nft_id: rmrk_nft_id,995 resource_id,996 });997998 Ok(())999 }10001001 /// Accept the removal of a removal-pending resource from an NFT.1002 ///1003 /// This transaction is needed when a non-owner, i.e. the collection issuer,1004 /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT.1005 ///1006 /// # Permissions:1007 /// - Token owner1008 ///1009 /// # Arguments:1010 /// - `origin`: sender of the transaction1011 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1012 /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed.1013 /// - `resource_id`: ID of the removal-pending resource.1014 #[pallet::weight(<SelfWeightOf<T>>::accept_resource_removal())]1015 pub fn accept_resource_removal(1016 origin: OriginFor<T>,1017 rmrk_collection_id: RmrkCollectionId,1018 rmrk_nft_id: RmrkNftId,1019 resource_id: RmrkResourceId,1020 ) -> DispatchResult {1021 let sender = ensure_signed(origin)?;1022 let cross_sender = T::CrossAccountId::from_sub(sender);10231024 let collection_id = Self::unique_collection_id(rmrk_collection_id)1025 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;1026 let collection =1027 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1028 collection.check_is_external()?;10291030 let nft_id = rmrk_nft_id.into();10311032 let budget = budget::Value::new(NESTING_BUDGET);10331034 let nft_owner =1035 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1036 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;10371038 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);10391040 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;10411042 let resource_info = <PalletNft<T>>::token_aux_property((1043 collection_id,1044 nft_id,1045 RMRK_SCOPE,1046 resource_id_key.clone(),1047 ))1048 .ok_or(<Error<T>>::ResourceDoesntExist)?;10491050 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource_info)?;10511052 ensure!(1053 resource_info.pending_removal,1054 <Error<T>>::ResourceNotPending1055 );10561057 <PalletNft<T>>::remove_token_aux_property(1058 collection_id,1059 nft_id,1060 RMRK_SCOPE,1061 resource_id_key,1062 );10631064 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1065 let base_id = resource.base;10661067 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1068 }10691070 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {1071 nft_id: rmrk_nft_id,1072 resource_id,1073 });10741075 Ok(())1076 }10771078 /// Add or edit a custom user property, a key-value pair, describing the metadata1079 /// of a token or a collection, on either one of these.1080 ///1081 /// Note that in this proxy implementation many details regarding RMRK are stored1082 /// as scoped properties prefixed with "rmrk:", normally inaccessible1083 /// to external transactions and RPCs.1084 ///1085 /// # Permissions:1086 /// - Collection issuer - in case of collection property1087 /// - Token owner - in case of NFT property1088 ///1089 /// # Arguments:1090 /// - `origin`: sender of the transaction1091 /// - `rmrk_collection_id`: RMRK collection ID.1092 /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection.1093 /// - `key`: Key of the custom property to be referenced by.1094 /// - `value`: Value of the custom property to be stored.1095 #[pallet::weight(<SelfWeightOf<T>>::set_property())]1096 pub fn set_property(1097 origin: OriginFor<T>,1098 #[pallet::compact] rmrk_collection_id: RmrkCollectionId,1099 maybe_nft_id: Option<RmrkNftId>,1100 key: RmrkKeyString,1101 value: RmrkValueString,1102 ) -> DispatchResult {1103 let sender = ensure_signed(origin)?;1104 let sender = T::CrossAccountId::from_sub(sender);11051106 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1107 let collection =1108 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1109 collection.check_is_external()?;11101111 let budget = budget::Value::new(NESTING_BUDGET);11121113 match maybe_nft_id {1114 Some(nft_id) => {1115 let token_id: TokenId = nft_id.into();11161117 Self::ensure_nft_type(collection_id, token_id, NftType::Regular)?;1118 Self::ensure_nft_owner(collection_id, token_id, &sender, &budget)?;11191120 <PalletNft<T>>::set_scoped_token_property(1121 collection_id,1122 token_id,1123 RMRK_SCOPE,1124 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1125 )?;1126 }1127 None => {1128 let collection = Self::get_typed_nft_collection(1129 collection_id,1130 misc::CollectionType::Regular,1131 )?;11321133 Self::check_collection_owner(&collection, &sender)?;11341135 <PalletCommon<T>>::set_scoped_collection_property(1136 collection_id,1137 RMRK_SCOPE,1138 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1139 )?;1140 }1141 }11421143 Self::deposit_event(Event::PropertySet {1144 collection_id: rmrk_collection_id,1145 maybe_nft_id,1146 key,1147 value,1148 });11491150 Ok(())1151 }11521153 /// Set a different order of resource priorities for an NFT. Priorities can be used,1154 /// for example, for order of rendering.1155 ///1156 /// Note that the priorities are not updated automatically, and are an empty vector1157 /// by default. There is no pre-set definition for the order to be particular,1158 /// it can be interpreted arbitrarily use-case by use-case.1159 ///1160 /// # Permissions:1161 /// - Token owner1162 ///1163 /// # Arguments:1164 /// - `origin`: sender of the transaction1165 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1166 /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for.1167 /// - `priorities`: Ordered vector of resource IDs.1168 #[pallet::weight(<SelfWeightOf<T>>::set_priority())]1169 pub fn set_priority(1170 origin: OriginFor<T>,1171 rmrk_collection_id: RmrkCollectionId,1172 rmrk_nft_id: RmrkNftId,1173 priorities: BoundedVec<RmrkResourceId, RmrkMaxPriorities>,1174 ) -> DispatchResult {1175 let sender = ensure_signed(origin)?;1176 let sender = T::CrossAccountId::from_sub(sender);11771178 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1179 let nft_id = rmrk_nft_id.into();11801181 let collection =1182 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1183 collection.check_is_external()?;11841185 let budget = budget::Value::new(NESTING_BUDGET);11861187 Self::ensure_nft_type(collection_id, nft_id, NftType::Regular)?;1188 Self::ensure_nft_owner(collection_id, nft_id, &sender, &budget)?;11891190 <PalletNft<T>>::set_scoped_token_property(1191 collection_id,1192 nft_id,1193 RMRK_SCOPE,1194 Self::encode_rmrk_property(ResourcePriorities, &priorities.into_inner())?,1195 )?;11961197 Self::deposit_event(Event::<T>::PrioritySet {1198 collection_id: rmrk_collection_id,1199 nft_id: rmrk_nft_id,1200 });12011202 Ok(())1203 }12041205 /// Create and set/propose a basic resource for an NFT.1206 ///1207 /// A basic resource is the simplest, lacking a Base and anything that comes with it.1208 /// See RMRK docs for more information and examples.1209 ///1210 /// # Permissions:1211 /// - Collection issuer - if not the token owner, adding the resource will warrant1212 /// the owner's [acceptance](Pallet::accept_resource).1213 ///1214 /// # Arguments:1215 /// - `origin`: sender of the transaction1216 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1217 /// - `nft_id`: ID of the NFT to assign a resource to.1218 /// - `resource`: Data of the resource to be created.1219 #[pallet::weight(<SelfWeightOf<T>>::add_basic_resource())]1220 pub fn add_basic_resource(1221 origin: OriginFor<T>,1222 rmrk_collection_id: RmrkCollectionId,1223 nft_id: RmrkNftId,1224 resource: RmrkBasicResource,1225 ) -> DispatchResult {1226 let sender = ensure_signed(origin.clone())?;12271228 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1229 let collection =1230 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1231 collection.check_is_external()?;12321233 let resource_id = Self::resource_add(1234 sender,1235 collection_id,1236 nft_id.into(),1237 RmrkResourceTypes::Basic(resource),1238 )?;12391240 Self::deposit_event(Event::ResourceAdded {1241 nft_id,1242 resource_id,1243 });1244 Ok(())1245 }12461247 /// Create and set/propose a composable resource for an NFT.1248 ///1249 /// A composable resource links to a Base and has a subset of its Parts it is composed of.1250 /// See RMRK docs for more information and examples.1251 ///1252 /// # Permissions:1253 /// - Collection issuer - if not the token owner, adding the resource will warrant1254 /// the owner's [acceptance](Pallet::accept_resource).1255 ///1256 /// # Arguments:1257 /// - `origin`: sender of the transaction1258 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1259 /// - `nft_id`: ID of the NFT to assign a resource to.1260 /// - `resource`: Data of the resource to be created.1261 #[pallet::weight(<SelfWeightOf<T>>::add_composable_resource())]1262 pub fn add_composable_resource(1263 origin: OriginFor<T>,1264 rmrk_collection_id: RmrkCollectionId,1265 nft_id: RmrkNftId,1266 resource: RmrkComposableResource,1267 ) -> DispatchResult {1268 let sender = ensure_signed(origin.clone())?;12691270 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1271 let collection =1272 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1273 collection.check_is_external()?;12741275 let base_id = resource.base;12761277 let resource_id = Self::resource_add(1278 sender,1279 collection_id,1280 nft_id.into(),1281 RmrkResourceTypes::Composable(resource),1282 )?;12831284 <PalletNft<T>>::try_mutate_token_aux_property(1285 collection_id,1286 nft_id.into(),1287 RMRK_SCOPE,1288 Self::get_scoped_property_key(AssociatedBases)?,1289 |value| -> DispatchResult {1290 let mut bases: BasesMap = match value {1291 Some(value) => Self::decode_property_value(value)?,1292 None => BasesMap::new(),1293 };12941295 *bases.entry(base_id).or_insert(0) += 1;12961297 *value = Some(Self::encode_property_value(&bases)?);1298 Ok(())1299 },1300 )?;13011302 Self::deposit_event(Event::ResourceAdded {1303 nft_id,1304 resource_id,1305 });1306 Ok(())1307 }13081309 /// Create and set/propose a slot resource for an NFT.1310 ///1311 /// A slot resource links to a Base and a slot ID in it which it can fit into.1312 /// See RMRK docs for more information and examples.1313 ///1314 /// # Permissions:1315 /// - Collection issuer - if not the token owner, adding the resource will warrant1316 /// the owner's [acceptance](Pallet::accept_resource).1317 ///1318 /// # Arguments:1319 /// - `origin`: sender of the transaction1320 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1321 /// - `nft_id`: ID of the NFT to assign a resource to.1322 /// - `resource`: Data of the resource to be created.1323 #[pallet::weight(<SelfWeightOf<T>>::add_slot_resource())]1324 pub fn add_slot_resource(1325 origin: OriginFor<T>,1326 rmrk_collection_id: RmrkCollectionId,1327 nft_id: RmrkNftId,1328 resource: RmrkSlotResource,1329 ) -> DispatchResult {1330 let sender = ensure_signed(origin.clone())?;13311332 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1333 let collection =1334 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1335 collection.check_is_external()?;13361337 let resource_id = Self::resource_add(1338 sender,1339 collection_id,1340 nft_id.into(),1341 RmrkResourceTypes::Slot(resource),1342 )?;13431344 Self::deposit_event(Event::ResourceAdded {1345 nft_id,1346 resource_id,1347 });1348 Ok(())1349 }13501351 /// Remove and erase a resource from an NFT.1352 ///1353 /// If the sender does not own the NFT, then it will be pending confirmation,1354 /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner.1355 ///1356 /// # Permissions1357 /// - Collection issuer1358 ///1359 /// # Arguments1360 /// - `origin`: sender of the transaction1361 /// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.1362 /// - `nft_id`: ID of the NFT with a resource to be removed.1363 /// - `resource_id`: ID of the resource to be removed.1364 #[pallet::weight(<SelfWeightOf<T>>::remove_resource())]1365 pub fn remove_resource(1366 origin: OriginFor<T>,1367 rmrk_collection_id: RmrkCollectionId,1368 nft_id: RmrkNftId,1369 resource_id: RmrkResourceId,1370 ) -> DispatchResult {1371 let sender = ensure_signed(origin.clone())?;13721373 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1374 let collection =1375 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1376 collection.check_is_external()?;13771378 Self::resource_remove(sender, collection_id, nft_id.into(), resource_id)?;13791380 Self::deposit_event(Event::ResourceRemoval {1381 nft_id,1382 resource_id,1383 });1384 Ok(())1385 }1386 }1387}13881389impl<T: Config> Pallet<T> {1390 /// Transform one of possible RMRK keys into a byte key with a RMRK scope.1391 pub fn get_scoped_property_key(rmrk_key: RmrkProperty) -> Result<PropertyKey, DispatchError> {1392 let key = rmrk_key.to_key::<T>()?;13931394 let scoped_key = RMRK_SCOPE1395 .apply(key)1396 .map_err(|_| <Error<T>>::RmrkPropertyKeyIsTooLong)?;13971398 Ok(scoped_key)1399 }14001401 /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet)1402 /// and encoding the value from an arbitrary type into bytes.1403 pub fn encode_rmrk_property<E: Encode>(1404 rmrk_key: RmrkProperty,1405 value: &E,1406 ) -> Result<Property, DispatchError> {1407 let key = rmrk_key.to_key::<T>()?;14081409 let value = Self::encode_property_value(value)?;14101411 let property = Property { key, value };14121413 Ok(property)1414 }14151416 /// Encode property value from an arbitrary type into bytes for storage.1417 pub fn encode_property_value<E: Encode, S: Get<u32>>(1418 value: &E,1419 ) -> Result<BoundedBytes<S>, DispatchError> {1420 let value = value1421 .encode()1422 .try_into()1423 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong)?;14241425 Ok(value)1426 }14271428 /// Decode property value from bytes into an arbitrary type.1429 pub fn decode_property_value<D: Decode, S: Get<u32>>(1430 vec: &BoundedBytes<S>,1431 ) -> Result<D, DispatchError> {1432 vec.decode()1433 .map_err(|_| <Error<T>>::UnableToDecodeRmrkData.into())1434 }14351436 /// Change the limit of a property value byte vector.1437 pub fn rebind<L, S>(vec: &BoundedVec<u8, L>) -> Result<BoundedVec<u8, S>, DispatchError>1438 where1439 BoundedVec<u8, S>: TryFrom<Vec<u8>>,1440 {1441 vec.rebind()1442 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong.into())1443 }14441445 /// Initialize a new NFT collection with certain RMRK-scoped properties.1446 ///1447 /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details.1448 fn init_collection(1449 sender: T::CrossAccountId,1450 data: CreateCollectionData<T::AccountId>,1451 properties: impl Iterator<Item = Property>,1452 ) -> Result<CollectionId, DispatchError> {1453 let collection_id = <PalletNft<T>>::init_collection(1454 sender.clone(),1455 sender,1456 data,1457 up_data_structs::CollectionFlags {1458 external: true,1459 ..Default::default()1460 },1461 );14621463 if let Err(DispatchError::Arithmetic(_)) = &collection_id {1464 return Err(<Error<T>>::NoAvailableCollectionId.into());1465 }14661467 <PalletCommon<T>>::set_scoped_collection_properties(1468 collection_id?,1469 RMRK_SCOPE,1470 properties,1471 )?;14721473 collection_id1474 }14751476 /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner.1477 ///1478 /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details.1479 pub fn create_nft(1480 sender: &T::CrossAccountId,1481 owner: &T::CrossAccountId,1482 collection: &NonfungibleHandle<T>,1483 properties: impl Iterator<Item = Property>,1484 ) -> Result<TokenId, DispatchError> {1485 let data = CreateNftExData {1486 properties: BoundedVec::default(),1487 owner: owner.clone(),1488 };14891490 let budget = budget::Value::new(NESTING_BUDGET);14911492 <PalletNft<T>>::create_item(collection, sender, data, &budget)?;14931494 let nft_id = <PalletNft<T>>::current_token_id(collection.id);14951496 <PalletNft<T>>::set_scoped_token_properties(collection.id, nft_id, RMRK_SCOPE, properties)?;14971498 Ok(nft_id)1499 }15001501 /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner.1502 ///1503 /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details.1504 fn destroy_nft(1505 sender: T::CrossAccountId,1506 collection_id: CollectionId,1507 token_id: TokenId,1508 max_burns: u32,1509 error_if_not_owned: Error<T>,1510 ) -> DispatchResultWithPostInfo {1511 let collection =1512 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;15131514 let token_data =1515 <TokenData<T>>::get((collection_id, token_id)).ok_or(<Error<T>>::NoAvailableNftId)?;15161517 let from = token_data.owner;15181519 let owner_check_budget = budget::Value::new(NESTING_BUDGET);15201521 ensure!(1522 <PalletStructure<T>>::check_indirectly_owned(1523 sender.clone(),1524 collection_id,1525 token_id,1526 None,1527 &owner_check_budget1528 )?,1529 error_if_not_owned,1530 );15311532 let burns_budget = budget::Value::new(max_burns);1533 let breadth_budget = budget::Value::new(max_burns);15341535 <PalletNft<T>>::burn_recursively(1536 &collection,1537 &from,1538 token_id,1539 &burns_budget,1540 &breadth_budget,1541 )1542 }15431544 /// Add a sent token pending acceptance to the target owning token as a property.1545 fn insert_pending_child(1546 target: (CollectionId, TokenId),1547 child: (RmrkCollectionId, RmrkNftId),1548 ) -> DispatchResult {1549 Self::mutate_pending_children(target, |pending_children| {1550 pending_children.insert(child);1551 })1552 }15531554 /// Remove a sent token pending acceptance from the target token's properties.1555 fn remove_pending_child(1556 target: (CollectionId, TokenId),1557 child: (RmrkCollectionId, RmrkNftId),1558 ) -> DispatchResult {1559 Self::mutate_pending_children(target, |pending_children| {1560 pending_children.remove(&child);1561 })1562 }15631564 /// Apply a mutation to the property of a token containing sent tokens1565 /// that are currently pending acceptance.1566 fn mutate_pending_children(1567 (target_collection_id, target_nft_id): (CollectionId, TokenId),1568 f: impl FnOnce(&mut PendingChildrenSet),1569 ) -> DispatchResult {1570 <PalletNft<T>>::try_mutate_token_aux_property(1571 target_collection_id,1572 target_nft_id,1573 RMRK_SCOPE,1574 Self::get_scoped_property_key(PendingChildren)?,1575 |pending_children| -> DispatchResult {1576 let mut map = match pending_children {1577 Some(map) => Self::decode_property_value(map)?,1578 None => PendingChildrenSet::new(),1579 };15801581 f(&mut map);15821583 *pending_children = Some(Self::encode_property_value(&map)?);15841585 Ok(())1586 },1587 )1588 }15891590 /// Get an iterator from a token's property containing tokens sent to it1591 /// that are currently pending acceptance.1592 fn iterate_pending_children(1593 collection_id: CollectionId,1594 nft_id: TokenId,1595 ) -> Result<impl Iterator<Item = PendingChild>, DispatchError> {1596 let property = <PalletNft<T>>::token_aux_property((1597 collection_id,1598 nft_id,1599 RMRK_SCOPE,1600 Self::get_scoped_property_key(PendingChildren)?,1601 ));16021603 let pending_children = match property {1604 Some(map) => Self::decode_property_value(&map)?,1605 None => PendingChildrenSet::new(),1606 };16071608 Ok(pending_children.into_iter())1609 }16101611 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1612 /// Thus, the returned resource ID should be used.1613 ///1614 /// Resource IDs are unique only across an NFT.1615 fn acquire_next_resource_id(1616 collection_id: CollectionId,1617 nft_id: TokenId,1618 ) -> Result<RmrkResourceId, DispatchError> {1619 let resource_id: RmrkResourceId =1620 Self::get_nft_property_decoded(collection_id, nft_id, NextResourceId)?;16211622 let next_id = resource_id1623 .checked_add(1)1624 .ok_or(<Error<T>>::NoAvailableResourceId)?;16251626 <PalletNft<T>>::set_scoped_token_property(1627 collection_id,1628 nft_id,1629 RMRK_SCOPE,1630 Self::encode_rmrk_property(NextResourceId, &next_id)?,1631 )?;16321633 Ok(resource_id)1634 }16351636 /// Create and add a resource for a regular NFT, mark it as pending if the sender1637 /// is not the token owner. The sender must be the collection owner.1638 fn resource_add(1639 sender: T::AccountId,1640 collection_id: CollectionId,1641 nft_id: TokenId,1642 resource: RmrkResourceTypes,1643 ) -> Result<RmrkResourceId, DispatchError> {1644 let collection =1645 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1646 ensure!(collection.owner == sender, Error::<T>::NoPermission);16471648 let sender = T::CrossAccountId::from_sub(sender);1649 let budget = budget::Value::new(NESTING_BUDGET);16501651 let nft_owner = <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1652 .map_err(Self::map_unique_err_to_proxy)?;16531654 let pending = sender != nft_owner;16551656 let id = Self::acquire_next_resource_id(collection_id, nft_id)?;16571658 let resource_info = RmrkResourceInfo {1659 id,1660 resource,1661 pending,1662 pending_removal: false,1663 };16641665 <PalletNft<T>>::try_mutate_token_aux_property(1666 collection_id,1667 nft_id,1668 RMRK_SCOPE,1669 Self::get_scoped_property_key(ResourceId(id))?,1670 |value| -> DispatchResult {1671 *value = Some(Self::encode_property_value(&resource_info)?);16721673 Ok(())1674 },1675 )?;16761677 Ok(id)1678 }16791680 /// Designate a resource for erasure from an NFT, and remove it if the sender is the token owner.1681 /// The sender must be the collection owner.1682 fn resource_remove(1683 sender: T::AccountId,1684 collection_id: CollectionId,1685 nft_id: TokenId,1686 resource_id: RmrkResourceId,1687 ) -> DispatchResult {1688 let collection =1689 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1690 ensure!(collection.owner == sender, Error::<T>::NoPermission);16911692 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;16931694 let resource = <PalletNft<T>>::token_aux_property((1695 collection_id,1696 nft_id,1697 RMRK_SCOPE,1698 resource_id_key.clone(),1699 ))1700 .ok_or(<Error<T>>::ResourceDoesntExist)?;17011702 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource)?;17031704 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1705 let topmost_owner =1706 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)?;17071708 let sender = T::CrossAccountId::from_sub(sender);1709 if topmost_owner == sender {1710 <PalletNft<T>>::remove_token_aux_property(1711 collection_id,1712 nft_id,1713 RMRK_SCOPE,1714 Self::get_scoped_property_key(ResourceId(resource_id))?,1715 );17161717 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1718 let base_id = resource.base;17191720 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1721 }1722 } else {1723 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1724 res.pending_removal = true;17251726 Ok(())1727 })?;1728 }17291730 Ok(())1731 }17321733 /// Remove a Base ID from an NFT if they are associated.1734 /// The Base itself is deleted if the number of associated NFTs reaches 0.1735 fn remove_associated_base_id(1736 collection_id: CollectionId,1737 nft_id: TokenId,1738 base_id: RmrkBaseId,1739 ) -> DispatchResult {1740 <PalletNft<T>>::try_mutate_token_aux_property(1741 collection_id,1742 nft_id,1743 RMRK_SCOPE,1744 Self::get_scoped_property_key(AssociatedBases)?,1745 |value| -> DispatchResult {1746 let mut bases: BasesMap = match value {1747 Some(value) => Self::decode_property_value(value)?,1748 None => BasesMap::new(),1749 };17501751 let remaining = bases.get(&base_id);17521753 if let Some(remaining) = remaining {1754 if let Some(0) | None = remaining.checked_sub(1) {1755 bases.remove(&base_id);1756 }1757 }17581759 *value = Some(Self::encode_property_value(&bases)?);1760 Ok(())1761 },1762 )1763 }17641765 /// Apply a mutation to a resource stored in the token properties of an NFT.1766 fn try_mutate_resource_info(1767 collection_id: CollectionId,1768 nft_id: TokenId,1769 resource_id: RmrkResourceId,1770 f: impl FnOnce(&mut RmrkResourceInfo) -> DispatchResult,1771 ) -> DispatchResult {1772 <PalletNft<T>>::try_mutate_token_aux_property(1773 collection_id,1774 nft_id,1775 RMRK_SCOPE,1776 Self::get_scoped_property_key(ResourceId(resource_id))?,1777 |value| match value {1778 Some(value) => {1779 let mut resource_info: RmrkResourceInfo = Self::decode_property_value(value)?;17801781 f(&mut resource_info)?;17821783 *value = Self::encode_property_value(&resource_info)?;17841785 Ok(())1786 }1787 None => Err(<Error<T>>::ResourceDoesntExist.into()),1788 },1789 )1790 }17911792 /// Change the owner of an NFT collection, ensuring that the sender is the current owner.1793 fn change_collection_owner(1794 collection_id: CollectionId,1795 collection_type: misc::CollectionType,1796 sender: T::AccountId,1797 new_owner: T::AccountId,1798 ) -> DispatchResult {1799 let collection = Self::get_typed_nft_collection(collection_id, collection_type)?;1800 Self::check_collection_owner(&collection, &T::CrossAccountId::from_sub(sender))?;18011802 let mut collection = collection.into_inner();18031804 collection.owner = new_owner;1805 collection.save()1806 }18071808 /// Ensure that an account is the collection owner/issuer, return an error if not.1809 pub fn check_collection_owner(1810 collection: &NonfungibleHandle<T>,1811 account: &T::CrossAccountId,1812 ) -> DispatchResult {1813 collection1814 .check_is_owner(account)1815 .map_err(Self::map_unique_err_to_proxy)1816 }18171818 /// Get the latest yet-unused RMRK collection index from the storage.1819 pub fn last_collection_idx() -> RmrkCollectionId {1820 <CollectionIndex<T>>::get()1821 }18221823 /// Get a mapping from a RMRK collection ID to its corresponding Unique collection ID.1824 pub fn unique_collection_id(1825 rmrk_collection_id: RmrkCollectionId,1826 ) -> Result<CollectionId, DispatchError> {1827 <UniqueCollectionId<T>>::try_get(rmrk_collection_id)1828 .map_err(|_| <Error<T>>::CollectionUnknown.into())1829 }18301831 /// Get a mapping from a Unique collection ID to its RMRK collection ID counterpart, if it exists.1832 pub fn rmrk_collection_id(1833 unique_collection_id: CollectionId,1834 ) -> Result<RmrkCollectionId, DispatchError> {1835 Self::get_collection_property_decoded(unique_collection_id, RmrkInternalCollectionId)1836 }18371838 /// Fetch a Unique NFT collection.1839 pub fn get_nft_collection(1840 collection_id: CollectionId,1841 ) -> Result<NonfungibleHandle<T>, DispatchError> {1842 let collection = <CollectionHandle<T>>::try_get(collection_id)1843 .map_err(|_| <Error<T>>::CollectionUnknown)?;18441845 match collection.mode {1846 CollectionMode::NFT => Ok(NonfungibleHandle::cast(collection)),1847 _ => Err(<Error<T>>::CollectionUnknown.into()),1848 }1849 }18501851 /// Check if an NFT collection with such an ID exists.1852 pub fn collection_exists(collection_id: CollectionId) -> bool {1853 <CollectionHandle<T>>::try_get(collection_id).is_ok()1854 }18551856 /// Fetch and decode a RMRK-scoped collection property value in bytes.1857 pub fn get_collection_property(1858 collection_id: CollectionId,1859 key: RmrkProperty,1860 ) -> Result<PropertyValue, DispatchError> {1861 let collection_property = <PalletCommon<T>>::collection_properties(collection_id)1862 .get(&Self::get_scoped_property_key(key)?)1863 .ok_or(<Error<T>>::CollectionUnknown)?1864 .clone();18651866 Ok(collection_property)1867 }18681869 /// Fetch a RMRK-scoped collection property and decode it from bytes into an appropriate type.1870 pub fn get_collection_property_decoded<V: Decode>(1871 collection_id: CollectionId,1872 key: RmrkProperty,1873 ) -> Result<V, DispatchError> {1874 Self::decode_property_value(&Self::get_collection_property(collection_id, key)?)1875 }18761877 /// Get the type of a collection stored as a scoped property.1878 ///1879 /// RMRK Core proxy differentiates between regular collections as well as RMRK Bases as collections.1880 pub fn get_collection_type(1881 collection_id: CollectionId,1882 ) -> Result<misc::CollectionType, DispatchError> {1883 Self::get_collection_property_decoded(collection_id, CollectionType).map_err(|err| {1884 if err != <Error<T>>::CollectionUnknown.into() {1885 <Error<T>>::CorruptedCollectionType.into()1886 } else {1887 err1888 }1889 })1890 }18911892 /// Ensure that the type of the collection equals the provided type,1893 /// otherwise return an error.1894 pub fn ensure_collection_type(1895 collection_id: CollectionId,1896 collection_type: misc::CollectionType,1897 ) -> DispatchResult {1898 let actual_type = Self::get_collection_type(collection_id)?;1899 ensure!(1900 actual_type == collection_type,1901 <CommonError<T>>::NoPermission1902 );19031904 Ok(())1905 }19061907 /// Fetch an NFT collection, but make sure it has the appropriate type.1908 pub fn get_typed_nft_collection(1909 collection_id: CollectionId,1910 collection_type: misc::CollectionType,1911 ) -> Result<NonfungibleHandle<T>, DispatchError> {1912 Self::ensure_collection_type(collection_id, collection_type)?;19131914 Self::get_nft_collection(collection_id)1915 }19161917 /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection),1918 /// but also return the Unique collection ID.1919 pub fn get_typed_nft_collection_mapped(1920 rmrk_collection_id: RmrkCollectionId,1921 collection_type: misc::CollectionType,1922 ) -> Result<(NonfungibleHandle<T>, CollectionId), DispatchError> {1923 let unique_collection_id = match collection_type {1924 misc::CollectionType::Regular => Self::unique_collection_id(rmrk_collection_id)?,1925 _ => rmrk_collection_id.into(),1926 };19271928 let collection = Self::get_typed_nft_collection(unique_collection_id, collection_type)?;19291930 Ok((collection, unique_collection_id))1931 }19321933 /// Fetch and decode a RMRK-scoped NFT property value in bytes.1934 pub fn get_nft_property(1935 collection_id: CollectionId,1936 nft_id: TokenId,1937 key: RmrkProperty,1938 ) -> Result<PropertyValue, DispatchError> {1939 let nft_property = <PalletNft<T>>::token_properties((collection_id, nft_id))1940 .get(&Self::get_scoped_property_key(key)?)1941 .ok_or(<Error<T>>::RmrkPropertyIsNotFound)?1942 .clone();19431944 Ok(nft_property)1945 }19461947 /// Fetch a RMRK-scoped NFT property and decode it from bytes into an appropriate type.1948 pub fn get_nft_property_decoded<V: Decode>(1949 collection_id: CollectionId,1950 nft_id: TokenId,1951 key: RmrkProperty,1952 ) -> Result<V, DispatchError> {1953 Self::decode_property_value(&Self::get_nft_property(collection_id, nft_id, key)?)1954 }19551956 /// Check that an NFT exists.1957 pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {1958 <TokenData<T>>::contains_key((collection_id, nft_id))1959 }19601961 /// Get the type of an NFT stored as a scoped property.1962 ///1963 /// RMRK Core proxy differentiates between regular NFTs, and RMRK Parts and Themes.1964 pub fn get_nft_type(1965 collection_id: CollectionId,1966 token_id: TokenId,1967 ) -> Result<NftType, DispatchError> {1968 Self::get_nft_property_decoded(collection_id, token_id, TokenType)1969 .map_err(|_| <Error<T>>::NoAvailableNftId.into())1970 }19711972 /// Ensure that the type of the NFT equals the provided type, otherwise return an error.1973 pub fn ensure_nft_type(1974 collection_id: CollectionId,1975 token_id: TokenId,1976 nft_type: NftType,1977 ) -> DispatchResult {1978 let actual_type = Self::get_nft_type(collection_id, token_id)?;1979 ensure!(actual_type == nft_type, <Error<T>>::NoPermission);19801981 Ok(())1982 }19831984 /// Ensure that an account is the owner of the token, either directly1985 /// or at the top of the nesting hierarchy; return an error if it is not.1986 pub fn ensure_nft_owner(1987 collection_id: CollectionId,1988 token_id: TokenId,1989 possible_owner: &T::CrossAccountId,1990 nesting_budget: &dyn budget::Budget,1991 ) -> DispatchResult {1992 let is_owned = <PalletStructure<T>>::check_indirectly_owned(1993 possible_owner.clone(),1994 collection_id,1995 token_id,1996 None,1997 nesting_budget,1998 )1999 .map_err(Self::map_unique_err_to_proxy)?;20002001 ensure!(is_owned, <Error<T>>::NoPermission);20022003 Ok(())2004 }20052006 /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied,2007 /// or, if None are provided, return all non-scoped properties.2008 pub fn filter_user_properties<Key, Value, R, Mapper>(2009 collection_id: CollectionId,2010 token_id: Option<TokenId>,2011 filter_keys: Option<Vec<RmrkPropertyKey>>,2012 mapper: Mapper,2013 ) -> Result<Vec<R>, DispatchError>2014 where2015 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2016 Value: Decode + Default,2017 Mapper: Fn(Key, Value) -> R,2018 {2019 filter_keys2020 .map(|keys| {2021 let properties = keys2022 .into_iter()2023 .filter_map(|key| {2024 let key: Key = key.try_into().ok()?;20252026 let value = match token_id {2027 Some(token_id) => Self::get_nft_property_decoded(2028 collection_id,2029 token_id,2030 UserProperty(key.as_ref()),2031 ),2032 None => Self::get_collection_property_decoded(2033 collection_id,2034 UserProperty(key.as_ref()),2035 ),2036 }2037 .ok()?;20382039 Some(mapper(key, value))2040 })2041 .collect();20422043 Ok(properties)2044 })2045 .unwrap_or_else(|| {2046 let properties =2047 Self::iterate_user_properties(collection_id, token_id, mapper)?.collect();20482049 Ok(properties)2050 })2051 }20522053 /// Get all non-scoped properties from a collection or a token, and apply some transformation,2054 /// supplied by `mapper`, to each key-value pair.2055 pub fn iterate_user_properties<Key, Value, R, Mapper>(2056 collection_id: CollectionId,2057 token_id: Option<TokenId>,2058 mapper: Mapper,2059 ) -> Result<impl Iterator<Item = R>, DispatchError>2060 where2061 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2062 Value: Decode + Default,2063 Mapper: Fn(Key, Value) -> R,2064 {2065 let properties = match token_id {2066 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),2067 None => <PalletCommon<T>>::collection_properties(collection_id),2068 };20692070 let properties = properties.into_iter().filter_map(move |(key, value)| {2071 let key = strip_key_prefix(&key, USER_PROPERTY_PREFIX)?;20722073 let key: Key = key.to_vec().try_into().ok()?;2074 let value: Value = value.decode().ok()?;20752076 Some(mapper(key, value))2077 });20782079 Ok(properties)2080 }20812082 /// Match Unique errors to RMRK's own and return the RMRK error if a match is successful.2083 fn map_unique_err_to_proxy(err: DispatchError) -> DispatchError {2084 map_unique_err_to_proxy! {2085 match err {2086 CommonError::NoPermission => NoPermission,2087 CommonError::CollectionTokenLimitExceeded => CollectionFullOrLocked,2088 CommonError::PublicMintingNotAllowed => NoPermission,2089 CommonError::TokenNotFound => NoAvailableNftId,2090 CommonError::ApprovedValueTooLow => NoPermission,2091 CommonError::CantDestroyNotEmptyCollection => CollectionNotEmpty,2092 StructureError::TokenNotFound => NoAvailableNftId,2093 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf,2094 }2095 }2096 }2097}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # RMRK Core Proxy Pallet18//!19//! A pallet used as proxy for RMRK Core (<https://rmrk-team.github.io/rmrk-substrate/#/pallets/rmrk-core>).20//!21//! - [`Config`]22//! - [`Call`]23//! - [`Pallet`]24//!25//! ## Overview26//!27//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core,28//! binding its externalities to Unique's own underlying structure.29//! It is purposed to mimic RMRK Core exactly, allowing seamless integrations30//! of solutions based on RMRK.31//!32//! RMRK Core itself contains essential functionality for RMRK's nested and33//! multi-resourced NFTs.34//!35//! *Note*, that while RMRK itself is subject to active development and restructuring,36//! the proxy may be caught temporarily out of date.37//!38//! ### What is RMRK?39//!40//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives.41//! Putting these legos together allows a user to create NFT systems of arbitrary complexity.42//!43//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy,44//! make use of specific changeable and partially shared metadata in the form of resources,45//! and more.46//!47//! Visit RMRK documentation and repositories to learn more:48//! - Docs: <https://docs.rmrk.app/getting-started/>49//! - FAQ: <https://coda.io/@rmrk/faq>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>52//!53//! ## Terminology54//!55//! For more information on RMRK, see RMRK's own documentation.56//!57//! ### Intro to RMRK58//!59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add60//! a piece of media on top of the root metadata (NFT's own), be it a different wing61//! on the root template bird or something entirely unrelated.62//!63//! - **Base:** A list of possible "components" - Parts, a combination of which can64//! be appended/equipped to/on an NFT.65//!66//! - **Part:** Something that, together with other Parts, can constitute an NFT.67//! Parts are defined in the Base to which they belong. Parts can be either68//! of the `slot` type or `fixed` type. Slots are intended for equippables.69//! Note that "part of something" and "Part of a Base" can be easily confused,70//! and so in this documentation these words are distinguished by the capital letter.71//!72//! - **Theme:** Named objects of variable => value pairs which get interpolated into73//! the Base's `themable` Parts. Themes can hold any value, but are often represented74//! in RMRK's examples as colors applied to visible Parts.75//!76//! ### Peculiarities in Unique77//!78//! - **Scoped properties:** Properties that are normally obscured from users.79//! Their purpose is to contain structured metadata that was not included in the Unique standard80//! for collections and tokens, meant to be operated on by proxies and other outliers.81//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is82//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined83//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with.84//!85//! - **Auxiliary properties:** A slightly different structure of properties,86//! trading universality of use for more convenient storage, writes and access.87//! Meant to be inaccessible to end users.88//!89//! ## Proxy Implementation90//!91//! An external user is supposed to be able to utilize this proxy as they would92//! utilize RMRK, and get exactly the same results. Normally, Unique transactions93//! are off-limits to RMRK collections and tokens, and vice versa. However,94//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs.95//!96//! ### ID Mapping97//!98//! RMRK's collections' IDs are counted independently of Unique's and start at 0.99//! Note that tokens' IDs still start at 1.100//! The collections themselves, as well as tokens, are stored as Unique collections,101//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa).102//!103//! ### External/Internal Collection Insulation104//!105//! A Unique transaction cannot target collections purposed for RMRK,106//! and they are flagged as `external` to specify that. On the other hand,107//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections.108//!109//! ### Native Properties110//!111//! Many of RMRK's native parameters are stored as scoped properties of a collection112//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:`113//! is an unacceptable symbol in user-defined properties, which, along with other safeguards,114//! makes them impossible to tamper with.115//!116//! ### Collection and NFT Types, or Base, Parts and Themes Handling117//!118//! RMRK introduces the concept of a Base, which is a catalogue of Parts,119//! possible components of an NFT. Due to its similarity with the functionality120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes121//! are this collection's NFTs. See [`CollectionType`] and [`NftType`].122//!123//! ## Interface124//!125//! ### Dispatchables126//!127//! - `create_collection` - Create a new collection of NFTs.128//! - `destroy_collection` - Destroy a collection.129//! - `change_collection_issuer` - Change the issuer of a collection.130//! Analogous to Unique's collection's [`owner`](up_data_structs::Collection).131//! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.**132//! - `mint_nft` - Mint an NFT in a specified collection.133//! - `burn_nft` - Burn an NFT, destroying it and its nested tokens.134//! - `send` - Transfer an NFT from an account/NFT A to another account/NFT B.135//! - `accept_nft` - Accept an NFT sent from another account to self or an owned NFT.136//! - `reject_nft` - Reject an NFT sent from another account to self or owned NFT and **burn it**.137//! - `accept_resource` - Accept the addition of a newly created pending resource to an existing NFT.138//! - `accept_resource_removal` - Accept the removal of a removal-pending resource from an NFT.139//! - `set_property` - Add or edit a custom user property of a token or a collection.140//! - `set_priority` - Set a different order of resource priorities for an NFT.141//! - `add_basic_resource` - Create and set/propose a basic resource for an NFT.142//! - `add_composable_resource` - Create and set/propose a composable resource for an NFT.143//! - `add_slot_resource` - Create and set/propose a slot resource for an NFT.144//! - `remove_resource` - Remove and erase a resource from an NFT.145146#![cfg_attr(not(feature = "std"), no_std)]147148use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};149use frame_system::{pallet_prelude::*, ensure_signed};150use sp_runtime::{DispatchError, Permill, traits::StaticLookup};151use sp_std::{152 vec::Vec,153 collections::{btree_set::BTreeSet, btree_map::BTreeMap},154};155use up_data_structs::{*, mapping::TokenAddressMapping};156use pallet_common::{157 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,158};159use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle, TokenData};160use pallet_structure::{Pallet as PalletStructure, Error as StructureError};161use pallet_evm::account::CrossAccountId;162use core::convert::AsRef;163164pub use pallet::*;165166#[cfg(feature = "runtime-benchmarks")]167pub mod benchmarking;168pub mod misc;169pub mod property;170pub mod rpc;171pub mod weights;172173pub type SelfWeightOf<T> = <T as Config>::WeightInfo;174175use weights::WeightInfo;176use misc::*;177pub use property::*;178179use RmrkProperty::*;180181/// A maximum number of levels of depth in the token nesting tree.182pub const NESTING_BUDGET: u32 = 5;183184type PendingTarget = (CollectionId, TokenId);185type PendingChild = (RmrkCollectionId, RmrkNftId);186type PendingChildrenSet = BTreeSet<PendingChild>;187188type BasesMap = BTreeMap<RmrkBaseId, u32>;189190#[frame_support::pallet]191pub mod pallet {192 use super::*;193194 #[pallet::config]195 pub trait Config:196 frame_system::Config197 + pallet_common::Config198 + pallet_nonfungible::Config199 + pallet_evm::Config200 {201 /// Overarching event type.202 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;203204 /// The weight information of this pallet.205 type WeightInfo: WeightInfo;206 }207208 /// Latest yet-unused collection ID.209 #[pallet::storage]210 #[pallet::getter(fn collection_index)]211 pub type CollectionIndex<T: Config> = StorageValue<_, RmrkCollectionId, ValueQuery>;212213 /// Mapping from RMRK collection ID to Unique's.214 #[pallet::storage]215 pub type UniqueCollectionId<T: Config> =216 StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>;217218 #[pallet::pallet]219 #[pallet::generate_store(pub(super) trait Store)]220 pub struct Pallet<T>(_);221222 #[pallet::event]223 #[pallet::generate_deposit(pub(super) fn deposit_event)]224 pub enum Event<T: Config> {225 CollectionCreated {226 issuer: T::AccountId,227 collection_id: RmrkCollectionId,228 },229 CollectionDestroyed {230 issuer: T::AccountId,231 collection_id: RmrkCollectionId,232 },233 IssuerChanged {234 old_issuer: T::AccountId,235 new_issuer: T::AccountId,236 collection_id: RmrkCollectionId,237 },238 CollectionLocked {239 issuer: T::AccountId,240 collection_id: RmrkCollectionId,241 },242 NftMinted {243 owner: T::AccountId,244 collection_id: RmrkCollectionId,245 nft_id: RmrkNftId,246 },247 NFTBurned {248 owner: T::AccountId,249 nft_id: RmrkNftId,250 },251 NFTSent {252 sender: T::AccountId,253 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,254 collection_id: RmrkCollectionId,255 nft_id: RmrkNftId,256 approval_required: bool,257 },258 NFTAccepted {259 sender: T::AccountId,260 recipient: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,261 collection_id: RmrkCollectionId,262 nft_id: RmrkNftId,263 },264 NFTRejected {265 sender: T::AccountId,266 collection_id: RmrkCollectionId,267 nft_id: RmrkNftId,268 },269 PropertySet {270 collection_id: RmrkCollectionId,271 maybe_nft_id: Option<RmrkNftId>,272 key: RmrkKeyString,273 value: RmrkValueString,274 },275 ResourceAdded {276 nft_id: RmrkNftId,277 resource_id: RmrkResourceId,278 },279 ResourceRemoval {280 nft_id: RmrkNftId,281 resource_id: RmrkResourceId,282 },283 ResourceAccepted {284 nft_id: RmrkNftId,285 resource_id: RmrkResourceId,286 },287 ResourceRemovalAccepted {288 nft_id: RmrkNftId,289 resource_id: RmrkResourceId,290 },291 PrioritySet {292 collection_id: RmrkCollectionId,293 nft_id: RmrkNftId,294 },295 }296297 #[pallet::error]298 pub enum Error<T> {299 /* Unique proxy-specific events */300 /// Property of the type of RMRK collection could not be read successfully.301 CorruptedCollectionType,302 // NftTypeEncodeError,303 /// Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH).304 RmrkPropertyKeyIsTooLong,305 /// Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH).306 RmrkPropertyValueIsTooLong,307 /// Could not find a property by the supplied key.308 RmrkPropertyIsNotFound,309 /// Something went wrong when decoding encoded data from the storage.310 /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored.311 UnableToDecodeRmrkData,312313 /* RMRK compatible events */314 /// Only destroying collections without tokens is allowed.315 CollectionNotEmpty,316 /// Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow.317 NoAvailableCollectionId,318 /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow.319 NoAvailableNftId,320 /// Collection does not exist, has a wrong type, or does not map to a Unique ID.321 CollectionUnknown,322 /// No permission to perform action.323 NoPermission,324 /// Token is marked as non-transferable, and thus cannot be transferred.325 NonTransferable,326 /// Too many tokens created in the collection, no new ones are allowed.327 CollectionFullOrLocked,328 /// No such resource found.329 ResourceDoesntExist,330 /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros.331 /// Sending to self is redundant.332 CannotSendToDescendentOrSelf,333 /// Not the target owner of the sent NFT.334 CannotAcceptNonOwnedNft,335 /// Not the target owner of the sent NFT.336 CannotRejectNonOwnedNft,337 /// NFT was not sent and is not pending.338 CannotRejectNonPendingNft,339 /// Resource is not pending for the operation.340 ResourceNotPending,341 /// Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow.342 NoAvailableResourceId,343 }344345 #[pallet::call]346 impl<T: Config> Pallet<T> {347 // todo :refactor replace every collection_id with rmrk_collection_id (and nft_id) in arguments for uniformity?348349 /// Create a new collection of NFTs.350 ///351 /// # Permissions:352 /// * Anyone - will be assigned as the issuer of the collection.353 ///354 /// # Arguments:355 /// - `origin`: sender of the transaction356 /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed.357 /// - `max`: Optional maximum number of tokens.358 /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs.359 /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed.360 #[pallet::call_index(0)]361 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]362 pub fn create_collection(363 origin: OriginFor<T>,364 metadata: RmrkString,365 max: Option<u32>,366 symbol: RmrkCollectionSymbol,367 ) -> DispatchResult {368 let sender = ensure_signed(origin)?;369370 let limits = CollectionLimits {371 owner_can_transfer: Some(false),372 token_limit: max,373 ..Default::default()374 };375376 let data = CreateCollectionData {377 limits: Some(limits),378 token_prefix: symbol379 .into_inner()380 .try_into()381 .map_err(|_| <CommonError<T>>::CollectionTokenPrefixLimitExceeded)?,382 permissions: Some(CollectionPermissions {383 nesting: Some(NestingPermissions {384 token_owner: true,385 collection_admin: false,386 restricted: None,387 #[cfg(feature = "runtime-benchmarks")]388 permissive: false,389 }),390 ..Default::default()391 }),392 ..Default::default()393 };394395 let unique_collection_id = Self::init_collection(396 T::CrossAccountId::from_sub(sender.clone()),397 data,398 [399 Self::encode_rmrk_property(Metadata, &metadata)?,400 Self::encode_rmrk_property(CollectionType, &misc::CollectionType::Regular)?,401 ]402 .into_iter(),403 )?;404 let rmrk_collection_id = <CollectionIndex<T>>::get();405406 <UniqueCollectionId<T>>::insert(rmrk_collection_id, unique_collection_id);407408 <PalletCommon<T>>::set_scoped_collection_property(409 unique_collection_id,410 RMRK_SCOPE,411 Self::encode_rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?,412 )?;413414 <CollectionIndex<T>>::mutate(|n| *n += 1);415416 Self::deposit_event(Event::CollectionCreated {417 issuer: sender,418 collection_id: rmrk_collection_id,419 });420421 Ok(())422 }423424 /// Destroy a collection.425 ///426 /// Only empty collections can be destroyed. If it has any tokens, they must be burned first.427 ///428 /// # Permissions:429 /// * Collection issuer430 ///431 /// # Arguments:432 /// - `origin`: sender of the transaction433 /// - `collection_id`: RMRK ID of the collection to destroy.434 #[pallet::call_index(1)]435 #[pallet::weight(<SelfWeightOf<T>>::destroy_collection())]436 pub fn destroy_collection(437 origin: OriginFor<T>,438 collection_id: RmrkCollectionId,439 ) -> DispatchResult {440 let sender = ensure_signed(origin)?;441 let cross_sender = T::CrossAccountId::from_sub(sender.clone());442443 let collection = Self::get_typed_nft_collection(444 Self::unique_collection_id(collection_id)?,445 misc::CollectionType::Regular,446 )?;447 collection.check_is_external()?;448449 <PalletNft<T>>::destroy_collection(collection, &cross_sender)450 .map_err(Self::map_unique_err_to_proxy)?;451452 Self::deposit_event(Event::CollectionDestroyed {453 issuer: sender,454 collection_id,455 });456457 Ok(())458 }459460 /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection).461 ///462 /// # Permissions:463 /// * Collection issuer464 ///465 /// # Arguments:466 /// - `origin`: sender of the transaction467 /// - `collection_id`: RMRK collection ID to change the issuer of.468 /// - `new_issuer`: Collection's new issuer.469 #[pallet::call_index(2)]470 #[pallet::weight(<SelfWeightOf<T>>::change_collection_issuer())]471 pub fn change_collection_issuer(472 origin: OriginFor<T>,473 collection_id: RmrkCollectionId,474 new_issuer: <T::Lookup as StaticLookup>::Source,475 ) -> DispatchResult {476 let sender = ensure_signed(origin)?;477478 let collection = Self::get_nft_collection(Self::unique_collection_id(collection_id)?)?;479 collection.check_is_external()?;480481 let new_issuer = T::Lookup::lookup(new_issuer)?;482483 Self::change_collection_owner(484 Self::unique_collection_id(collection_id)?,485 misc::CollectionType::Regular,486 sender.clone(),487 new_issuer.clone(),488 )?;489490 Self::deposit_event(Event::IssuerChanged {491 old_issuer: sender,492 new_issuer,493 collection_id,494 });495496 Ok(())497 }498499 /// "Lock" the collection and prevent new token creation. Cannot be undone.500 ///501 /// # Permissions:502 /// * Collection issuer503 ///504 /// # Arguments:505 /// - `origin`: sender of the transaction506 /// - `collection_id`: RMRK ID of the collection to lock.507 #[pallet::call_index(3)]508 #[pallet::weight(<SelfWeightOf<T>>::lock_collection())]509 pub fn lock_collection(510 origin: OriginFor<T>,511 collection_id: RmrkCollectionId,512 ) -> DispatchResult {513 let sender = ensure_signed(origin)?;514 let cross_sender = T::CrossAccountId::from_sub(sender.clone());515516 let collection = Self::get_typed_nft_collection(517 Self::unique_collection_id(collection_id)?,518 misc::CollectionType::Regular,519 )?;520 collection.check_is_external()?;521522 Self::check_collection_owner(&collection, &cross_sender)?;523524 let token_count = collection.total_supply();525526 let mut collection = collection.into_inner();527 collection.limits.token_limit = Some(token_count);528 collection.save()?;529530 Self::deposit_event(Event::CollectionLocked {531 issuer: sender,532 collection_id,533 });534535 Ok(())536 }537538 /// Mint an NFT in a specified collection.539 ///540 /// # Permissions:541 /// * Collection issuer542 ///543 /// # Arguments:544 /// - `origin`: sender of the transaction545 /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer).546 /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed.547 /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed.548 /// - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed.549 /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed.550 /// - `transferable`: Can this NFT be transferred? Cannot be changed.551 /// - `resources`: Resource data to be added to the NFT immediately after minting.552 #[pallet::call_index(4)]553 #[pallet::weight(<SelfWeightOf<T>>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))]554 pub fn mint_nft(555 origin: OriginFor<T>,556 owner: Option<T::AccountId>,557 collection_id: RmrkCollectionId,558 recipient: Option<T::AccountId>,559 royalty_amount: Option<Permill>,560 metadata: RmrkString,561 transferable: bool,562 resources: Option<BoundedVec<RmrkResourceTypes, MaxResourcesOnMint>>,563 ) -> DispatchResult {564 let sender = ensure_signed(origin)?;565 let cross_sender = T::CrossAccountId::from_sub(sender.clone());566567 let owner = owner.unwrap_or(sender.clone());568 let cross_owner = T::CrossAccountId::from_sub(owner.clone());569570 let collection = Self::get_typed_nft_collection(571 Self::unique_collection_id(collection_id)?,572 misc::CollectionType::Regular,573 )?;574 collection.check_is_external()?;575576 let royalty_info = royalty_amount.map(|amount| rmrk_traits::RoyaltyInfo {577 recipient: recipient.unwrap_or_else(|| owner.clone()),578 amount,579 });580581 let nft_id = Self::create_nft(582 &cross_sender,583 &cross_owner,584 &collection,585 [586 Self::encode_rmrk_property(TokenType, &NftType::Regular)?,587 Self::encode_rmrk_property(Transferable, &transferable)?,588 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,589 Self::encode_rmrk_property(RoyaltyInfo, &royalty_info)?,590 Self::encode_rmrk_property(Metadata, &metadata)?,591 Self::encode_rmrk_property(Equipped, &false)?,592 Self::encode_rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,593 Self::encode_rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,594 Self::encode_rmrk_property(PendingChildren, &PendingChildrenSet::new())?,595 Self::encode_rmrk_property(AssociatedBases, &BasesMap::new())?,596 ]597 .into_iter(),598 )599 .map_err(|err| match err {600 DispatchError::Arithmetic(_) => <Error<T>>::NoAvailableNftId.into(),601 err => Self::map_unique_err_to_proxy(err),602 })?;603604 if let Some(resources) = resources {605 for resource in resources {606 Self::resource_add(sender.clone(), collection.id, nft_id, resource)?;607 }608 }609610 Self::deposit_event(Event::NftMinted {611 owner,612 collection_id,613 nft_id: nft_id.0,614 });615616 Ok(())617 }618619 /// Burn an NFT, destroying it and its nested tokens up to the specified limit.620 /// If the burning budget is exceeded, the transaction is reverted.621 ///622 /// This is the way to burn a nested token as well.623 ///624 /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively).625 ///626 /// # Permissions:627 /// * Token owner628 ///629 /// # Arguments:630 /// - `origin`: sender of the transaction631 /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to.632 /// - `nft_id`: ID of the NFT to be destroyed.633 /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction634 /// is reverted if there are more tokens to burn in the nesting tree than this number.635 /// This is primarily a mechanism of transaction weight control.636 #[pallet::call_index(5)]637 #[pallet::weight(<SelfWeightOf<T>>::burn_nft(*max_burns))]638 pub fn burn_nft(639 origin: OriginFor<T>,640 collection_id: RmrkCollectionId,641 nft_id: RmrkNftId,642 max_burns: u32,643 ) -> DispatchResult {644 let sender = ensure_signed(origin)?;645 let cross_sender = T::CrossAccountId::from_sub(sender.clone());646647 let collection = Self::get_typed_nft_collection(648 Self::unique_collection_id(collection_id)?,649 misc::CollectionType::Regular,650 )?;651 collection.check_is_external()?;652653 Self::destroy_nft(654 cross_sender,655 Self::unique_collection_id(collection_id)?,656 nft_id.into(),657 max_burns,658 <Error<T>>::NoPermission,659 )660 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;661662 Self::deposit_event(Event::NFTBurned {663 owner: sender,664 nft_id,665 });666667 Ok(())668 }669670 /// Transfer an NFT from an account/NFT A to another account/NFT B.671 /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`].672 ///673 /// If the target owner is an NFT owned by another account, then the NFT will enter674 /// the pending state and will have to be accepted by the other account.675 ///676 /// # Permissions:677 /// - Token owner678 ///679 /// # Arguments:680 /// - `origin`: sender of the transaction681 /// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred.682 /// - `rmrk_nft_id`: ID of the NFT to be transferred.683 /// - `new_owner`: New owner of the nft which can be either an account or a NFT.684 #[pallet::call_index(6)]685 #[pallet::weight(<SelfWeightOf<T>>::send())]686 pub fn send(687 origin: OriginFor<T>,688 rmrk_collection_id: RmrkCollectionId,689 rmrk_nft_id: RmrkNftId,690 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,691 ) -> DispatchResult {692 let sender = ensure_signed(origin.clone())?;693 let cross_sender = T::CrossAccountId::from_sub(sender.clone());694695 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;696 let nft_id = rmrk_nft_id.into();697698 let collection =699 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;700 collection.check_is_external()?;701702 let token_data =703 <TokenData<T>>::get((collection_id, nft_id)).ok_or(<Error<T>>::NoAvailableNftId)?;704705 let from = token_data.owner;706707 ensure!(708 Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)?,709 <Error<T>>::NonTransferable710 );711712 ensure!(713 Self::get_nft_property_decoded::<Option<PendingTarget>>(714 collection_id,715 nft_id,716 RmrkProperty::PendingNftAccept717 )?718 .is_none(),719 <Error<T>>::NoPermission720 );721722 let target_owner;723 let approval_required;724725 match new_owner {726 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {727 target_owner = T::CrossAccountId::from_sub(account_id.clone());728 approval_required = false;729 }730 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(731 target_collection_id,732 target_nft_id,733 ) => {734 let target_collection_id = Self::unique_collection_id(target_collection_id)?;735736 let target_nft_budget = budget::Value::new(NESTING_BUDGET);737738 let target_nft_owner = <PalletStructure<T>>::get_checked_topmost_owner(739 target_collection_id,740 target_nft_id.into(),741 Some((collection_id, nft_id)),742 &target_nft_budget,743 )744 .map_err(Self::map_unique_err_to_proxy)?;745746 approval_required = cross_sender != target_nft_owner;747748 if approval_required {749 target_owner = target_nft_owner;750751 <PalletNft<T>>::set_scoped_token_property(752 collection.id,753 nft_id,754 RMRK_SCOPE,755 Self::encode_rmrk_property::<Option<PendingTarget>>(756 PendingNftAccept,757 &Some((target_collection_id, target_nft_id.into())),758 )?,759 )?;760761 Self::insert_pending_child(762 (target_collection_id, target_nft_id.into()),763 (rmrk_collection_id, rmrk_nft_id),764 )?;765 } else {766 target_owner = T::CrossTokenAddressMapping::token_to_address(767 target_collection_id,768 target_nft_id.into(),769 );770 }771 }772 }773774 let src_nft_budget = budget::Value::new(NESTING_BUDGET);775776 <PalletNft<T>>::transfer_from(777 &collection,778 &cross_sender,779 &from,780 &target_owner,781 nft_id,782 &src_nft_budget,783 )784 .map_err(Self::map_unique_err_to_proxy)?;785786 Self::deposit_event(Event::NFTSent {787 sender,788 recipient: new_owner,789 collection_id: rmrk_collection_id,790 nft_id: rmrk_nft_id,791 approval_required,792 });793794 Ok(())795 }796797 /// Accept an NFT sent from another account to self or an owned NFT.798 ///799 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.800 ///801 /// # Permissions:802 /// - Token-owner-to-be803 ///804 /// # Arguments:805 /// - `origin`: sender of the transaction806 /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted.807 /// - `rmrk_nft_id`: ID of the NFT to be accepted.808 /// - `new_owner`: Either the sender's account ID or a sender-owned NFT,809 /// whichever the accepted NFT was sent to.810 #[pallet::call_index(7)]811 #[pallet::weight(<SelfWeightOf<T>>::accept_nft())]812 pub fn accept_nft(813 origin: OriginFor<T>,814 rmrk_collection_id: RmrkCollectionId,815 rmrk_nft_id: RmrkNftId,816 new_owner: RmrkAccountIdOrCollectionNftTuple<T::AccountId>,817 ) -> DispatchResult {818 let sender = ensure_signed(origin.clone())?;819 let cross_sender = T::CrossAccountId::from_sub(sender.clone());820821 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;822 let nft_id = rmrk_nft_id.into();823824 let collection =825 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;826 collection.check_is_external()?;827828 let new_cross_owner = match new_owner {829 RmrkAccountIdOrCollectionNftTuple::AccountId(ref account_id) => {830 T::CrossAccountId::from_sub(account_id.clone())831 }832 RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(833 target_collection_id,834 target_nft_id,835 ) => {836 let target_collection_id = Self::unique_collection_id(target_collection_id)?;837838 T::CrossTokenAddressMapping::token_to_address(839 target_collection_id,840 TokenId(target_nft_id),841 )842 }843 };844845 let budget = budget::Value::new(NESTING_BUDGET);846847 <PalletNft<T>>::transfer(848 &collection,849 &cross_sender,850 &new_cross_owner,851 nft_id,852 &budget,853 )854 .map_err(|err| {855 if err == <CommonError<T>>::UserIsNotAllowedToNest.into() {856 <Error<T>>::CannotAcceptNonOwnedNft.into()857 } else {858 Self::map_unique_err_to_proxy(err)859 }860 })?;861862 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(863 collection_id,864 nft_id,865 RmrkProperty::PendingNftAccept,866 )?;867868 if let Some(pending_target) = pending_target {869 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?;870871 <PalletNft<T>>::set_scoped_token_property(872 collection.id,873 nft_id,874 RMRK_SCOPE,875 Self::encode_rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,876 )?;877 }878879 Self::deposit_event(Event::NFTAccepted {880 sender,881 recipient: new_owner,882 collection_id: rmrk_collection_id,883 nft_id: rmrk_nft_id,884 });885886 Ok(())887 }888889 /// Reject an NFT sent from another account to self or owned NFT.890 /// The NFT in question will not be sent back and burnt instead.891 ///892 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.893 ///894 /// # Permissions:895 /// - Token-owner-to-be-not896 ///897 /// # Arguments:898 /// - `origin`: sender of the transaction899 /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected.900 /// - `rmrk_nft_id`: ID of the NFT to be rejected.901 #[pallet::call_index(8)]902 #[pallet::weight(<SelfWeightOf<T>>::reject_nft())]903 pub fn reject_nft(904 origin: OriginFor<T>,905 rmrk_collection_id: RmrkCollectionId,906 rmrk_nft_id: RmrkNftId,907 ) -> DispatchResult {908 let sender = ensure_signed(origin)?;909 let cross_sender = T::CrossAccountId::from_sub(sender.clone());910911 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;912 let nft_id = rmrk_nft_id.into();913914 let collection =915 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;916 collection.check_is_external()?;917918 ensure!(919 <TokenData<T>>::get((collection_id, nft_id)).is_some(),920 <Error<T>>::NoAvailableNftId921 );922923 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(924 collection_id,925 nft_id,926 RmrkProperty::PendingNftAccept,927 )?;928929 match pending_target {930 Some(pending_target) => {931 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?932 }933 None => return Err(<Error<T>>::CannotRejectNonPendingNft.into()),934 }935936 Self::destroy_nft(937 cross_sender,938 collection_id,939 nft_id,940 NESTING_BUDGET,941 <Error<T>>::CannotRejectNonOwnedNft,942 )943 .map_err(|err| Self::map_unique_err_to_proxy(err.error))?;944945 Self::deposit_event(Event::NFTRejected {946 sender,947 collection_id: rmrk_collection_id,948 nft_id: rmrk_nft_id,949 });950951 Ok(())952 }953954 /// Accept the addition of a newly created pending resource to an existing NFT.955 ///956 /// This transaction is needed when a resource is created and assigned to an NFT957 /// by a non-owner, i.e. the collection issuer, with one of the958 /// [`add_...` transactions](Pallet::add_basic_resource).959 ///960 /// # Permissions:961 /// - Token owner962 ///963 /// # Arguments:964 /// - `origin`: sender of the transaction965 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.966 /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted.967 /// - `resource_id`: ID of the newly created pending resource.968 /// accept the addition of a new resource to an existing NFT969 #[pallet::call_index(9)]970 #[pallet::weight(<SelfWeightOf<T>>::accept_resource())]971 pub fn accept_resource(972 origin: OriginFor<T>,973 rmrk_collection_id: RmrkCollectionId,974 rmrk_nft_id: RmrkNftId,975 resource_id: RmrkResourceId,976 ) -> DispatchResult {977 let sender = ensure_signed(origin)?;978 let cross_sender = T::CrossAccountId::from_sub(sender);979980 let collection_id = Self::unique_collection_id(rmrk_collection_id)981 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;982 let collection =983 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;984 collection.check_is_external()?;985986 let nft_id = rmrk_nft_id.into();987988 let budget = budget::Value::new(NESTING_BUDGET);989990 let nft_owner =991 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)992 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;993994 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {995 ensure!(res.pending, <Error<T>>::ResourceNotPending);996 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);997998 res.pending = false;9991000 Ok(())1001 })?;10021003 Self::deposit_event(Event::<T>::ResourceAccepted {1004 nft_id: rmrk_nft_id,1005 resource_id,1006 });10071008 Ok(())1009 }10101011 /// Accept the removal of a removal-pending resource from an NFT.1012 ///1013 /// This transaction is needed when a non-owner, i.e. the collection issuer,1014 /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT.1015 ///1016 /// # Permissions:1017 /// - Token owner1018 ///1019 /// # Arguments:1020 /// - `origin`: sender of the transaction1021 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1022 /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed.1023 /// - `resource_id`: ID of the removal-pending resource.1024 #[pallet::call_index(10)]1025 #[pallet::weight(<SelfWeightOf<T>>::accept_resource_removal())]1026 pub fn accept_resource_removal(1027 origin: OriginFor<T>,1028 rmrk_collection_id: RmrkCollectionId,1029 rmrk_nft_id: RmrkNftId,1030 resource_id: RmrkResourceId,1031 ) -> DispatchResult {1032 let sender = ensure_signed(origin)?;1033 let cross_sender = T::CrossAccountId::from_sub(sender);10341035 let collection_id = Self::unique_collection_id(rmrk_collection_id)1036 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;1037 let collection =1038 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1039 collection.check_is_external()?;10401041 let nft_id = rmrk_nft_id.into();10421043 let budget = budget::Value::new(NESTING_BUDGET);10441045 let nft_owner =1046 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1047 .map_err(|_| <Error<T>>::ResourceDoesntExist)?;10481049 ensure!(cross_sender == nft_owner, <Error<T>>::NoPermission);10501051 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;10521053 let resource_info = <PalletNft<T>>::token_aux_property((1054 collection_id,1055 nft_id,1056 RMRK_SCOPE,1057 resource_id_key.clone(),1058 ))1059 .ok_or(<Error<T>>::ResourceDoesntExist)?;10601061 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource_info)?;10621063 ensure!(1064 resource_info.pending_removal,1065 <Error<T>>::ResourceNotPending1066 );10671068 <PalletNft<T>>::remove_token_aux_property(1069 collection_id,1070 nft_id,1071 RMRK_SCOPE,1072 resource_id_key,1073 );10741075 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1076 let base_id = resource.base;10771078 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1079 }10801081 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {1082 nft_id: rmrk_nft_id,1083 resource_id,1084 });10851086 Ok(())1087 }10881089 /// Add or edit a custom user property, a key-value pair, describing the metadata1090 /// of a token or a collection, on either one of these.1091 ///1092 /// Note that in this proxy implementation many details regarding RMRK are stored1093 /// as scoped properties prefixed with "rmrk:", normally inaccessible1094 /// to external transactions and RPCs.1095 ///1096 /// # Permissions:1097 /// - Collection issuer - in case of collection property1098 /// - Token owner - in case of NFT property1099 ///1100 /// # Arguments:1101 /// - `origin`: sender of the transaction1102 /// - `rmrk_collection_id`: RMRK collection ID.1103 /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection.1104 /// - `key`: Key of the custom property to be referenced by.1105 /// - `value`: Value of the custom property to be stored.1106 #[pallet::call_index(11)]1107 #[pallet::weight(<SelfWeightOf<T>>::set_property())]1108 pub fn set_property(1109 origin: OriginFor<T>,1110 #[pallet::compact] rmrk_collection_id: RmrkCollectionId,1111 maybe_nft_id: Option<RmrkNftId>,1112 key: RmrkKeyString,1113 value: RmrkValueString,1114 ) -> DispatchResult {1115 let sender = ensure_signed(origin)?;1116 let sender = T::CrossAccountId::from_sub(sender);11171118 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1119 let collection =1120 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1121 collection.check_is_external()?;11221123 let budget = budget::Value::new(NESTING_BUDGET);11241125 match maybe_nft_id {1126 Some(nft_id) => {1127 let token_id: TokenId = nft_id.into();11281129 Self::ensure_nft_type(collection_id, token_id, NftType::Regular)?;1130 Self::ensure_nft_owner(collection_id, token_id, &sender, &budget)?;11311132 <PalletNft<T>>::set_scoped_token_property(1133 collection_id,1134 token_id,1135 RMRK_SCOPE,1136 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1137 )?;1138 }1139 None => {1140 let collection = Self::get_typed_nft_collection(1141 collection_id,1142 misc::CollectionType::Regular,1143 )?;11441145 Self::check_collection_owner(&collection, &sender)?;11461147 <PalletCommon<T>>::set_scoped_collection_property(1148 collection_id,1149 RMRK_SCOPE,1150 Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?,1151 )?;1152 }1153 }11541155 Self::deposit_event(Event::PropertySet {1156 collection_id: rmrk_collection_id,1157 maybe_nft_id,1158 key,1159 value,1160 });11611162 Ok(())1163 }11641165 /// Set a different order of resource priorities for an NFT. Priorities can be used,1166 /// for example, for order of rendering.1167 ///1168 /// Note that the priorities are not updated automatically, and are an empty vector1169 /// by default. There is no pre-set definition for the order to be particular,1170 /// it can be interpreted arbitrarily use-case by use-case.1171 ///1172 /// # Permissions:1173 /// - Token owner1174 ///1175 /// # Arguments:1176 /// - `origin`: sender of the transaction1177 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1178 /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for.1179 /// - `priorities`: Ordered vector of resource IDs.1180 #[pallet::call_index(12)]1181 #[pallet::weight(<SelfWeightOf<T>>::set_priority())]1182 pub fn set_priority(1183 origin: OriginFor<T>,1184 rmrk_collection_id: RmrkCollectionId,1185 rmrk_nft_id: RmrkNftId,1186 priorities: BoundedVec<RmrkResourceId, RmrkMaxPriorities>,1187 ) -> DispatchResult {1188 let sender = ensure_signed(origin)?;1189 let sender = T::CrossAccountId::from_sub(sender);11901191 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1192 let nft_id = rmrk_nft_id.into();11931194 let collection =1195 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1196 collection.check_is_external()?;11971198 let budget = budget::Value::new(NESTING_BUDGET);11991200 Self::ensure_nft_type(collection_id, nft_id, NftType::Regular)?;1201 Self::ensure_nft_owner(collection_id, nft_id, &sender, &budget)?;12021203 <PalletNft<T>>::set_scoped_token_property(1204 collection_id,1205 nft_id,1206 RMRK_SCOPE,1207 Self::encode_rmrk_property(ResourcePriorities, &priorities.into_inner())?,1208 )?;12091210 Self::deposit_event(Event::<T>::PrioritySet {1211 collection_id: rmrk_collection_id,1212 nft_id: rmrk_nft_id,1213 });12141215 Ok(())1216 }12171218 /// Create and set/propose a basic resource for an NFT.1219 ///1220 /// A basic resource is the simplest, lacking a Base and anything that comes with it.1221 /// See RMRK docs for more information and examples.1222 ///1223 /// # Permissions:1224 /// - Collection issuer - if not the token owner, adding the resource will warrant1225 /// the owner's [acceptance](Pallet::accept_resource).1226 ///1227 /// # Arguments:1228 /// - `origin`: sender of the transaction1229 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1230 /// - `nft_id`: ID of the NFT to assign a resource to.1231 /// - `resource`: Data of the resource to be created.1232 #[pallet::call_index(13)]1233 #[pallet::weight(<SelfWeightOf<T>>::add_basic_resource())]1234 pub fn add_basic_resource(1235 origin: OriginFor<T>,1236 rmrk_collection_id: RmrkCollectionId,1237 nft_id: RmrkNftId,1238 resource: RmrkBasicResource,1239 ) -> DispatchResult {1240 let sender = ensure_signed(origin.clone())?;12411242 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1243 let collection =1244 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1245 collection.check_is_external()?;12461247 let resource_id = Self::resource_add(1248 sender,1249 collection_id,1250 nft_id.into(),1251 RmrkResourceTypes::Basic(resource),1252 )?;12531254 Self::deposit_event(Event::ResourceAdded {1255 nft_id,1256 resource_id,1257 });1258 Ok(())1259 }12601261 /// Create and set/propose a composable resource for an NFT.1262 ///1263 /// A composable resource links to a Base and has a subset of its Parts it is composed of.1264 /// See RMRK docs for more information and examples.1265 ///1266 /// # Permissions:1267 /// - Collection issuer - if not the token owner, adding the resource will warrant1268 /// the owner's [acceptance](Pallet::accept_resource).1269 ///1270 /// # Arguments:1271 /// - `origin`: sender of the transaction1272 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1273 /// - `nft_id`: ID of the NFT to assign a resource to.1274 /// - `resource`: Data of the resource to be created.1275 #[pallet::call_index(14)]1276 #[pallet::weight(<SelfWeightOf<T>>::add_composable_resource())]1277 pub fn add_composable_resource(1278 origin: OriginFor<T>,1279 rmrk_collection_id: RmrkCollectionId,1280 nft_id: RmrkNftId,1281 resource: RmrkComposableResource,1282 ) -> DispatchResult {1283 let sender = ensure_signed(origin.clone())?;12841285 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1286 let collection =1287 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1288 collection.check_is_external()?;12891290 let base_id = resource.base;12911292 let resource_id = Self::resource_add(1293 sender,1294 collection_id,1295 nft_id.into(),1296 RmrkResourceTypes::Composable(resource),1297 )?;12981299 <PalletNft<T>>::try_mutate_token_aux_property(1300 collection_id,1301 nft_id.into(),1302 RMRK_SCOPE,1303 Self::get_scoped_property_key(AssociatedBases)?,1304 |value| -> DispatchResult {1305 let mut bases: BasesMap = match value {1306 Some(value) => Self::decode_property_value(value)?,1307 None => BasesMap::new(),1308 };13091310 *bases.entry(base_id).or_insert(0) += 1;13111312 *value = Some(Self::encode_property_value(&bases)?);1313 Ok(())1314 },1315 )?;13161317 Self::deposit_event(Event::ResourceAdded {1318 nft_id,1319 resource_id,1320 });1321 Ok(())1322 }13231324 /// Create and set/propose a slot resource for an NFT.1325 ///1326 /// A slot resource links to a Base and a slot ID in it which it can fit into.1327 /// See RMRK docs for more information and examples.1328 ///1329 /// # Permissions:1330 /// - Collection issuer - if not the token owner, adding the resource will warrant1331 /// the owner's [acceptance](Pallet::accept_resource).1332 ///1333 /// # Arguments:1334 /// - `origin`: sender of the transaction1335 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1336 /// - `nft_id`: ID of the NFT to assign a resource to.1337 /// - `resource`: Data of the resource to be created.1338 #[pallet::call_index(15)]1339 #[pallet::weight(<SelfWeightOf<T>>::add_slot_resource())]1340 pub fn add_slot_resource(1341 origin: OriginFor<T>,1342 rmrk_collection_id: RmrkCollectionId,1343 nft_id: RmrkNftId,1344 resource: RmrkSlotResource,1345 ) -> DispatchResult {1346 let sender = ensure_signed(origin.clone())?;13471348 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1349 let collection =1350 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1351 collection.check_is_external()?;13521353 let resource_id = Self::resource_add(1354 sender,1355 collection_id,1356 nft_id.into(),1357 RmrkResourceTypes::Slot(resource),1358 )?;13591360 Self::deposit_event(Event::ResourceAdded {1361 nft_id,1362 resource_id,1363 });1364 Ok(())1365 }13661367 /// Remove and erase a resource from an NFT.1368 ///1369 /// If the sender does not own the NFT, then it will be pending confirmation,1370 /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner.1371 ///1372 /// # Permissions1373 /// - Collection issuer1374 ///1375 /// # Arguments1376 /// - `origin`: sender of the transaction1377 /// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.1378 /// - `nft_id`: ID of the NFT with a resource to be removed.1379 /// - `resource_id`: ID of the resource to be removed.1380 #[pallet::call_index(16)]1381 #[pallet::weight(<SelfWeightOf<T>>::remove_resource())]1382 pub fn remove_resource(1383 origin: OriginFor<T>,1384 rmrk_collection_id: RmrkCollectionId,1385 nft_id: RmrkNftId,1386 resource_id: RmrkResourceId,1387 ) -> DispatchResult {1388 let sender = ensure_signed(origin.clone())?;13891390 let collection_id = Self::unique_collection_id(rmrk_collection_id)?;1391 let collection =1392 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1393 collection.check_is_external()?;13941395 Self::resource_remove(sender, collection_id, nft_id.into(), resource_id)?;13961397 Self::deposit_event(Event::ResourceRemoval {1398 nft_id,1399 resource_id,1400 });1401 Ok(())1402 }1403 }1404}14051406impl<T: Config> Pallet<T> {1407 /// Transform one of possible RMRK keys into a byte key with a RMRK scope.1408 pub fn get_scoped_property_key(rmrk_key: RmrkProperty) -> Result<PropertyKey, DispatchError> {1409 let key = rmrk_key.to_key::<T>()?;14101411 let scoped_key = RMRK_SCOPE1412 .apply(key)1413 .map_err(|_| <Error<T>>::RmrkPropertyKeyIsTooLong)?;14141415 Ok(scoped_key)1416 }14171418 /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet)1419 /// and encoding the value from an arbitrary type into bytes.1420 pub fn encode_rmrk_property<E: Encode>(1421 rmrk_key: RmrkProperty,1422 value: &E,1423 ) -> Result<Property, DispatchError> {1424 let key = rmrk_key.to_key::<T>()?;14251426 let value = Self::encode_property_value(value)?;14271428 let property = Property { key, value };14291430 Ok(property)1431 }14321433 /// Encode property value from an arbitrary type into bytes for storage.1434 pub fn encode_property_value<E: Encode, S: Get<u32>>(1435 value: &E,1436 ) -> Result<BoundedBytes<S>, DispatchError> {1437 let value = value1438 .encode()1439 .try_into()1440 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong)?;14411442 Ok(value)1443 }14441445 /// Decode property value from bytes into an arbitrary type.1446 pub fn decode_property_value<D: Decode, S: Get<u32>>(1447 vec: &BoundedBytes<S>,1448 ) -> Result<D, DispatchError> {1449 vec.decode()1450 .map_err(|_| <Error<T>>::UnableToDecodeRmrkData.into())1451 }14521453 /// Change the limit of a property value byte vector.1454 pub fn rebind<L, S>(vec: &BoundedVec<u8, L>) -> Result<BoundedVec<u8, S>, DispatchError>1455 where1456 BoundedVec<u8, S>: TryFrom<Vec<u8>>,1457 {1458 vec.rebind()1459 .map_err(|_| <Error<T>>::RmrkPropertyValueIsTooLong.into())1460 }14611462 /// Initialize a new NFT collection with certain RMRK-scoped properties.1463 ///1464 /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details.1465 fn init_collection(1466 sender: T::CrossAccountId,1467 data: CreateCollectionData<T::AccountId>,1468 properties: impl Iterator<Item = Property>,1469 ) -> Result<CollectionId, DispatchError> {1470 let collection_id = <PalletNft<T>>::init_collection(1471 sender.clone(),1472 sender,1473 data,1474 up_data_structs::CollectionFlags {1475 external: true,1476 ..Default::default()1477 },1478 );14791480 if let Err(DispatchError::Arithmetic(_)) = &collection_id {1481 return Err(<Error<T>>::NoAvailableCollectionId.into());1482 }14831484 <PalletCommon<T>>::set_scoped_collection_properties(1485 collection_id?,1486 RMRK_SCOPE,1487 properties,1488 )?;14891490 collection_id1491 }14921493 /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner.1494 ///1495 /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details.1496 pub fn create_nft(1497 sender: &T::CrossAccountId,1498 owner: &T::CrossAccountId,1499 collection: &NonfungibleHandle<T>,1500 properties: impl Iterator<Item = Property>,1501 ) -> Result<TokenId, DispatchError> {1502 let data = CreateNftExData {1503 properties: BoundedVec::default(),1504 owner: owner.clone(),1505 };15061507 let budget = budget::Value::new(NESTING_BUDGET);15081509 <PalletNft<T>>::create_item(collection, sender, data, &budget)?;15101511 let nft_id = <PalletNft<T>>::current_token_id(collection.id);15121513 <PalletNft<T>>::set_scoped_token_properties(collection.id, nft_id, RMRK_SCOPE, properties)?;15141515 Ok(nft_id)1516 }15171518 /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner.1519 ///1520 /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details.1521 fn destroy_nft(1522 sender: T::CrossAccountId,1523 collection_id: CollectionId,1524 token_id: TokenId,1525 max_burns: u32,1526 error_if_not_owned: Error<T>,1527 ) -> DispatchResultWithPostInfo {1528 let collection =1529 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;15301531 let token_data =1532 <TokenData<T>>::get((collection_id, token_id)).ok_or(<Error<T>>::NoAvailableNftId)?;15331534 let from = token_data.owner;15351536 let owner_check_budget = budget::Value::new(NESTING_BUDGET);15371538 ensure!(1539 <PalletStructure<T>>::check_indirectly_owned(1540 sender.clone(),1541 collection_id,1542 token_id,1543 None,1544 &owner_check_budget1545 )?,1546 error_if_not_owned,1547 );15481549 let burns_budget = budget::Value::new(max_burns);1550 let breadth_budget = budget::Value::new(max_burns);15511552 <PalletNft<T>>::burn_recursively(1553 &collection,1554 &from,1555 token_id,1556 &burns_budget,1557 &breadth_budget,1558 )1559 }15601561 /// Add a sent token pending acceptance to the target owning token as a property.1562 fn insert_pending_child(1563 target: (CollectionId, TokenId),1564 child: (RmrkCollectionId, RmrkNftId),1565 ) -> DispatchResult {1566 Self::mutate_pending_children(target, |pending_children| {1567 pending_children.insert(child);1568 })1569 }15701571 /// Remove a sent token pending acceptance from the target token's properties.1572 fn remove_pending_child(1573 target: (CollectionId, TokenId),1574 child: (RmrkCollectionId, RmrkNftId),1575 ) -> DispatchResult {1576 Self::mutate_pending_children(target, |pending_children| {1577 pending_children.remove(&child);1578 })1579 }15801581 /// Apply a mutation to the property of a token containing sent tokens1582 /// that are currently pending acceptance.1583 fn mutate_pending_children(1584 (target_collection_id, target_nft_id): (CollectionId, TokenId),1585 f: impl FnOnce(&mut PendingChildrenSet),1586 ) -> DispatchResult {1587 <PalletNft<T>>::try_mutate_token_aux_property(1588 target_collection_id,1589 target_nft_id,1590 RMRK_SCOPE,1591 Self::get_scoped_property_key(PendingChildren)?,1592 |pending_children| -> DispatchResult {1593 let mut map = match pending_children {1594 Some(map) => Self::decode_property_value(map)?,1595 None => PendingChildrenSet::new(),1596 };15971598 f(&mut map);15991600 *pending_children = Some(Self::encode_property_value(&map)?);16011602 Ok(())1603 },1604 )1605 }16061607 /// Get an iterator from a token's property containing tokens sent to it1608 /// that are currently pending acceptance.1609 fn iterate_pending_children(1610 collection_id: CollectionId,1611 nft_id: TokenId,1612 ) -> Result<impl Iterator<Item = PendingChild>, DispatchError> {1613 let property = <PalletNft<T>>::token_aux_property((1614 collection_id,1615 nft_id,1616 RMRK_SCOPE,1617 Self::get_scoped_property_key(PendingChildren)?,1618 ));16191620 let pending_children = match property {1621 Some(map) => Self::decode_property_value(&map)?,1622 None => PendingChildrenSet::new(),1623 };16241625 Ok(pending_children.into_iter())1626 }16271628 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1629 /// Thus, the returned resource ID should be used.1630 ///1631 /// Resource IDs are unique only across an NFT.1632 fn acquire_next_resource_id(1633 collection_id: CollectionId,1634 nft_id: TokenId,1635 ) -> Result<RmrkResourceId, DispatchError> {1636 let resource_id: RmrkResourceId =1637 Self::get_nft_property_decoded(collection_id, nft_id, NextResourceId)?;16381639 let next_id = resource_id1640 .checked_add(1)1641 .ok_or(<Error<T>>::NoAvailableResourceId)?;16421643 <PalletNft<T>>::set_scoped_token_property(1644 collection_id,1645 nft_id,1646 RMRK_SCOPE,1647 Self::encode_rmrk_property(NextResourceId, &next_id)?,1648 )?;16491650 Ok(resource_id)1651 }16521653 /// Create and add a resource for a regular NFT, mark it as pending if the sender1654 /// is not the token owner. The sender must be the collection owner.1655 fn resource_add(1656 sender: T::AccountId,1657 collection_id: CollectionId,1658 nft_id: TokenId,1659 resource: RmrkResourceTypes,1660 ) -> Result<RmrkResourceId, DispatchError> {1661 let collection =1662 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1663 ensure!(collection.owner == sender, Error::<T>::NoPermission);16641665 let sender = T::CrossAccountId::from_sub(sender);1666 let budget = budget::Value::new(NESTING_BUDGET);16671668 let nft_owner = <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)1669 .map_err(Self::map_unique_err_to_proxy)?;16701671 let pending = sender != nft_owner;16721673 let id = Self::acquire_next_resource_id(collection_id, nft_id)?;16741675 let resource_info = RmrkResourceInfo {1676 id,1677 resource,1678 pending,1679 pending_removal: false,1680 };16811682 <PalletNft<T>>::try_mutate_token_aux_property(1683 collection_id,1684 nft_id,1685 RMRK_SCOPE,1686 Self::get_scoped_property_key(ResourceId(id))?,1687 |value| -> DispatchResult {1688 *value = Some(Self::encode_property_value(&resource_info)?);16891690 Ok(())1691 },1692 )?;16931694 Ok(id)1695 }16961697 /// Designate a resource for erasure from an NFT, and remove it if the sender is the token owner.1698 /// The sender must be the collection owner.1699 fn resource_remove(1700 sender: T::AccountId,1701 collection_id: CollectionId,1702 nft_id: TokenId,1703 resource_id: RmrkResourceId,1704 ) -> DispatchResult {1705 let collection =1706 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;1707 ensure!(collection.owner == sender, Error::<T>::NoPermission);17081709 let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?;17101711 let resource = <PalletNft<T>>::token_aux_property((1712 collection_id,1713 nft_id,1714 RMRK_SCOPE,1715 resource_id_key.clone(),1716 ))1717 .ok_or(<Error<T>>::ResourceDoesntExist)?;17181719 let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource)?;17201721 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1722 let topmost_owner =1723 <PalletStructure<T>>::find_topmost_owner(collection_id, nft_id, &budget)?;17241725 let sender = T::CrossAccountId::from_sub(sender);1726 if topmost_owner == sender {1727 <PalletNft<T>>::remove_token_aux_property(1728 collection_id,1729 nft_id,1730 RMRK_SCOPE,1731 Self::get_scoped_property_key(ResourceId(resource_id))?,1732 );17331734 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1735 let base_id = resource.base;17361737 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1738 }1739 } else {1740 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1741 res.pending_removal = true;17421743 Ok(())1744 })?;1745 }17461747 Ok(())1748 }17491750 /// Remove a Base ID from an NFT if they are associated.1751 /// The Base itself is deleted if the number of associated NFTs reaches 0.1752 fn remove_associated_base_id(1753 collection_id: CollectionId,1754 nft_id: TokenId,1755 base_id: RmrkBaseId,1756 ) -> DispatchResult {1757 <PalletNft<T>>::try_mutate_token_aux_property(1758 collection_id,1759 nft_id,1760 RMRK_SCOPE,1761 Self::get_scoped_property_key(AssociatedBases)?,1762 |value| -> DispatchResult {1763 let mut bases: BasesMap = match value {1764 Some(value) => Self::decode_property_value(value)?,1765 None => BasesMap::new(),1766 };17671768 let remaining = bases.get(&base_id);17691770 if let Some(remaining) = remaining {1771 if let Some(0) | None = remaining.checked_sub(1) {1772 bases.remove(&base_id);1773 }1774 }17751776 *value = Some(Self::encode_property_value(&bases)?);1777 Ok(())1778 },1779 )1780 }17811782 /// Apply a mutation to a resource stored in the token properties of an NFT.1783 fn try_mutate_resource_info(1784 collection_id: CollectionId,1785 nft_id: TokenId,1786 resource_id: RmrkResourceId,1787 f: impl FnOnce(&mut RmrkResourceInfo) -> DispatchResult,1788 ) -> DispatchResult {1789 <PalletNft<T>>::try_mutate_token_aux_property(1790 collection_id,1791 nft_id,1792 RMRK_SCOPE,1793 Self::get_scoped_property_key(ResourceId(resource_id))?,1794 |value| match value {1795 Some(value) => {1796 let mut resource_info: RmrkResourceInfo = Self::decode_property_value(value)?;17971798 f(&mut resource_info)?;17991800 *value = Self::encode_property_value(&resource_info)?;18011802 Ok(())1803 }1804 None => Err(<Error<T>>::ResourceDoesntExist.into()),1805 },1806 )1807 }18081809 /// Change the owner of an NFT collection, ensuring that the sender is the current owner.1810 fn change_collection_owner(1811 collection_id: CollectionId,1812 collection_type: misc::CollectionType,1813 sender: T::AccountId,1814 new_owner: T::AccountId,1815 ) -> DispatchResult {1816 let collection = Self::get_typed_nft_collection(collection_id, collection_type)?;1817 Self::check_collection_owner(&collection, &T::CrossAccountId::from_sub(sender))?;18181819 let mut collection = collection.into_inner();18201821 collection.owner = new_owner;1822 collection.save()1823 }18241825 /// Ensure that an account is the collection owner/issuer, return an error if not.1826 pub fn check_collection_owner(1827 collection: &NonfungibleHandle<T>,1828 account: &T::CrossAccountId,1829 ) -> DispatchResult {1830 collection1831 .check_is_owner(account)1832 .map_err(Self::map_unique_err_to_proxy)1833 }18341835 /// Get the latest yet-unused RMRK collection index from the storage.1836 pub fn last_collection_idx() -> RmrkCollectionId {1837 <CollectionIndex<T>>::get()1838 }18391840 /// Get a mapping from a RMRK collection ID to its corresponding Unique collection ID.1841 pub fn unique_collection_id(1842 rmrk_collection_id: RmrkCollectionId,1843 ) -> Result<CollectionId, DispatchError> {1844 <UniqueCollectionId<T>>::try_get(rmrk_collection_id)1845 .map_err(|_| <Error<T>>::CollectionUnknown.into())1846 }18471848 /// Get a mapping from a Unique collection ID to its RMRK collection ID counterpart, if it exists.1849 pub fn rmrk_collection_id(1850 unique_collection_id: CollectionId,1851 ) -> Result<RmrkCollectionId, DispatchError> {1852 Self::get_collection_property_decoded(unique_collection_id, RmrkInternalCollectionId)1853 }18541855 /// Fetch a Unique NFT collection.1856 pub fn get_nft_collection(1857 collection_id: CollectionId,1858 ) -> Result<NonfungibleHandle<T>, DispatchError> {1859 let collection = <CollectionHandle<T>>::try_get(collection_id)1860 .map_err(|_| <Error<T>>::CollectionUnknown)?;18611862 match collection.mode {1863 CollectionMode::NFT => Ok(NonfungibleHandle::cast(collection)),1864 _ => Err(<Error<T>>::CollectionUnknown.into()),1865 }1866 }18671868 /// Check if an NFT collection with such an ID exists.1869 pub fn collection_exists(collection_id: CollectionId) -> bool {1870 <CollectionHandle<T>>::try_get(collection_id).is_ok()1871 }18721873 /// Fetch and decode a RMRK-scoped collection property value in bytes.1874 pub fn get_collection_property(1875 collection_id: CollectionId,1876 key: RmrkProperty,1877 ) -> Result<PropertyValue, DispatchError> {1878 let collection_property = <PalletCommon<T>>::collection_properties(collection_id)1879 .get(&Self::get_scoped_property_key(key)?)1880 .ok_or(<Error<T>>::CollectionUnknown)?1881 .clone();18821883 Ok(collection_property)1884 }18851886 /// Fetch a RMRK-scoped collection property and decode it from bytes into an appropriate type.1887 pub fn get_collection_property_decoded<V: Decode>(1888 collection_id: CollectionId,1889 key: RmrkProperty,1890 ) -> Result<V, DispatchError> {1891 Self::decode_property_value(&Self::get_collection_property(collection_id, key)?)1892 }18931894 /// Get the type of a collection stored as a scoped property.1895 ///1896 /// RMRK Core proxy differentiates between regular collections as well as RMRK Bases as collections.1897 pub fn get_collection_type(1898 collection_id: CollectionId,1899 ) -> Result<misc::CollectionType, DispatchError> {1900 Self::get_collection_property_decoded(collection_id, CollectionType).map_err(|err| {1901 if err != <Error<T>>::CollectionUnknown.into() {1902 <Error<T>>::CorruptedCollectionType.into()1903 } else {1904 err1905 }1906 })1907 }19081909 /// Ensure that the type of the collection equals the provided type,1910 /// otherwise return an error.1911 pub fn ensure_collection_type(1912 collection_id: CollectionId,1913 collection_type: misc::CollectionType,1914 ) -> DispatchResult {1915 let actual_type = Self::get_collection_type(collection_id)?;1916 ensure!(1917 actual_type == collection_type,1918 <CommonError<T>>::NoPermission1919 );19201921 Ok(())1922 }19231924 /// Fetch an NFT collection, but make sure it has the appropriate type.1925 pub fn get_typed_nft_collection(1926 collection_id: CollectionId,1927 collection_type: misc::CollectionType,1928 ) -> Result<NonfungibleHandle<T>, DispatchError> {1929 Self::ensure_collection_type(collection_id, collection_type)?;19301931 Self::get_nft_collection(collection_id)1932 }19331934 /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection),1935 /// but also return the Unique collection ID.1936 pub fn get_typed_nft_collection_mapped(1937 rmrk_collection_id: RmrkCollectionId,1938 collection_type: misc::CollectionType,1939 ) -> Result<(NonfungibleHandle<T>, CollectionId), DispatchError> {1940 let unique_collection_id = match collection_type {1941 misc::CollectionType::Regular => Self::unique_collection_id(rmrk_collection_id)?,1942 _ => rmrk_collection_id.into(),1943 };19441945 let collection = Self::get_typed_nft_collection(unique_collection_id, collection_type)?;19461947 Ok((collection, unique_collection_id))1948 }19491950 /// Fetch and decode a RMRK-scoped NFT property value in bytes.1951 pub fn get_nft_property(1952 collection_id: CollectionId,1953 nft_id: TokenId,1954 key: RmrkProperty,1955 ) -> Result<PropertyValue, DispatchError> {1956 let nft_property = <PalletNft<T>>::token_properties((collection_id, nft_id))1957 .get(&Self::get_scoped_property_key(key)?)1958 .ok_or(<Error<T>>::RmrkPropertyIsNotFound)?1959 .clone();19601961 Ok(nft_property)1962 }19631964 /// Fetch a RMRK-scoped NFT property and decode it from bytes into an appropriate type.1965 pub fn get_nft_property_decoded<V: Decode>(1966 collection_id: CollectionId,1967 nft_id: TokenId,1968 key: RmrkProperty,1969 ) -> Result<V, DispatchError> {1970 Self::decode_property_value(&Self::get_nft_property(collection_id, nft_id, key)?)1971 }19721973 /// Check that an NFT exists.1974 pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {1975 <TokenData<T>>::contains_key((collection_id, nft_id))1976 }19771978 /// Get the type of an NFT stored as a scoped property.1979 ///1980 /// RMRK Core proxy differentiates between regular NFTs, and RMRK Parts and Themes.1981 pub fn get_nft_type(1982 collection_id: CollectionId,1983 token_id: TokenId,1984 ) -> Result<NftType, DispatchError> {1985 Self::get_nft_property_decoded(collection_id, token_id, TokenType)1986 .map_err(|_| <Error<T>>::NoAvailableNftId.into())1987 }19881989 /// Ensure that the type of the NFT equals the provided type, otherwise return an error.1990 pub fn ensure_nft_type(1991 collection_id: CollectionId,1992 token_id: TokenId,1993 nft_type: NftType,1994 ) -> DispatchResult {1995 let actual_type = Self::get_nft_type(collection_id, token_id)?;1996 ensure!(actual_type == nft_type, <Error<T>>::NoPermission);19971998 Ok(())1999 }20002001 /// Ensure that an account is the owner of the token, either directly2002 /// or at the top of the nesting hierarchy; return an error if it is not.2003 pub fn ensure_nft_owner(2004 collection_id: CollectionId,2005 token_id: TokenId,2006 possible_owner: &T::CrossAccountId,2007 nesting_budget: &dyn budget::Budget,2008 ) -> DispatchResult {2009 let is_owned = <PalletStructure<T>>::check_indirectly_owned(2010 possible_owner.clone(),2011 collection_id,2012 token_id,2013 None,2014 nesting_budget,2015 )2016 .map_err(Self::map_unique_err_to_proxy)?;20172018 ensure!(is_owned, <Error<T>>::NoPermission);20192020 Ok(())2021 }20222023 /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied,2024 /// or, if None are provided, return all non-scoped properties.2025 pub fn filter_user_properties<Key, Value, R, Mapper>(2026 collection_id: CollectionId,2027 token_id: Option<TokenId>,2028 filter_keys: Option<Vec<RmrkPropertyKey>>,2029 mapper: Mapper,2030 ) -> Result<Vec<R>, DispatchError>2031 where2032 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2033 Value: Decode + Default,2034 Mapper: Fn(Key, Value) -> R,2035 {2036 filter_keys2037 .map(|keys| {2038 let properties = keys2039 .into_iter()2040 .filter_map(|key| {2041 let key: Key = key.try_into().ok()?;20422043 let value = match token_id {2044 Some(token_id) => Self::get_nft_property_decoded(2045 collection_id,2046 token_id,2047 UserProperty(key.as_ref()),2048 ),2049 None => Self::get_collection_property_decoded(2050 collection_id,2051 UserProperty(key.as_ref()),2052 ),2053 }2054 .ok()?;20552056 Some(mapper(key, value))2057 })2058 .collect();20592060 Ok(properties)2061 })2062 .unwrap_or_else(|| {2063 let properties =2064 Self::iterate_user_properties(collection_id, token_id, mapper)?.collect();20652066 Ok(properties)2067 })2068 }20692070 /// Get all non-scoped properties from a collection or a token, and apply some transformation,2071 /// supplied by `mapper`, to each key-value pair.2072 pub fn iterate_user_properties<Key, Value, R, Mapper>(2073 collection_id: CollectionId,2074 token_id: Option<TokenId>,2075 mapper: Mapper,2076 ) -> Result<impl Iterator<Item = R>, DispatchError>2077 where2078 Key: TryFrom<RmrkPropertyKey> + AsRef<[u8]>,2079 Value: Decode + Default,2080 Mapper: Fn(Key, Value) -> R,2081 {2082 let properties = match token_id {2083 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),2084 None => <PalletCommon<T>>::collection_properties(collection_id),2085 };20862087 let properties = properties.into_iter().filter_map(move |(key, value)| {2088 let key = strip_key_prefix(&key, USER_PROPERTY_PREFIX)?;20892090 let key: Key = key.to_vec().try_into().ok()?;2091 let value: Value = value.decode().ok()?;20922093 Some(mapper(key, value))2094 });20952096 Ok(properties)2097 }20982099 /// Match Unique errors to RMRK's own and return the RMRK error if a match is successful.2100 fn map_unique_err_to_proxy(err: DispatchError) -> DispatchError {2101 map_unique_err_to_proxy! {2102 match err {2103 CommonError::NoPermission => NoPermission,2104 CommonError::CollectionTokenLimitExceeded => CollectionFullOrLocked,2105 CommonError::PublicMintingNotAllowed => NoPermission,2106 CommonError::TokenNotFound => NoAvailableNftId,2107 CommonError::ApprovedValueTooLow => NoPermission,2108 CommonError::CantDestroyNotEmptyCollection => CollectionNotEmpty,2109 StructureError::TokenNotFound => NoAvailableNftId,2110 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf,2111 }2112 }2113 }2114}pallets/proxy-rmrk-equip/Cargo.tomldiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/Cargo.toml
+++ b/pallets/proxy-rmrk-equip/Cargo.toml
@@ -11,16 +11,16 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-common = { default-features = false, path = '../common' }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
pallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/src/lib.rs
+++ b/pallets/proxy-rmrk-equip/src/lib.rs
@@ -231,6 +231,7 @@
/// - `symbol`: Arbitrary client-chosen symbol.
/// - `parts`: Array of Fixed and Slot Parts composing the Base,
/// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit).
+ #[pallet::call_index(0)]
#[pallet::weight(<SelfWeightOf<T>>::create_base(parts.len() as u32))]
pub fn create_base(
origin: OriginFor<T>,
@@ -309,6 +310,7 @@
/// - `key`: Arbitrary BoundedString, defined by client.
/// - `value`: Arbitrary BoundedString, defined by client.
/// - `inherit`: Optional bool.
+ #[pallet::call_index(1)]
#[pallet::weight(<SelfWeightOf<T>>::theme_add(theme.properties.len() as u32))]
pub fn theme_add(
origin: OriginFor<T>,
@@ -370,6 +372,7 @@
/// - `base_id`: Base containing the Slot Part to be updated.
/// - `slot_id`: Slot Part whose Equippable List is being updated .
/// - `equippables`: List of equippables that will override the current Equippables list.
+ #[pallet::call_index(2)]
#[pallet::weight(<SelfWeightOf<T>>::equippable())]
pub fn equippable(
origin: OriginFor<T>,
pallets/refungible/Cargo.tomldiffbeforeafterboth--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -11,17 +11,17 @@
version = '3.1.2'
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
pallet-common = { default-features = false, path = '../common' }
pallet-structure = { default-features = false, path = '../structure' }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
struct-versioning = { path = "../../crates/struct-versioning" }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
pallets/scheduler-v2/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler-v2/Cargo.toml
+++ b/pallets/scheduler-v2/Cargo.toml
@@ -10,21 +10,25 @@
readme = "README.md"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
+ "derive",
+] }
log = { version = "0.4.17", default-features = false }
-scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { version = "4.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+scale-info = { version = "2.1.1", default-features = false, features = [
+ "derive",
+] }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[dev-dependencies]
-pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
pallets/scheduler-v2/src/lib.rsdiffbeforeafterboth--- a/pallets/scheduler-v2/src/lib.rs
+++ b/pallets/scheduler-v2/src/lib.rs
@@ -639,6 +639,7 @@
///
/// Only `T::ScheduleOrigin` is allowed to schedule a task.
/// Only `T::PrioritySetOrigin` is allowed to set the task's priority.
+ #[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))]
pub fn schedule(
origin: OriginFor<T>,
@@ -667,6 +668,7 @@
/// Cancel an anonymously scheduled task.
///
/// The `T::OriginPrivilegeCmp` decides whether the given origin is allowed to cancel the task or not.
+ #[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::cancel(T::MaxScheduledPerBlock::get()))]
pub fn cancel(origin: OriginFor<T>, when: T::BlockNumber, index: u32) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
@@ -679,6 +681,7 @@
///
/// Only `T::ScheduleOrigin` is allowed to schedule a task.
/// Only `T::PrioritySetOrigin` is allowed to set the task's priority.
+ #[pallet::call_index(2)]
#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
pub fn schedule_named(
origin: OriginFor<T>,
@@ -709,6 +712,7 @@
/// Cancel a named scheduled task.
///
/// The `T::OriginPrivilegeCmp` decides whether the given origin is allowed to cancel the task or not.
+ #[pallet::call_index(3)]
#[pallet::weight(<T as Config>::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))]
pub fn cancel_named(origin: OriginFor<T>, id: TaskName) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
@@ -722,6 +726,7 @@
/// # <weight>
/// Same as [`schedule`].
/// # </weight>
+ #[pallet::call_index(4)]
#[pallet::weight(<T as Config>::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))]
pub fn schedule_after(
origin: OriginFor<T>,
@@ -755,6 +760,7 @@
/// # <weight>
/// Same as [`schedule_named`](Self::schedule_named).
/// # </weight>
+ #[pallet::call_index(5)]
#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
pub fn schedule_named_after(
origin: OriginFor<T>,
@@ -785,6 +791,7 @@
/// Change a named task's priority.
///
/// Only the `T::PrioritySetOrigin` is allowed to change the task's priority.
+ #[pallet::call_index(6)]
#[pallet::weight(<T as Config>::WeightInfo::change_named_priority(T::MaxScheduledPerBlock::get()))]
pub fn change_named_priority(
origin: OriginFor<T>,
pallets/scheduler-v2/src/mock.rsdiffbeforeafterboth--- a/pallets/scheduler-v2/src/mock.rs
+++ b/pallets/scheduler-v2/src/mock.rs
@@ -87,6 +87,7 @@
where
<T as frame_system::Config>::RuntimeOrigin: OriginTrait<PalletsOrigin = OriginCaller>,
{
+ #[pallet::call_index(0)]
#[pallet::weight(*weight)]
pub fn log(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
Self::deposit_event(Event::Logged(i, weight));
@@ -96,6 +97,7 @@
Ok(())
}
+ #[pallet::call_index(1)]
#[pallet::weight(*weight)]
pub fn log_without_filter(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
Self::deposit_event(Event::Logged(i, weight));
pallets/structure/Cargo.tomldiffbeforeafterboth--- a/pallets/structure/Cargo.toml
+++ b/pallets/structure/Cargo.toml
@@ -4,10 +4,10 @@
edition = "2021"
[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-common = { path = "../common", default-features = false }
parity-scale-codec = { version = "3.1.2", default-features = false, features = [
"derive",
@@ -16,7 +16,7 @@
"derive",
] }
up-data-structs = { path = "../../primitives/data-structs", default-features = false }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[features]
default = ["std"]
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -61,37 +61,37 @@
default-features = false
optional = true
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-io]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
################################################################################
# Local Dependencies
@@ -100,7 +100,7 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-common = { default-features = false, path = "../common" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
primitives/app_promotion_rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/app_promotion_rpc/Cargo.toml
+++ b/primitives/app_promotion_rpc/Cargo.toml
@@ -10,11 +10,11 @@
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
"derive",
] }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[features]
default = ["std"]
primitives/common/Cargo.tomldiffbeforeafterboth--- a/primitives/common/Cargo.toml
+++ b/primitives/common/Cargo.toml
@@ -6,7 +6,7 @@
license = 'All Rights Reserved'
name = 'up-common'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = "0.9.33"
+version.workspace = true
[features]
default = ['std']
@@ -24,39 +24,39 @@
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.fp-rpc]
default-features = false
git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.33"
+branch = "unique-polkadot-v0.9.36"
[dependencies.cumulus-primitives-core]
default-features = false
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-evm]
default-features = false
git = "https://github.com/uniquenetwork/frontier"
-branch = "unique-polkadot-v0.9.33"
+branch = "unique-polkadot-v0.9.36"
primitives/common/src/constants.rsdiffbeforeafterboth--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -17,7 +17,7 @@
use sp_runtime::Perbill;
use frame_support::{
parameter_types,
- weights::{Weight, constants::WEIGHT_PER_SECOND},
+ weights::{Weight, constants::WEIGHT_REF_TIME_PER_SECOND},
};
use cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE;
use crate::types::{BlockNumber, Balance};
@@ -55,9 +55,9 @@
/// by Operational extrinsics.
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 2 seconds of compute with a 6 second average block time.
-pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND
- .saturating_div(2)
- .set_proof_size(MAX_POV_SIZE as u64);
+pub const MAXIMUM_BLOCK_WEIGHT: Weight =
+ Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND.saturating_div(2))
+ .set_proof_size(MAX_POV_SIZE as u64);
parameter_types! {
pub const TransactionByteFee: Balance = 501 * MICROUNIQUE / 2;
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -10,40 +10,40 @@
[dependencies]
scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
+ "derive",
] }
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
- 'derive',
+ 'derive',
] }
serde = { version = "1.0.130", features = [
- 'derive',
+ 'derive',
], default-features = false, optional = true }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
derivative = { version = "2.2.0", features = ["use_core"] }
struct-versioning = { path = "../../crates/struct-versioning" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
rmrk-traits = { default-features = false, path = "../rmrk-traits" }
bondrewd = { version = "0.1.14", features = [
- "derive",
+ "derive",
], default-features = false }
[features]
default = ["std"]
std = [
- "serde1",
- "serde/std",
- "codec/std",
- "frame-system/std",
- "frame-support/std",
- "sp-runtime/std",
- "sp-core/std",
- "sp-std/std",
- "pallet-evm/std",
- "rmrk-traits/std",
+ "serde1",
+ "serde/std",
+ "codec/std",
+ "frame-system/std",
+ "frame-support/std",
+ "sp-runtime/std",
+ "sp-core/std",
+ "sp-std/std",
+ "pallet-evm/std",
+ "rmrk-traits/std",
]
serde1 = ["serde/alloc"]
limit-testing = []
primitives/rmrk-rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/rmrk-rpc/Cargo.toml
+++ b/primitives/rmrk-rpc/Cargo.toml
@@ -8,10 +8,10 @@
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [
"derive",
] }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
serde = { version = "1.0.130", default-features = false, features = ["derive"] }
rmrk-traits = { default-features = false, path = "../rmrk-traits" }
primitives/rpc/Cargo.tomldiffbeforeafterboth--- a/primitives/rpc/Cargo.toml
+++ b/primitives/rpc/Cargo.toml
@@ -10,11 +10,11 @@
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
"derive",
] }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
[features]
default = ["std"]
runtime/common/config/ethereum.rsdiffbeforeafterboth--- a/runtime/common/config/ethereum.rs
+++ b/runtime/common/config/ethereum.rs
@@ -1,6 +1,6 @@
use sp_core::{U256, H160};
use frame_support::{
- weights::{Weight, constants::WEIGHT_PER_SECOND},
+ weights::{Weight, constants::WEIGHT_REF_TIME_PER_SECOND},
traits::{FindAuthor},
parameter_types, ConsensusEngineId,
};
@@ -23,9 +23,9 @@
// (contract, which only writes a lot of data),
// approximating on top of our real store write weight
parameter_types! {
- pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND.ref_time() / <Runtime as frame_system::Config>::DbWeight::get().write;
+ pub const WritesPerSecond: u64 = WEIGHT_REF_TIME_PER_SECOND / <Runtime as frame_system::Config>::DbWeight::get().write;
pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000;
- pub const WeightTimePerGas: u64 = WEIGHT_PER_SECOND.ref_time() / GasPerSecond::get();
+ pub const WeightTimePerGas: u64 = WEIGHT_REF_TIME_PER_SECOND / GasPerSecond::get();
pub const WeightPerGas: Weight = Weight::from_ref_time(WeightTimePerGas::get());
}
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -574,6 +574,8 @@
fn elasticity() -> Option<Permill> {
None
}
+
+ fn gas_limit_multiplier_support() {}
}
impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -1,8 +1,6 @@
################################################################################
# Package
-cargo-features = ["workspace-inheritance"]
-
[package]
authors = ['Unique Network <support@uniquenetwork.io>']
build = 'build.rs'
@@ -12,7 +10,7 @@
license = 'GPLv3'
name = 'opal-runtime'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = "0.9.33"
+version.workspace = true
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@@ -205,39 +203,39 @@
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-try-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-executive]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-benchmarking]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.hex-literal]
optional = true
@@ -252,12 +250,12 @@
[dependencies.pallet-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-balances]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
# Contracts specific packages
# [dependencies.pallet-contracts]
@@ -281,97 +279,97 @@
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-sudo]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-timestamp]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-treasury]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-arithmetic]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-block-builder]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-inherents]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-io]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-offchain]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-session]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-transaction-pool]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-version]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.smallvec]
version = '1.6.1'
@@ -382,46 +380,46 @@
[dependencies.parachain-info]
default-features = false
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-pallet-aura-ext]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-parachain-system]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-core]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcm]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-dmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-utility]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-timestamp]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
################################################################################
@@ -429,27 +427,27 @@
[dependencies.polkadot-parachain]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-builder]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-executor]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.pallet-xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
################################################################################
@@ -471,8 +469,8 @@
up-rpc = { path = "../../primitives/rpc", default-features = false }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
@@ -484,20 +482,20 @@
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.33' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
@@ -524,4 +522,4 @@
[build-dependencies.substrate-wasm-builder]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -59,10 +59,10 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 933032,
+ spec_version: 336040,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
- transaction_version: 2,
+ transaction_version: 3,
state_version: 0,
};
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -1,8 +1,6 @@
################################################################################
# Package
-cargo-features = ["workspace-inheritance"]
-
[package]
authors = ['Unique Network <support@uniquenetwork.io>']
build = 'build.rs'
@@ -12,7 +10,7 @@
license = 'GPLv3'
name = 'quartz-runtime'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.33'
+version.workspace = true
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@@ -190,39 +188,39 @@
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-try-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-executive]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-benchmarking]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.hex-literal]
optional = true
@@ -237,12 +235,12 @@
[dependencies.pallet-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-balances]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
# Contracts specific packages
# [dependencies.pallet-contracts]
@@ -266,97 +264,97 @@
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-sudo]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-timestamp]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-treasury]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-arithmetic]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-block-builder]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-inherents]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-io]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-offchain]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-session]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-transaction-pool]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-version]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.smallvec]
version = '1.6.1'
@@ -367,46 +365,46 @@
[dependencies.parachain-info]
default-features = false
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-pallet-aura-ext]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-parachain-system]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-core]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcm]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-dmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-utility]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-timestamp]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
################################################################################
@@ -414,27 +412,27 @@
[dependencies.polkadot-parachain]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-builder]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-executor]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.pallet-xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
################################################################################
@@ -463,8 +461,8 @@
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
@@ -477,19 +475,19 @@
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.33' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
@@ -511,4 +509,4 @@
[build-dependencies.substrate-wasm-builder]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -52,10 +52,10 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 933032,
+ spec_version: 336040,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
- transaction_version: 2,
+ transaction_version: 3,
state_version: 0,
};
runtime/tests/Cargo.tomldiffbeforeafterboth--- a/runtime/tests/Cargo.toml
+++ b/runtime/tests/Cargo.toml
@@ -11,22 +11,22 @@
[dependencies]
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
-frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
pallet-common = { path = '../../pallets/common' }
pallet-structure = { path = '../../pallets/structure' }
@@ -43,4 +43,4 @@
scale-info = "*"
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36" }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -1,8 +1,6 @@
################################################################################
# Package
-cargo-features = ["workspace-inheritance"]
-
[package]
authors = ['Unique Network <support@uniquenetwork.io>']
build = 'build.rs'
@@ -12,7 +10,7 @@
license = 'GPLv3'
name = 'unique-runtime'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.33'
+version.workspace = true
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@@ -191,39 +189,39 @@
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-try-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-executive]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-support]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-benchmarking]
default-features = false
git = "https://github.com/paritytech/substrate"
optional = true
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.hex-literal]
optional = true
@@ -238,12 +236,12 @@
[dependencies.pallet-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-balances]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
# Contracts specific packages
# [dependencies.pallet-contracts]
@@ -267,97 +265,97 @@
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-sudo]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-timestamp]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.pallet-treasury]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-arithmetic]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-api]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-block-builder]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-core]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-consensus-aura]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-inherents]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-io]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-offchain]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-session]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-std]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-transaction-pool]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.sp-version]
default-features = false
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.smallvec]
version = '1.6.1'
@@ -368,46 +366,46 @@
[dependencies.parachain-info]
default-features = false
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
[dependencies.cumulus-pallet-aura-ext]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-parachain-system]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-core]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcm]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-dmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-pallet-xcmp-queue]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-utility]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
[dependencies.cumulus-primitives-timestamp]
git = "https://github.com/paritytech/cumulus"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
default-features = false
################################################################################
@@ -415,27 +413,27 @@
[dependencies.polkadot-parachain]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-builder]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.xcm-executor]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
[dependencies.pallet-xcm]
git = "https://github.com/paritytech/polkadot"
-branch = "release-v0.9.33"
+branch = "release-v0.9.36"
default-features = false
################################################################################
@@ -469,21 +467,21 @@
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
-pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.33", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
+pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
-pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.33" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.33' }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }
pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }
precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }
@@ -505,4 +503,4 @@
[build-dependencies.substrate-wasm-builder]
git = "https://github.com/paritytech/substrate"
-branch = "polkadot-v0.9.33"
+branch = "polkadot-v0.9.36"
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -52,10 +52,10 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 933032,
+ spec_version: 336040,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
- transaction_version: 2,
+ transaction_version: 3,
state_version: 0,
};
test-pallets/utils/Cargo.tomldiffbeforeafterboth--- a/test-pallets/utils/Cargo.toml
+++ b/test-pallets/utils/Cargo.toml
@@ -6,13 +6,17 @@
publish = false
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
-scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
+ "derive",
+] }
+scale-info = { version = "2.1.1", default-features = false, features = [
+ "derive",
+] }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
# pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
[features]
default = ["std"]
@@ -24,4 +28,7 @@
"pallet-unique-scheduler-v2/std",
"sp-std/std",
]
-try-runtime = ["frame-support/try-runtime", "pallet-unique-scheduler-v2/try-runtime"]
+try-runtime = [
+ "frame-support/try-runtime",
+ "pallet-unique-scheduler-v2/try-runtime",
+]
test-pallets/utils/src/lib.rsdiffbeforeafterboth--- a/test-pallets/utils/src/lib.rs
+++ b/test-pallets/utils/src/lib.rs
@@ -75,6 +75,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+ #[pallet::call_index(0)]
#[pallet::weight(10_000)]
pub fn enable(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
@@ -83,6 +84,7 @@
Ok(())
}
+ #[pallet::call_index(1)]
#[pallet::weight(10_000)]
pub fn set_test_value(origin: OriginFor<T>, value: u32) -> DispatchResult {
Self::ensure_origin_and_enabled(origin)?;
@@ -94,6 +96,7 @@
Ok(())
}
+ #[pallet::call_index(2)]
#[pallet::weight(10_000)]
pub fn set_test_value_and_rollback(origin: OriginFor<T>, value: u32) -> DispatchResult {
Self::set_test_value(origin, value)?;
@@ -103,6 +106,7 @@
Err(<Error<T>>::TriggerRollback.into())
}
+ #[pallet::call_index(3)]
#[pallet::weight(10_000)]
pub fn inc_test_value(origin: OriginFor<T>) -> DispatchResult {
Self::set_test_value(origin, <TestValue<T>>::get() + 1)
@@ -124,12 +128,14 @@
// Ok(())
// }
+ #[pallet::call_index(4)]
#[pallet::weight(100_000_000)]
pub fn just_take_fee(origin: OriginFor<T>) -> DispatchResult {
Self::ensure_origin_and_enabled(origin)?;
Ok(())
}
+ #[pallet::call_index(5)]
#[pallet::weight(10_000)]
pub fn batch_all(
origin: OriginFor<T>,
tests/.eslintrc.jsondiffbeforeafterboth--- a/tests/.eslintrc.json
+++ b/tests/.eslintrc.json
@@ -10,7 +10,8 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 11,
- "sourceType": "module"
+ "sourceType": "module",
+ "project": "**/tsconfig.json"
},
"plugins": [
"@typescript-eslint",
@@ -24,6 +25,7 @@
"SwitchCase": 1
}
],
+ "no-trailing-spaces": "warn",
"function-call-argument-newline": [
"error",
"consistent"
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -124,6 +124,6 @@
"csv-writer": "^1.6.0",
"find-process": "^1.4.7",
"solc": "0.8.17",
- "web3": "^1.8.0"
+ "web3": "^1.8.1"
}
}
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -45,113 +45,113 @@
});
});
- describe('stake extrinsic', () => {
+ describe('stake extrinsic', () => {
itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
-
+
// Minimum stake amount is 100:
await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected;
await helper.staking.stake(staker, 100n * nominal);
-
+
// Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n...
// ...so he can not transfer 900
expect(await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n});
expect(await helper.balance.getLocked(staker.address)).to.deep.eq([{id: 'appstake', amount: 100n * nominal, reasons: 'All'}]);
await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
-
+
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
- // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo?
- expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased
-
-
+ // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo?
+ expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased
+
+
await helper.staking.stake(staker, 200n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal);
const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal);
expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal);
});
-
+
itSub('should allow to create maximum 10 stakes for account', async ({helper}) => {
const [staker] = await helper.arrange.createAccounts([2000n], donor);
for (let i = 0; i < 10; i++) {
await helper.staking.stake(staker, 100n * nominal);
}
-
+
// can have 10 stakes
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal);
expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10);
-
+
await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission');
-
+
// After unstake can stake again
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal);
});
-
+
itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => {
const staker = accounts.pop()!;
-
+
// Can't stake full balance because Alice needs to pay some fee
await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected;
await helper.staking.stake(staker, 500n * nominal);
-
+
// Can't stake 500 tkn because Alice has Less than 500 transferable;
- await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
+ await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);
});
-
+
itSub('for different accounts in one block is possible', async ({helper}) => {
const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal));
await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled;
-
+
const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address})));
expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]);
});
});
-
- describe('unstake extrinsic', () => {
+
+ describe('unstake extrinsic', () => {
itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
await helper.staking.stake(staker, 900n * nominal);
await helper.staking.unstake(staker);
-
+
// Right after unstake balance is reserved
- // Staker can not transfer
+ // Staker can not transfer
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n});
await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance');
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);
});
-
+
itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
-
+
// Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n
await helper.wait.forParachainBlockNumber(pendingUnstake.block);
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n});
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
-
+
// staker can transfer:
await helper.balance.transferToSubstrate(staker, donor.address, 998n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n);
});
-
+
itSub('should successfully unstake multiple stakes', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
await helper.staking.stake(staker, 300n * nominal);
-
+
// staked: [100, 200, 300]; unstaked: 0
let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
@@ -161,7 +161,7 @@
expect(stakes[0].amount).to.equal(100n * nominal);
expect(stakes[1].amount).to.equal(200n * nominal);
expect(stakes[2].amount).to.equal(300n * nominal);
-
+
// Can unstake multiple stakes
await helper.staking.unstake(staker);
pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
@@ -170,58 +170,58 @@
expect(totalPendingUnstake).to.be.equal(600n * nominal);
expect(stakes).to.be.deep.equal([]);
expect(pendingUnstake[0].amount).to.equal(600n * nominal);
-
+
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n});
await helper.wait.forParachainBlockNumber(pendingUnstake[0].block);
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});
expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
});
-
+
itSub('should not have any effects if no active stakes', async ({helper}) => {
const staker = accounts.pop()!;
-
+
// unstake has no effect if no stakes at all
await helper.staking.unstake(staker);
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper
-
+
// TODO stake() unstake() waitUnstaked() unstake();
-
+
// can't unstake if there are only pendingUnstakes
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.unstake(staker);
-
+
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
});
-
+
itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 120n * nominal);
await helper.staking.unstake(staker);
-
+
const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
expect(unstakingPerBlock).has.length(2);
expect(unstakingPerBlock[0].amount).to.equal(100n * nominal);
expect(unstakingPerBlock[1].amount).to.equal(120n * nominal);
});
-
+
itSub('should be possible for different accounts in one block', async ({helper}) => {
const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
await Promise.all(stakers.map(staker => helper.staking.unstake(staker)));
-
+
await Promise.all(stakers.map(async (staker) => {
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
}));
});
});
-
+
describe('collection sponsoring', () => {
itSub('should actually sponsor transactions', async ({helper}) => {
const api = helper.getApi();
@@ -230,345 +230,345 @@
const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address});
await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId));
const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
-
+
await token.transfer(tokenSender, {Substrate: receiver.address});
expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address});
const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
-
+
// senders balance the same, transaction has sponsored
expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal);
expect (palletBalanceBefore > palletBalanceAfter).to.be.true;
});
-
+
itSub('can not be set by non admin', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
-
+
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
+
await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled');
});
-
+
itSub('should set pallet address as confirmed admin', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!];
-
+
// Can set sponsoring for collection without sponsor
const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'});
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with unconfirmed sponsor
const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with confirmed sponsor
const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
-
- itSub('can be overwritten by collection owner', async ({helper}) => {
+
+ itSub('can be overwritten by collection owner', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
const collectionId = collection.collectionId;
-
+
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled;
-
+
// Collection limits still can be changed by the owner
expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true;
expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0);
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Collection sponsor can be changed too
expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address});
});
-
+
itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => {
const api = helper.getApi();
const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0};
const collectionWithLimits = await helper.nft.mintCollection(accounts.pop()!, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits});
-
+
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled;
expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits);
});
-
+
itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => {
const api = helper.getApi();
const collectionOwner = accounts.pop()!;
-
+
// collection has never existed
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected;
// collection has been burned
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
await collection.burn(collectionOwner);
-
+
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
});
});
-
+
describe('stopSponsoringCollection', () => {
itSub('can not be called by non-admin', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
+
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled;
-
+
await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
-
+
itSub('should set sponsoring as disabled', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address});
-
+
await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId));
await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId));
-
+
expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled');
-
+
// Transactions are not sponsored anymore:
const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address);
await token.transfer(collectionOwner, {Substrate: recepient.address});
const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address);
expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true);
});
-
+
itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {
const api = helper.getApi();
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
await collection.confirmSponsorship(collectionOwner);
-
+
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
-
+
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address});
});
-
- itSub('should reject transaction if collection does not exist', async ({helper}) => {
+
+ itSub('should reject transaction if collection does not exist', async ({helper}) => {
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
+
await collection.burn(collectionOwner);
await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound');
await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound');
});
});
-
+
describe('contract sponsoring', () => {
itEth('should set palletes address as a sponsor', async ({helper}) => {
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
-
- expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
-
+
itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => {
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
-
+
// Contract is self sponsored
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.be.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
-
+
// set promotion sponsoring
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
-
+
// new sponsor is pallet address
- expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
-
+
itEth('can be overwritten by contract owner', async ({helper}) => {
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
// contract sponsored by pallet
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
-
+
// owner sets self sponsoring
await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
- expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
-
+
itEth('can not be set by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
-
+
// nonAdmin calls sponsorContract
await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
-
- // contract still self-sponsored
+
+ // contract still self-sponsored
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
-
+
itEth('should actually sponsor transactions', async ({helper}) => {
// Contract caller
const caller = await helper.eth.createAccountWithBalance(donor, 1000n);
const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
-
+
// Deploy flipper
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
// Owner sets to sponsor every tx
await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner});
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n);
-
+
// Set promotion to the Flipper
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
-
+
// Caller calls Flipper
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
// The contracts and caller balances have not changed
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
expect(callerBalance).to.be.equal(1000n * nominal);
expect(1000n * nominal === contractBalanceAfter).to.be.true;
-
+
// The pallet balance has decreased
const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
expect(palletBalanceAfter < palletBalanceBefore).to.be.true;
});
});
-
- describe('stopSponsoringContract', () => {
+
+ describe('stopSponsoringContract', () => {
itEth('should remove pallet address from contract sponsors', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor, 1000n);
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner);
await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
-
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
+
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true);
-
- expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
- expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
disabled: null,
});
-
+
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
-
+
// caller payed for call
expect(1000n * nominal > callerBalance).to.be.true;
expect(contractBalanceAfter).to.be.equal(100n * nominal);
});
-
+
itEth('can not be called by non-admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner);
-
+
await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]))
.to.be.rejectedWith(/appPromotion\.NoPermission/);
});
-
+
itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => {
const nonAdmin = accounts.pop()!;
const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase();
const flipper = await helper.eth.deployFlipper(contractOwner);
- const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+ const contractHelper = await helper.ethNativeContract.contractHelpers(contractOwner);
await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
-
+
await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
});
});
-
+
describe('payoutStakers', () => {
itSub('can not be called by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission');
});
-
+
itSub('should increase total staked', async ({helper}) => {
const staker = accounts.pop()!;
const totalStakedBefore = await helper.staking.getTotalStaked();
await helper.staking.stake(staker, 100n * nominal);
-
+
// Wait for rewards and pay
const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block));
const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n);
-
+
const totalStakedAfter = await helper.staking.getTotalStaked();
expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout);
// staker can unstake
await helper.staking.unstake(staker);
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal));
});
-
- itSub('should credit 0.05% for staking period', async ({helper}) => {
+
+ itSub('should credit 0.05% for staking period', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await waitPromotionPeriodDoesntEnd(helper);
-
+
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
-
+
// wait rewards are available:
const [_stake1, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block));
-
+
const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout;
expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal));
-
+
const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
const income1 = calculateIncome(100n * nominal);
const income2 = calculateIncome(200n * nominal);
@@ -579,25 +579,25 @@
expect(stakerBalance).to.contain({miscFrozen: income1 + income2, feeFrozen: income1 + income2, reserved: 0n});
expect(stakerBalance.free / nominal).to.eq(999n);
});
-
+
itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
// wait for two rewards are available:
let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
-
+
await helper.admin.payoutStakers(palletAdmin, 100);
[stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
const frozenBalanceShouldBe = calculateIncome(100n * nominal, 2);
expect(stake.amount).to.be.equal(frozenBalanceShouldBe);
-
+
const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address);
-
+
expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe});
});
-
+
itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => {
// staker unstakes before rewards has been payed
const staker = accounts.pop()!;
@@ -605,37 +605,37 @@
const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
await helper.staking.unstake(staker);
-
+
// so he did not receive any rewards
const totalBalanceBefore = await helper.balance.getSubstrate(staker.address);
await helper.admin.payoutStakers(palletAdmin, 100);
const totalBalanceAfter = await helper.balance.getSubstrate(staker.address);
-
+
expect(totalBalanceBefore).to.be.equal(totalBalanceAfter);
});
-
+
itSub('should bring compound interest', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
-
+
let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block));
-
+
await helper.admin.payoutStakers(palletAdmin, 100);
[stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
expect(stake.amount).to.equal(calculateIncome(100n * nominal));
-
+
await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
await helper.admin.payoutStakers(palletAdmin, 100);
[stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
expect(stake.amount).to.equal(calculateIncome(100n * nominal, 2));
});
-
+
itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => {
// all other stakes should be unstaked
const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, donor);
-
+
// stakers stakes 10 times each
for (let i = 0; i < 10; i++) {
await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
@@ -643,20 +643,20 @@
await helper.wait.newBlocks(40);
await helper.admin.payoutStakers(palletAdmin, 100);
});
-
+
itSub.skip('can handle 40.000 rewards', async ({helper}) => {
const crowdStakes = async () => {
// each account in the crowd stakes 2 times
const crowd = await helper.arrange.createCrowd(500, 300n, donor);
await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
- //
+ //
};
-
+
for (let i = 0; i < 40; i++) {
await crowdStakes();
}
-
+
// TODO pay rewards for some period
});
});
@@ -667,7 +667,7 @@
const ACCURACY = 1_000_000_000n;
// 5n / 10_000n = 0.05% p/day
const income = base + base * (ACCURACY * (calcPeriod * 5n) / (10_000n * DAY)) / ACCURACY ;
-
+
if (iter > 1) {
return calculateIncome(income, iter - 1, calcPeriod);
} else return income;
tests/src/benchmarks/mintFee/benchmark.tsdiffbeforeafterboth--- a/tests/src/benchmarks/mintFee/benchmark.ts
+++ b/tests/src/benchmarks/mintFee/benchmark.ts
@@ -210,7 +210,7 @@
);
const collectionEthAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionContract = helper.ethNativeContract.collection(
+ const collectionContract = await helper.ethNativeContract.collection(
collectionEthAddress,
'nft',
);
@@ -290,7 +290,7 @@
ethSigner,
proxyContract.options.address,
async (collection) => {
- const evmContract = helper.ethNativeContract.collection(
+ const evmContract = await helper.ethNativeContract.collection(
helper.ethAddress.fromCollectionId(collection.collectionId),
'nft',
);
@@ -330,7 +330,7 @@
ethSigner,
proxyContract.options.address,
async (collection) => {
- const evmContract = helper.ethNativeContract.collection(
+ const evmContract = await helper.ethNativeContract.collection(
helper.ethAddress.fromCollectionId(collection.collectionId),
'nft',
);
tests/src/calibrate.tsdiffbeforeafterboth--- a/tests/src/calibrate.ts
+++ b/tests/src/calibrate.ts
@@ -246,7 +246,7 @@
const token = await collection.mintToken(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gas: helper.eth.DEFAULT_GAS}));
@@ -266,7 +266,7 @@
const token = await collection.mintToken(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const transferPrice = new Fract(await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gasPrice: gasPriceStr, gas: helper.eth.DEFAULT_GAS})));
@@ -287,7 +287,7 @@
const token = await collection.mintToken(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gas: helper.eth.DEFAULT_GAS}));
tests/src/eth/allowlist.test.tsdiffbeforeafterboth--- a/tests/src/eth/allowlist.test.ts
+++ b/tests/src/eth/allowlist.test.ts
@@ -30,7 +30,7 @@
itEth('Contract allowlist can be toggled', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const flipper = await helper.eth.deployFlipper(owner);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
// Any user is allowed by default
expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false;
@@ -48,7 +48,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
const flipper = await helper.eth.deployFlipper(owner);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
// User can flip with allowlist disabled
await flipper.methods.flip().send({from: caller});
@@ -80,9 +80,9 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const user = helper.eth.createAccount();
const crossUser = helper.ethCrossAccount.fromAddress(user);
-
+
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
expect(await collectionEvm.methods.allowlistedCross(crossUser).call({from: owner})).to.be.false;
await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});
@@ -97,19 +97,19 @@
{mode: 'nft' as const, requiredPallets: []},
{mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
{mode: 'ft' as const, requiredPallets: []},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`Collection allowlist can be added and removed by [cross] address for ${testCase.mode}`, testCase.requiredPallets, async ({helper}) => {
const owner = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();
const [userSub] = await helper.arrange.createAccounts([10n], donor);
const userEth = await helper.eth.createAccountWithBalance(donor);
const mintParams = testCase.mode === 'ft' ? [userEth, 100] : [userEth];
-
+
const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
const userCrossSub = helper.ethCrossAccount.fromKeyringPair(userSub);
const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
const ownerCrossEth = helper.ethCrossAccount.fromAddress(owner);
-
+
// Can addToCollectionAllowListCross:
expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;
await collectionEvm.methods.addToCollectionAllowListCross(userCrossSub).send({from: owner});
@@ -121,11 +121,11 @@
expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.true;
expect(await collectionEvm.methods.allowlistedCross(userCrossSub).call({from: owner})).to.be.true;
expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.true;
-
+
await collectionEvm.methods.mint(...mintParams).send({from: owner}); // token #1
await collectionEvm.methods.mint(...mintParams).send({from: owner}); // token #2
await collectionEvm.methods.setCollectionAccess(SponsoringMode.Allowlisted).send({from: owner});
-
+
// allowlisted account can transfer and transferCross from eth:
await collectionEvm.methods.transfer(owner, 1).send({from: userEth});
await collectionEvm.methods.transferCross(userCrossSub, 2).send({from: userEth});
@@ -142,7 +142,7 @@
testCase.mode === 'ft'
? await helper.ft.transfer(userSub, collectionId, {Ethereum: userEth}, 2n)
: await helper.collection.transferToken(userSub, collectionId, 2, {Ethereum: userEth});
-
+
// can removeFromCollectionAllowListCross:
await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossSub).send({from: owner});
await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossEth).send({from: owner});
@@ -150,7 +150,7 @@
expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.false;
expect(await collectionEvm.methods.allowlistedCross(userCrossSub).call({from: owner})).to.be.false;
expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.false;
-
+
// cannot transfer anymore
await collectionEvm.methods.mint(...mintParams).send({from: owner});
await expect(collectionEvm.methods.transfer(owner, 2).send({from: userEth})).to.be.rejectedWith(/Transaction has been reverted/);
@@ -165,7 +165,7 @@
{mode: 'nft' as const, cross: false, requiredPallets: []},
{mode: 'rft' as const, cross: false, requiredPallets: [Pallets.ReFungible]},
{mode: 'ft' as const, cross: false, requiredPallets: []},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`Non-owner cannot add or remove from collection allowlist ${testCase.cross ? 'cross ' : ''}${testCase.mode}`, testCase.requiredPallets, async ({helper}) => {
// Select methods:
const addToAllowList = testCase.cross ? 'addToCollectionAllowListCross' : 'addToCollectionAllowList';
@@ -179,11 +179,11 @@
const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, !testCase.cross);
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, !testCase.cross);
+
expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;
expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.false;
-
+
// 1. notOwner cannot add to allow list:
// 1.1 plain ethereum or cross address:
await expect(collectionEvm.methods[addToAllowList](testCase.cross ? userCrossEth : userEth).call({from: notOwner})).to.be.rejectedWith('NoPermission');
@@ -200,7 +200,7 @@
expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.true;
}
expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.true;
-
+
// 3. notOwner cannot remove from allow list:
// 3.1 plain ethereum or cross address:
await expect(collectionEvm.methods[removeFromAllowList](testCase.cross ? userCrossEth : userEth).call({from: notOwner})).to.be.rejectedWith('NoPermission');
tests/src/eth/base.test.tsdiffbeforeafterboth--- a/tests/src/eth/base.test.ts
+++ b/tests/src/eth/base.test.ts
@@ -57,7 +57,7 @@
const {tokenId} = await collection.mintToken(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, tokenId).send(caller));
@@ -79,8 +79,8 @@
const BASE_URI = 'base/';
async function checkInterface(helper: EthUniqueHelper, interfaceId: string, simpleResult: boolean, compatibleResult: boolean) {
- const simple = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(simpleNftCollectionId), 'nft', minter);
- const compatible = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(erc721MetadataCompatibleNftCollectionId), 'nft', minter);
+ const simple = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(simpleNftCollectionId), 'nft', minter);
+ const compatible = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(erc721MetadataCompatibleNftCollectionId), 'nft', minter);
expect(await simple.methods.supportsInterface(interfaceId).call()).to.equal(simpleResult, `empty (not ERC721Metadata compatible) NFT collection returns not ${simpleResult}`);
expect(await compatible.methods.supportsInterface(interfaceId).call()).to.equal(compatibleResult, `ERC721Metadata compatible NFT collection returns not ${compatibleResult}`);
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -50,32 +50,30 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const adminSub = await privateKey('//admin2');
const adminEth = helper.eth.createAccount().toLowerCase();
-
+
const adminDeprecated = helper.eth.createAccount().toLowerCase();
const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
-
+
const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);
// Check isOwnerOrAdminCross returns false:
expect(await collectionEvm.methods.isOwnerOrAdminCross(adminCrossSub).call()).to.be.false;
expect(await collectionEvm.methods.isOwnerOrAdminCross(adminCrossEth).call()).to.be.false;
expect(await collectionEvm.methods.isOwnerOrAdminCross(helper.ethCrossAccount.fromAddress(adminDeprecated)).call()).to.be.false;
- expect(await collectionEvm.methods.collectionAdmins().call()).to.be.like([]);
-
- // Soft-deprecated: can addCollectionAdmin
+ // Soft-deprecated: can addCollectionAdmin
await collectionEvm.methods.addCollectionAdmin(adminDeprecated).send();
// Can addCollectionAdminCross for substrate and ethereum address
await collectionEvm.methods.addCollectionAdminCross(adminCrossSub).send();
await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();
-
+
// 1. Expect api.rpc.unique.adminlist returns admins:
const adminListRpc = await helper.collection.getAdmins(collectionId);
expect(adminListRpc).to.has.length(3);
expect(adminListRpc).to.be.deep.contain.members([{Substrate: adminSub.address}, {Ethereum: adminEth}, {Ethereum: adminDeprecated}]);
-
+
// 2. Expect methods.collectionAdmins == api.rpc.unique.adminlist
let adminListEth = await collectionEvm.methods.collectionAdmins().call();
adminListEth = adminListEth.map((element: IEthCrossAccountId) => {
@@ -98,12 +96,12 @@
const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
const [adminSub] = await helper.arrange.createAccounts([100n], donor);
const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+
// cannot mint while not admin
await expect(collectionEvm.methods.mint(owner).send({from: adminEth})).to.be.rejected;
await expect(helper.nft.mintToken(adminSub, {collectionId, owner: {Ethereum: owner}})).to.be.rejectedWith(/common.PublicMintingNotAllowed/);
-
+
// admin (sub and eth) can mint token:
await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();
await collectionEvm.methods.addCollectionAdminCross(adminCrossSub).send();
@@ -118,7 +116,7 @@
const [admin] = await helper.arrange.createAccounts([100n, 100n], donor);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const adminCross = {
eth: helper.address.substrateToEth(admin.address),
@@ -134,8 +132,8 @@
const adminDeprecated = helper.eth.createAccount();
const admin1Cross = helper.ethCrossAccount.fromKeyringPair(await privateKey('admin'));
const admin2Cross = helper.ethCrossAccount.fromAddress(helper.address.substrateToEth((await privateKey('admin3')).address));
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+
// Soft-deprecated:
expect(await collectionEvm.methods.isOwnerOrAdmin(adminDeprecated).call()).to.be.false;
expect(await collectionEvm.methods.isOwnerOrAdminCross(admin1Cross).call()).to.be.false;
@@ -158,7 +156,7 @@
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
const admin = await helper.eth.createAccountWithBalance(donor);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
await collectionEvm.methods.addCollectionAdmin(admin).send();
const user = helper.eth.createAccount();
@@ -177,7 +175,7 @@
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
const notAdmin = await helper.eth.createAccountWithBalance(donor);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
const user = helper.eth.createAccount();
await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin}))
@@ -193,7 +191,7 @@
const [admin, notAdmin] = await helper.arrange.createAccounts([10n, 10n], donor);
const adminCross = helper.ethCrossAccount.fromKeyringPair(admin);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await collectionEvm.methods.addCollectionAdminCross(adminCross).send();
const notAdminCross = helper.ethCrossAccount.fromKeyringPair(notAdmin);
@@ -202,7 +200,7 @@
const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]);
expect(adminList.length).to.be.eq(1);
-
+
const admin0Cross = helper.ethCrossAccount.fromKeyringPair(adminList[0]);
expect(admin0Cross.eth.toLocaleLowerCase())
.to.be.eq(adminCross.eth.toLocaleLowerCase());
@@ -213,7 +211,7 @@
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
const notAdmin0 = await helper.eth.createAccountWithBalance(donor);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const [notAdmin1] = await helper.arrange.createAccounts([10n], donor);
const notAdmin1Cross = helper.ethCrossAccount.fromKeyringPair(notAdmin1);
await expect(collectionEvm.methods.addCollectionAdminCross(notAdmin1Cross).call({from: notAdmin0}))
@@ -239,7 +237,7 @@
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
const newAdmin = helper.eth.createAccount();
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
await collectionEvm.methods.addCollectionAdmin(newAdmin).send();
{
@@ -263,7 +261,7 @@
const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await collectionEvm.methods.addCollectionAdminCross(adminCrossSub).send();
await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();
@@ -288,7 +286,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
const admin0 = await helper.eth.createAccountWithBalance(donor);
await collectionEvm.methods.addCollectionAdmin(admin0).send();
@@ -311,7 +309,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
const admin = await helper.eth.createAccountWithBalance(donor);
await collectionEvm.methods.addCollectionAdmin(admin).send();
@@ -333,9 +331,9 @@
const [admin1] = await helper.arrange.createAccounts([10n], donor);
const admin1Cross = helper.ethCrossAccount.fromKeyringPair(admin1);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await collectionEvm.methods.addCollectionAdminCross(admin1Cross).send();
-
+
const [admin2] = await helper.arrange.createAccounts([10n], donor);
const admin2Cross = helper.ethCrossAccount.fromKeyringPair(admin2);
await collectionEvm.methods.addCollectionAdminCross(admin2Cross).send();
@@ -356,7 +354,7 @@
const [adminSub] = await helper.arrange.createAccounts([10n], donor);
const adminSubCross = helper.ethCrossAccount.fromKeyringPair(adminSub);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await collectionEvm.methods.addCollectionAdminCross(adminSubCross).send();
const notAdminEth = await helper.eth.createAccountWithBalance(donor);
@@ -384,7 +382,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const newOwner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
await collectionEvm.methods.changeCollectionOwner(newOwner).send();
@@ -396,7 +394,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const newOwner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.changeCollectionOwner(newOwner).send());
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
expect(cost > 0);
@@ -406,7 +404,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const newOwner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
await expect(collectionEvm.methods.changeCollectionOwner(newOwner).send({from: newOwner})).to.be.rejected;
expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false;
@@ -430,7 +428,7 @@
const ownerCrossSub = helper.ethCrossAccount.fromKeyringPair(ownerSub);
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossSub).call()).to.be.false;
@@ -439,7 +437,7 @@
expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossEth).call()).to.be.true;
expect(await helper.collection.getData(collectionId))
.to.have.property('normalizedOwner').that.is.eq(helper.address.ethToSubstrate(ownerEth));
-
+
// Can set Substrate owner:
await collectionEvm.methods.changeCollectionOwnerCross(ownerCrossSub).send({from: ownerEth});
expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossSub).call()).to.be.true;
@@ -451,7 +449,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const [newOwner] = await helper.arrange.createAccounts([10n], donor);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send());
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -464,7 +462,7 @@
const [newOwner] = await helper.arrange.createAccounts([10n], donor);
const newOwnerCross = helper.ethCrossAccount.fromKeyringPair(newOwner);
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await expect(collectionEvm.methods.changeCollectionOwnerCross(newOwnerCross).send({from: otherReceiver})).to.be.rejected;
expect(await collectionEvm.methods.isOwnerOrAdminCross(newOwnerCross).call()).to.be.false;
tests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionHelperAddress.test.ts
+++ b/tests/src/eth/collectionHelperAddress.test.ts
@@ -31,42 +31,42 @@
itEth('NFT', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionAddress: nftCollectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');
- const nftCollection = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
-
+ const nftCollection = await helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
+
expect((await nftCollection.methods.collectionHelperAddress().call())
.toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
});
-
+
itEth.ifWithPallets('RFT ', [Pallets.ReFungible], async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress: rftCollectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');
- const rftCollection = helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);
+ const rftCollection = await helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);
expect((await rftCollection.methods.collectionHelperAddress().call())
.toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
});
-
+
itEth('FT', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Sponsor', 18, 'absolutely anything', 'ROC');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+
expect((await collection.methods.collectionHelperAddress().call())
.toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
});
-
+
itEth('[collectionHelpers] convert collectionId into address', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const collectionId = 7;
const collectionAddress = helper.ethAddress.fromCollectionId(collectionId);
- const helperContract = helper.ethNativeContract.collectionHelpers(owner);
-
+ const helperContract = await helper.ethNativeContract.collectionHelpers(owner);
+
expect(await helperContract.methods.collectionAddress(collectionId).call()).to.be.equal(collectionAddress);
expect(parseInt(await helperContract.methods.collectionId(collectionAddress).call())).to.be.equal(collectionId);
});
-
+
});
tests/src/eth/collectionLimits.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionLimits.test.ts
+++ b/tests/src/eth/collectionLimits.test.ts
@@ -32,7 +32,7 @@
ownerCanDestroy: 0,
transfersEnabled: 0,
};
-
+
const expectedLimits = {
accountTokenOwnershipLimit: 1000,
sponsoredDataSize: 1024,
@@ -44,8 +44,8 @@
ownerCanDestroy: false,
transfersEnabled: false,
};
-
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
await collectionEvm.methods.setCollectionLimit(CollectionLimits.AccountTokenOwnership, true, limits.accountTokenOwnershipLimit).send();
await collectionEvm.methods.setCollectionLimit(CollectionLimits.SponsoredDataSize, true, limits.sponsoredDataSize).send();
await collectionEvm.methods.setCollectionLimit(CollectionLimits.SponsoredDataRateLimit, true, limits.sponsoredDataRateLimit).send();
@@ -55,7 +55,7 @@
await collectionEvm.methods.setCollectionLimit(CollectionLimits.OwnerCanTransfer, true, limits.ownerCanTransfer).send();
await collectionEvm.methods.setCollectionLimit(CollectionLimits.OwnerCanDestroy, true, limits.ownerCanDestroy).send();
await collectionEvm.methods.setCollectionLimit(CollectionLimits.TransferEnabled, true, limits.transfersEnabled).send();
-
+
// Check limits from sub:
const data = (await helper.rft.getData(collectionId))!;
expect(data.raw.limits).to.deep.eq(expectedLimits);
@@ -97,13 +97,13 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'ISNI', 18);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
// Cannot set non-existing limit
await expect(collectionEvm.methods
.setCollectionLimit(9, true, 1)
- .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert Value not convertible into enum "CollectionLimits"');
-
+ .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert Value not convertible into enum "CollectionLimits"');
+
// Cannot disable limits
await expect(collectionEvm.methods
.setCollectionLimit(CollectionLimits.AccountTokenOwnership, false, 200)
@@ -112,7 +112,7 @@
await expect(collectionEvm.methods
.setCollectionLimit(CollectionLimits.AccountTokenOwnership, true, invalidLimits.accountTokenOwnershipLimit)
.call()).to.be.rejectedWith(`can't convert value to u32 "${invalidLimits.accountTokenOwnershipLimit}"`);
-
+
await expect(collectionEvm.methods
.setCollectionLimit(CollectionLimits.TransferEnabled, true, 3)
.call()).to.be.rejectedWith(`can't convert value to boolean "${invalidLimits.transfersEnabled}"`);
@@ -131,7 +131,7 @@
const nonOwner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'FLO', 18);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
await expect(collectionEvm.methods
.setCollectionLimit(CollectionLimits.AccountTokenOwnership, true, 1000)
.call({from: nonOwner}))
tests/src/eth/collectionProperties.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionProperties.test.ts
+++ b/tests/src/eth/collectionProperties.test.ts
@@ -32,20 +32,20 @@
// Soft-deprecated: setCollectionProperty
[
- {method: 'setCollectionProperties', mode: 'nft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
- {method: 'setCollectionProperties', mode: 'rft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
- {method: 'setCollectionProperties', mode: 'ft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ {method: 'setCollectionProperties', mode: 'nft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ {method: 'setCollectionProperties', mode: 'rft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ {method: 'setCollectionProperties', mode: 'ft' as const, methodParams: [[{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}]], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
{method: 'setCollectionProperty', mode: 'nft' as const, methodParams: ['testKey', Buffer.from('testValue')], expectedProps: [{key: 'testKey', value: 'testValue'}]},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`Collection properties can be set: ${testCase.method}() for ${testCase.mode}`, testCase.mode === 'rft' ? [Pallets.ReFungible] : [], async({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const collection = await helper[testCase.mode].mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: []});
await collection.addAdmin(alice, {Ethereum: caller});
-
+
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'setCollectionProperty');
+ const collectionEvm = await helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'setCollectionProperty');
- // collectionProperties returns an empty array if no properties:
+ // collectionProperties returns an empty array if no properties:
expect(await collectionEvm.methods.collectionProperties([]).call()).to.be.like([]);
expect(await collectionEvm.methods.collectionProperties(['NonExistingKey']).call()).to.be.like([]);
@@ -54,7 +54,7 @@
const raw = (await collection.getData())?.raw;
expect(raw.properties).to.deep.equal(testCase.expectedProps);
- // collectionProperties returns properties:
+ // collectionProperties returns properties:
expect(await collectionEvm.methods.collectionProperties([]).call()).to.be.like(testCase.expectedProps.map(prop => helper.ethProperty.property(prop.key, prop.value)));
}));
@@ -64,7 +64,7 @@
await collection.addAdmin(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
await expect(contract.methods.setCollectionProperties([{key: '', value: Buffer.from('val1')}]).send({from: caller})).to.be.rejected;
await expect(contract.methods.setCollectionProperties([{key: 'déjà vu', value: Buffer.from('hmm...')}]).send({from: caller})).to.be.rejected;
@@ -80,8 +80,8 @@
{method: 'deleteCollectionProperties', mode: 'nft' as const, methodParams: [['testKey1', 'testKey2']], expectedProps: [{key: 'testKey3', value: 'testValue3'}]},
{method: 'deleteCollectionProperties', mode: 'rft' as const, methodParams: [['testKey1', 'testKey2']], expectedProps: [{key: 'testKey3', value: 'testValue3'}]},
{method: 'deleteCollectionProperties', mode: 'ft' as const, methodParams: [['testKey1', 'testKey2']], expectedProps: [{key: 'testKey3', value: 'testValue3'}]},
- {method: 'deleteCollectionProperty', mode: 'nft' as const, methodParams: ['testKey1'], expectedProps: [{key: 'testKey2', value: 'testValue2'}, {key: 'testKey3', value: 'testValue3'}]},
- ].map(testCase =>
+ {method: 'deleteCollectionProperty', mode: 'nft' as const, methodParams: ['testKey1'], expectedProps: [{key: 'testKey2', value: 'testValue2'}, {key: 'testKey3', value: 'testValue3'}]},
+ ].map(testCase =>
itEth.ifWithPallets(`Collection properties can be deleted: ${testCase.method}() for ${testCase.mode}`, testCase.mode === 'rft' ? [Pallets.ReFungible] : [], async({helper}) => {
const properties = [
{key: 'testKey1', value: 'testValue1'},
@@ -89,16 +89,16 @@
{key: 'testKey3', value: 'testValue3'}];
const caller = await helper.eth.createAccountWithBalance(donor);
const collection = await helper[testCase.mode].mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties});
-
+
await collection.addAdmin(alice, {Ethereum: caller});
-
+
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'deleteCollectionProperty');
-
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'deleteCollectionProperty');
+
await contract.methods[testCase.method](...testCase.methodParams).send({from: caller});
-
+
const raw = (await collection.getData())?.raw;
-
+
expect(raw.properties.length).to.equal(testCase.expectedProps.length);
expect(raw.properties).to.deep.equal(testCase.expectedProps);
}));
@@ -106,7 +106,7 @@
[
{method: 'deleteCollectionProperties', methodParams: [['testKey2']]},
{method: 'deleteCollectionProperty', methodParams: ['testKey2']},
- ].map(testCase =>
+ ].map(testCase =>
itEth(`cannot ${testCase.method}() of non-owned collections`, async ({helper}) => {
const properties = [
{key: 'testKey1', value: 'testValue1'},
@@ -116,7 +116,7 @@
const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'deleteCollectionProperty');
+ const collectionEvm = await helper.ethNativeContract.collection(address, 'nft', caller, testCase.method === 'deleteCollectionProperty');
await expect(collectionEvm.methods[testCase.method](...testCase.methodParams).send({from: caller})).to.be.rejected;
expect(await collection.getProperties()).to.deep.eq(properties);
@@ -127,7 +127,7 @@
const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: [{key: 'testKey', value: 'testValue'}]});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const value = await contract.methods.collectionProperty('testKey').call();
expect(value).to.equal(helper.getWeb3().utils.toHex('testValue'));
@@ -146,75 +146,75 @@
[
{case: 'nft' as const},
{case: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`ERC721Metadata property can be set for ${testCase.case} collection`, testCase.requiredPallets || [], async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const bruh = await helper.eth.createAccountWithBalance(donor);
-
+
const BASE_URI = 'base/';
const SUFFIX = 'suffix1';
const URI = 'uri1';
-
- const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller);
+
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(caller);
const creatorMethod = testCase.case === 'rft' ? 'createRFTCollection' : 'createNFTCollection';
-
+
const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p');
const bruhCross = helper.ethCrossAccount.fromAddress(bruh);
-
- const contract = helper.ethNativeContract.collectionById(collectionId, testCase.case, caller);
+
+ const contract = await helper.ethNativeContract.collectionById(collectionId, testCase.case, caller);
await contract.methods.addCollectionAdminCross(bruhCross).send(); // to check that admin will work too
-
+
const collection1 = helper.nft.getCollectionObject(collectionId);
const data1 = await collection1.getData();
expect(data1?.raw.flags.erc721metadata).to.be.false;
expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false;
-
+
await collectionHelpers.methods.makeCollectionERC721MetadataCompatible(collectionAddress, BASE_URI)
.send({from: bruh});
-
+
expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true;
-
+
const collection2 = helper.nft.getCollectionObject(collectionId);
const data2 = await collection2.getData();
expect(data2?.raw.flags.erc721metadata).to.be.true;
-
+
const propertyPermissions = data2?.raw.tokenPropertyPermissions;
expect(propertyPermissions?.length).to.equal(2);
-
+
expect(propertyPermissions.find((tpp: ITokenPropertyPermission) => {
return tpp.key === 'URI' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner;
})).to.be.not.null;
-
+
expect(propertyPermissions.find((tpp: ITokenPropertyPermission) => {
return tpp.key === 'URISuffix' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner;
})).to.be.not.null;
-
+
expect(data2?.raw.properties?.find((property: IProperty) => {
return property.key === 'baseURI' && property.value === BASE_URI;
})).to.be.not.null;
-
+
const token1Result = await contract.methods.mint(bruh).send();
const tokenId1 = token1Result.events.Transfer.returnValues.tokenId;
-
+
expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI);
-
+
await contract.methods.setProperties(tokenId1, [{key: 'URISuffix', value: Buffer.from(SUFFIX)}]).send();
expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);
-
+
await contract.methods.setProperties(tokenId1, [{key: 'URI', value: Buffer.from(URI)}]).send();
expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(URI);
-
+
await contract.methods.deleteProperties(tokenId1, ['URI']).send();
expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);
-
+
const token2Result = await contract.methods.mintWithTokenURI(bruh, URI).send();
const tokenId2 = token2Result.events.Transfer.returnValues.tokenId;
-
+
expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI);
-
+
await contract.methods.deleteProperties(tokenId2, ['URI']).send();
expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI);
-
+
await contract.methods.setProperties(tokenId2, [{key: 'URISuffix', value: Buffer.from(SUFFIX)}]).send();
expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI + SUFFIX);
}));
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -30,7 +30,7 @@
nominal = helper.balance.getOneTokenNominal();
});
});
-
+
// TODO: move to substrate tests
itEth('sponsors mint transactions', async ({helper}) => {
const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'spnr', permissions: {mintMode: true}});
@@ -41,7 +41,7 @@
expect(await helper.balance.getEthereum(minter)).to.equal(0n);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', minter);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', minter);
await collection.addToAllowList(alice, {Ethereum: minter});
@@ -85,28 +85,28 @@
[
'setCollectionSponsorCross',
'setCollectionSponsor', // Soft-deprecated
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase}] can remove collection sponsor`, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);
-
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
let result = await collectionHelpers.methods.createNFTCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)});
const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
- const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner, testCase === 'setCollectionSponsor');
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner, testCase === 'setCollectionSponsor');
+
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
result = await collectionEvm.methods[testCase](testCase === 'setCollectionSponsor' ? sponsor : sponsorCross).send({from: owner});
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;
-
+
await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});
let sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(helper.address.restoreCrossAccountFromBigInt(BigInt(sponsorTuple.sub))).to.be.eq(helper.address.ethToSubstrate(sponsor));
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
-
+
await collectionEvm.methods.removeCollectionSponsor().send({from: owner});
-
+
sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(sponsorTuple.eth).to.be.eq('0x0000000000000000000000000000000000000000');
}));
@@ -114,35 +114,35 @@
[
'setCollectionSponsorCross',
'setCollectionSponsor', // Soft-deprecated
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase}] Can sponsor from evm address via access list`, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsorEth = await helper.eth.createAccountWithBalance(donor);
const sponsorCrossEth = helper.ethCrossAccount.fromAddress(sponsorEth);
-
+
const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Sponsor collection', '1', '1', '');
-
+
const collectionSub = helper.nft.getCollectionObject(collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, testCase === 'setCollectionSponsor');
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, testCase === 'setCollectionSponsor');
+
// Set collection sponsor:
await collectionEvm.methods[testCase](testCase === 'setCollectionSponsor' ? sponsorEth : sponsorCrossEth).send({from: owner});
let sponsorship = (await collectionSub.getData())!.raw.sponsorship;
expect(sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsorEth, true));
// Account cannot confirm sponsorship if it is not set as a sponsor
await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
-
+
// Sponsor can confirm sponsorship:
await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsorEth});
sponsorship = (await collectionSub.getData())!.raw.sponsorship;
expect(sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsorEth, true));
-
+
// Create user with no balance:
const user = helper.eth.createAccount();
const userCross = helper.ethCrossAccount.fromAddress(user);
const nextTokenId = await collectionEvm.methods.nextTokenId().call();
expect(nextTokenId).to.be.equal('1');
-
+
// Set collection permissions:
const oldPermissions = (await collectionSub.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();
expect(oldPermissions.mintMode).to.be.false;
@@ -151,11 +151,11 @@
await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});
await collectionEvm.methods.addToCollectionAllowListCross(userCross).send({from: owner});
await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});
-
+
const newPermissions = (await collectionSub.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();
expect(newPermissions.mintMode).to.be.true;
expect(newPermissions.access).to.be.equal('AllowList');
-
+
const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsorEth));
@@ -164,7 +164,7 @@
const result = await collectionEvm.methods.mintWithTokenURI(user, 'Test URI').send({from: user});
const event = helper.eth.normalizeEvents(result.events)
.find(event => event.event === 'Transfer');
-
+
expect(event).to.be.deep.equal({
address: collectionAddress,
event: 'Transfer',
@@ -174,11 +174,11 @@
tokenId: '1',
},
});
-
+
const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsorEth));
const userBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(user));
-
+
expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);
expect(userBalanceAfter).to.be.eq(0n);
@@ -245,40 +245,40 @@
[
'setCollectionSponsorCross',
'setCollectionSponsor', // Soft-deprecated
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase}] Check that transaction via EVM spend money from sponsor address`, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
-
+
const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner,'Sponsor collection', '1', '1', '');
const collectionSub = helper.nft.getCollectionObject(collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, testCase === 'setCollectionSponsor');
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, testCase === 'setCollectionSponsor');
// Set collection sponsor:
await collectionEvm.methods[testCase](testCase === 'setCollectionSponsor' ? sponsor : sponsorCross).send();
let collectionData = (await collectionSub.getData())!;
expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));
await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
-
+
await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});
collectionData = (await collectionSub.getData())!;
expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));
-
+
const user = helper.eth.createAccount();
const userCross = helper.ethCrossAccount.fromAddress(user);
await collectionEvm.methods.addCollectionAdminCross(userCross).send();
-
+
const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
-
+
const mintingResult = await collectionEvm.methods.mintWithTokenURI(user, 'Test URI').send({from: user});
const tokenId = mintingResult.events.Transfer.returnValues.tokenId;
-
+
const event = helper.eth.normalizeEvents(mintingResult.events)
.find(event => event.event === 'Transfer');
const address = helper.ethAddress.fromCollectionId(collectionId);
-
+
expect(event).to.be.deep.equal({
address,
event: 'Transfer',
@@ -289,7 +289,7 @@
},
});
expect(await collectionEvm.methods.tokenURI(tokenId).call({from: user})).to.be.equal('Test URI');
-
+
const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);
const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
@@ -305,7 +305,7 @@
const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner,'Sponsor collection', '1', '1', '');
const collectionSub = helper.nft.getCollectionObject(collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
// Set and confirm sponsor:
await collectionEvm.methods.setCollectionSponsorCross(sponsorCrossEth).send({from: owner});
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -34,7 +34,7 @@
itEth('Self sponsoring can be set by the address that deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const flipper = await helper.eth.deployFlipper(owner);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
// 1. owner can set selfSponsoring:
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -71,7 +71,7 @@
itEth('Self sponsoring cannot be set by the address that did not deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const notOwner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -81,7 +81,7 @@
itEth('Sponsoring can be set by the address that has deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
@@ -92,18 +92,18 @@
itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const notOwner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).call({from: notOwner})).to.be.rejectedWith('NoPermission');
expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
});
-
+
itEth('Sponsor can be set by the address that deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
// 1. owner can set a sponsor:
@@ -124,12 +124,12 @@
},
]);
});
-
+
itEth('Sponsor cannot be set by the address that did not deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const notOwner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false;
@@ -140,7 +140,7 @@
itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -173,7 +173,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const notSponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -185,7 +185,7 @@
itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const notSponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -196,7 +196,7 @@
itEth('Sponsor can be removed by the address that deployed the contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
@@ -229,14 +229,14 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const notOwner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
-
+
await expect(helpers.methods.removeSponsor(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission');
await expect(helpers.methods.removeSponsor(flipper.options.address).send({from: notOwner})).to.be.rejected;
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
@@ -246,7 +246,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
@@ -271,7 +271,7 @@
itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
@@ -303,24 +303,24 @@
const sponsor = await helper.eth.createAccountWithBalance(donor);
const caller = helper.eth.createAccount();
await helper.eth.transferBalanceFromSubstrate(donor, caller, testCase.balance);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
-
+
await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
-
+
await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner});
await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
-
+
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
-
+
const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
expect(sponsorBalanceBefore > 0n).to.be.true;
-
+
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
// Balance should be taken from flipper instead of caller
const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
@@ -333,7 +333,7 @@
itEth('Non-allow-listed address can call a contract. Sponsor balance should not decrease', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = helper.eth.createAccount();
- const contractHelpers = helper.ethNativeContract.contractHelpers(owner);
+ const contractHelpers = await helper.ethNativeContract.contractHelpers(owner);
// Deploy flipper and send some tokens:
const flipper = await helper.eth.deployFlipper(owner);
@@ -348,7 +348,7 @@
await contractHelpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner});
await contractHelpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
- // 1. Caller has no UNQ and is not in allow list. So he cannot flip:
+ // 1. Caller has no UNQ and is not in allow list. So he cannot flip:
await expect(flipper.methods.flip().send({from: caller})).to.be.rejectedWith(/Returned error: insufficient funds for gas \* price \+ value/);
expect(await flipper.methods.getValue().call()).to.be.false;
@@ -361,9 +361,9 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
-
+
const originalCallerBalance = await helper.balance.getEthereum(caller);
await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
@@ -393,7 +393,7 @@
// TODO: Find a way to calculate default rate limit
itEth('Default rate limit equal 7200', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equal('7200');
@@ -412,7 +412,7 @@
`
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
-
+
contract TestContract {
event Result(bool);
@@ -432,7 +432,7 @@
}
return testContract;
}
-
+
async function deployTestContract(helper: EthUniqueHelper, owner: string) {
const compiled = await compileTestContract(helper);
return await helper.ethContract.deployByAbi(owner, compiled.abi, compiled.object);
@@ -447,7 +447,7 @@
itEth('Default fee limit', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equal('115792089237316195423570985008687907853269984665640564039457584007913129639935');
@@ -455,7 +455,7 @@
itEth('Set fee limit', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
@@ -465,7 +465,7 @@
itEth('Negative test - set fee limit by non-owner', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const stranger = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const flipper = await helper.eth.deployFlipper(owner);
await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected;
@@ -475,13 +475,13 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
const user = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const testContract = await deployTestContract(helper, owner);
-
+
await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
-
+
await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
@@ -500,13 +500,13 @@
itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
const testContract = await deployTestContract(helper, owner);
-
+
await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
-
+
await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
@@ -525,7 +525,7 @@
);
// expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance);
expect(await helper.balance.getSubstrate(alice.address)).to.be.equal(originalAliceBalance);
-
+
await helper.eth.sendEVM(
alice,
testContract.options.address,
tests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterboth--- a/tests/src/eth/createFTCollection.seqtest.ts
+++ b/tests/src/eth/createFTCollection.seqtest.ts
@@ -32,16 +32,16 @@
itEth('Create collection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const name = 'CollectionEVM';
const description = 'Some description';
const prefix = 'token prefix';
-
+
// todo:playgrounds this might fail when in async environment.
const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
const {collectionId} = await helper.eth.createFungibleCollection(owner, name, DECIMALS, description, prefix);
-
+
const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
const data = (await helper.ft.getData(collectionId))!;
@@ -59,16 +59,16 @@
const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;
const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);
- const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
expect(await collectionHelpers.methods
.isCollectionExist(expectedCollectionAddress)
.call()).to.be.false;
-
+
await helper.eth.createFungibleCollection(owner, 'A', DECIMALS, 'A', 'A');
-
+
expect(await collectionHelpers.methods
.isCollectionExist(expectedCollectionAddress)
.call()).to.be.true;
tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createFTCollection.test.ts
+++ b/tests/src/eth/createFTCollection.test.ts
@@ -31,7 +31,7 @@
donor = await privateKey({filename: __filename});
});
});
-
+
// TODO move sponsorship tests to another file:
// Soft-deprecated
itEth('[eth] Set sponsorship', async ({helper}) => {
@@ -39,10 +39,10 @@
const sponsor = await helper.eth.createAccountWithBalance(donor);
const ss58Format = helper.chain.getChainProperties().ss58Format;
const description = 'absolutely anything';
-
+
const {collectionId, collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Sponsor', DECIMALS, description, 'ENVY');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
await collection.methods.setCollectionSponsor(sponsor).send();
let data = (await helper.rft.getData(collectionId))!;
@@ -50,7 +50,7 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.rft.getData(collectionId))!;
@@ -63,8 +63,8 @@
const ss58Format = helper.chain.getChainProperties().ss58Format;
const description = 'absolutely anything';
const {collectionId, collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Sponsor', DECIMALS, description, 'ENVY');
-
- const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
await collection.methods.setCollectionSponsorCross(sponsorCross).send();
@@ -73,7 +73,7 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.rft.getData(collectionId))!;
@@ -84,12 +84,14 @@
itEth('Collection address exist', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddressForNonexistentCollection).call())
.to.be.false;
-
+
const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddress).call())
.to.be.true;
@@ -98,18 +100,18 @@
const collectionOwner = await collectionEvm.methods.collectionOwner().call();
expect(helper.address.restoreCrossAccountFromBigInt(BigInt(collectionOwner.sub))).to.eq(helper.address.ethToSubstrate(owner));
});
-
+
itEth('destroyCollection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress, collectionId} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const result = await collectionHelper.methods
.destroyCollection(collectionAddress)
.send({from: owner});
const events = helper.eth.normalizeEvents(result.events);
-
+
expect(events).to.be.deep.equal([
{
address: collectionHelper.options.address,
@@ -141,7 +143,7 @@
itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
{
const MAX_NAME_LENGTH = 64;
const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);
@@ -171,10 +173,10 @@
.call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);
}
});
-
+
itEth('(!negative test!) cannot create collection if value !== 2', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const expects = [0n, 1n, 30n].map(async value => {
await expect(collectionHelper.methods
.createFTCollection('Peasantry', DECIMALS, 'absolutely anything', 'TWIW')
@@ -188,15 +190,15 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const peasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Transgressed', DECIMALS, 'absolutely anything', 'YVNE');
- const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'ft', peasant, true);
+ const peasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'ft', peasant, true);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
await expect(peasantCollection.methods
.setCollectionSponsor(sponsor)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
-
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'ft', sponsor, true);
+
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'ft', sponsor, true);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -212,7 +214,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const peasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Transgressed', DECIMALS, 'absolutely anything', 'YVNE');
- const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'ft', peasant);
+ const peasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'ft', peasant);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
@@ -220,8 +222,8 @@
await expect(peasantCollection.methods
.setCollectionSponsorCross(sponsorCross)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
-
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'ft', sponsor);
+
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'ft', sponsor);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -231,5 +233,5 @@
.setCollectionLimit(CollectionLimits.AccountTokenOwnership, true, 1000)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
}
- });
+ });
});
tests/src/eth/createNFTCollection.seqtest.tsdiffbeforeafterboth--- a/tests/src/eth/createNFTCollection.seqtest.ts
+++ b/tests/src/eth/createNFTCollection.seqtest.ts
@@ -37,7 +37,7 @@
// todo:playgrounds this might fail when in async environment.
const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
const {collectionId, collectionAddress, events} = await helper.eth.createNFTCollection(owner, name, description, prefix);
-
+
expect(events).to.be.deep.equal([
{
address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',
@@ -48,7 +48,7 @@
},
},
]);
-
+
const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
const collection = helper.nft.getCollectionObject(collectionId);
@@ -72,7 +72,7 @@
const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;
const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);
- const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
expect(await collectionHelpers.methods
.isCollectionExist(expectedCollectionAddress)
tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -17,7 +17,7 @@
import {evmToAddress} from '@polkadot/util-crypto';
import {IKeyringPair} from '@polkadot/types/types';
import {expect, itEth, usingEthPlaygrounds} from './util';
-import { CollectionLimits } from './util/playgrounds/types';
+import {CollectionLimits} from './util/playgrounds/types';
describe('Create NFT collection from EVM', () => {
@@ -38,8 +38,8 @@
const baseUri = 'BaseURI';
const {collectionId, collectionAddress, events} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, name, description, prefix, baseUri);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
-
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
+
expect(events).to.be.deep.equal([
{
address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',
@@ -53,14 +53,14 @@
const collection = helper.nft.getCollectionObject(collectionId);
const data = (await collection.getData())!;
-
+
expect(data.name).to.be.eq(name);
expect(data.description).to.be.eq(description);
expect(data.raw.tokenPrefix).to.be.eq(prefix);
expect(data.raw.mode).to.be.eq('NFT');
-
+
expect(await contract.methods.description().call()).to.deep.equal(description);
-
+
const options = await collection.getOptions();
expect(options.tokenPropertyPermissions).to.be.deep.equal([
{
@@ -81,7 +81,7 @@
const ss58Format = helper.chain.getChainProperties().ss58Format;
const {collectionId, collectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
await collection.methods.setCollectionSponsor(sponsor).send();
let data = (await helper.nft.getData(collectionId))!;
@@ -89,7 +89,7 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor, true);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor, true);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.nft.getData(collectionId))!;
@@ -103,7 +103,7 @@
const description = 'absolutely anything';
const {collectionId, collectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', description, 'ROC');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
await collection.methods.setCollectionSponsorCross(sponsorCross).send();
@@ -112,24 +112,26 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.nft.getData(collectionId))!;
expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));
-
+
expect(await sponsorCollection.methods.description().call()).to.deep.equal(description);
});
itEth('Collection address exist', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddressForNonexistentCollection).call())
.to.be.false;
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Exister', 'absolutely anything', 'EVC');
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddress).call())
.to.be.true;
@@ -153,7 +155,7 @@
itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
{
const MAX_NAME_LENGTH = 64;
const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);
@@ -187,7 +189,7 @@
itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
await expect(collectionHelper.methods
.createNFTCollection('Peasantry', 'absolutely anything', 'CVE')
.call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
@@ -198,7 +200,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const malfeasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Transgressed', 'absolutely anything', 'COR');
- const malfeasantCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant, true);
+ const malfeasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant, true);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
@@ -206,7 +208,7 @@
.setCollectionSponsor(sponsor)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor, true);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor, true);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -222,7 +224,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const malfeasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Transgressed', 'absolutely anything', 'COR');
- const malfeasantCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant);
+ const malfeasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
@@ -231,7 +233,7 @@
.setCollectionSponsorCross(sponsorCross)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -246,7 +248,7 @@
itEth('destroyCollection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const result = await collectionHelper.methods
@@ -254,7 +256,7 @@
.send({from: owner});
const events = helper.eth.normalizeEvents(result.events);
-
+
expect(events).to.be.deep.equal([
{
address: collectionHelper.options.address,
@@ -270,4 +272,4 @@
.call()).to.be.false;
expect(await helper.collection.getData(collectionId)).to.be.null;
});
-});
\ No newline at end of file
+});
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -33,11 +33,11 @@
itEth('Create collection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const name = 'CollectionEVM';
const description = 'Some description';
const prefix = 'token prefix';
-
+
const {collectionId} = await helper.eth.createRFTCollection(owner, name, description, prefix);
const data = (await helper.rft.getData(collectionId))!;
const collection = helper.rft.getCollectionObject(collectionId);
@@ -52,8 +52,8 @@
expect(options.tokenPropertyPermissions).to.be.empty;
});
-
+
itEth('Create collection with properties & get description', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
@@ -63,11 +63,11 @@
const baseUri = 'BaseURI';
const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, name, description, prefix, baseUri);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const collection = helper.rft.getCollectionObject(collectionId);
const data = (await collection.getData())!;
-
+
expect(data.name).to.be.eq(name);
expect(data.description).to.be.eq(description);
expect(data.raw.tokenPrefix).to.be.eq(prefix);
@@ -87,7 +87,7 @@
},
]);
});
-
+
// Soft-deprecated
itEth('[eth] Set sponsorship', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
@@ -95,7 +95,7 @@
const ss58Format = helper.chain.getChainProperties().ss58Format;
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner, true);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner, true);
await collection.methods.setCollectionSponsor(sponsor).send();
let data = (await helper.rft.getData(collectionId))!;
@@ -103,7 +103,7 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.rft.getData(collectionId))!;
@@ -116,7 +116,7 @@
const ss58Format = helper.chain.getChainProperties().ss58Format;
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY');
- const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
await collection.methods.setCollectionSponsorCross(sponsorCross).send();
@@ -125,7 +125,7 @@
await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
data = (await helper.rft.getData(collectionId))!;
@@ -135,12 +135,14 @@
itEth('Collection address exist', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddressForNonexistentCollection).call())
.to.be.false;
-
+
const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Exister', 'absolutely anything', 'WIWT');
- expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)
+ expect(await collectionHelpers
.methods.isCollectionExist(collectionAddress).call())
.to.be.true;
@@ -165,7 +167,7 @@
itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
{
const MAX_NAME_LENGTH = 64;
const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);
@@ -195,10 +197,10 @@
.call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);
}
});
-
+
itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
await expect(collectionHelper.methods
.createRFTCollection('Peasantry', 'absolutely anything', 'TWIW')
.call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
@@ -209,15 +211,15 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const peasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE');
- const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant, true);
+ const peasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', peasant, true);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
await expect(peasantCollection.methods
.setCollectionSponsor(sponsor)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
-
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
+
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor, true);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -233,7 +235,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const peasant = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE');
- const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant);
+ const peasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', peasant);
const EXPECTED_ERROR = 'NoPermission';
{
const sponsor = await helper.eth.createAccountWithBalance(donor);
@@ -241,8 +243,8 @@
await expect(peasantCollection.methods
.setCollectionSponsorCross(sponsorCross)
.call()).to.be.rejectedWith(EXPECTED_ERROR);
-
- const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
+
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
.call()).to.be.rejectedWith('ConfirmSponsorshipFail');
@@ -253,16 +255,16 @@
.call()).to.be.rejectedWith(EXPECTED_ERROR);
}
});
-
+
itEth('destroyCollection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress, collectionId} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
-
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+
await expect(collectionHelper.methods
.destroyCollection(collectionAddress)
.send({from: owner})).to.be.fulfilled;
-
+
expect(await collectionHelper.methods
.isCollectionExist(collectionAddress)
.call()).to.be.false;
tests/src/eth/crossTransfer.test.tsdiffbeforeafterboth--- a/tests/src/eth/crossTransfer.test.ts
+++ b/tests/src/eth/crossTransfer.test.ts
@@ -30,8 +30,8 @@
[alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
});
});
-
- itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {
+
+ itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {
const bobCA = CrossAccountId.fromKeyring(bob);
const charlieCA = CrossAccountId.fromKeyring(charlie);
@@ -52,7 +52,7 @@
await collection.setLimits(alice, {ownerCanTransfer: true});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'ft', aliceProxy);
+ const contract = await helper.ethNativeContract.collection(address, 'ft', aliceProxy);
await collection.mint(alice, 200n, {Ethereum: aliceProxy});
await contract.methods.transfer(bobProxy, 50).send({from: aliceProxy});
@@ -73,10 +73,10 @@
[alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
});
});
-
+
itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {
const charlieEth = CrossAccountId.fromKeyring(charlie, 'Ethereum');
-
+
const collection = await helper.nft.mintCollection(alice);
await collection.setLimits(alice, {ownerCanTransfer: true});
const token = await collection.mintToken(alice);
@@ -93,7 +93,7 @@
await collection.setLimits(alice, {ownerCanTransfer: true});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', aliceProxy);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', aliceProxy);
const token = await collection.mintToken(alice);
await token.transfer(alice, {Ethereum: aliceProxy});
tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/destroyCollection.test.ts
+++ b/tests/src/eth/destroyCollection.test.ts
@@ -32,29 +32,29 @@
});
});
- testCases.map((testCase) =>
+ testCases.map((testCase) =>
itEth.ifWithPallets(`Cannot burn non-owned or non-existing collection ${testCase.case}`, testCase.requiredPallets, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const signer = await helper.eth.createAccountWithBalance(donor);
-
+
const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);
-
- const collectionHelpers = helper.ethNativeContract.collectionHelpers(signer);
+
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(signer);
const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, ...testCase.params as [string, string, string, number?]);
// cannot burn collec
await expect(collectionHelpers.methods
.destroyCollection(collectionAddress)
.send({from: signer})).to.be.rejected;
-
+
await expect(collectionHelpers.methods
.destroyCollection(unexistedCollection)
.send({from: signer})).to.be.rejected;
-
+
expect(await collectionHelpers.methods
.isCollectionExist(unexistedCollection)
.call()).to.be.false;
-
+
expect(await collectionHelpers.methods
.isCollectionExist(collectionAddress)
.call()).to.be.true;
tests/src/eth/ethFeesAreCorrect.test.tsdiffbeforeafterboth--- a/tests/src/eth/ethFeesAreCorrect.test.ts
+++ b/tests/src/eth/ethFeesAreCorrect.test.ts
@@ -32,7 +32,7 @@
itEth('web3 fees are the same as evm.call fees', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {});
-
+
const owner = await helper.eth.createAccountWithBalance(donor);
const receiver = await helper.eth.createAccountWithBalance(donor);
const aliceEth = helper.address.substrateToEth(alice.address);
@@ -41,7 +41,7 @@
const {tokenId: tokenB} = await collection.mintToken(minter, {Ethereum: aliceEth});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const balanceBeforeWeb3Transfer = await helper.balance.getEthereum(owner);
await contract.methods.transfer(receiver, tokenA).send({from: owner});
@@ -50,7 +50,7 @@
const encodedCall = contract.methods.transfer(receiver, tokenB)
.encodeABI();
-
+
const balanceBeforeEvmCall = await helper.balance.getSubstrate(alice.address);
await helper.eth.sendEVM(
alice,
tests/src/eth/events.test.tsdiffbeforeafterboth--- a/tests/src/eth/events.test.ts
+++ b/tests/src/eth/events.test.ts
@@ -22,7 +22,7 @@
import {CollectionLimits, EthTokenPermissions, NormalizedEvent} from './util/playgrounds/types';
let donor: IKeyringPair;
-
+
before(async function () {
await usingEthPlaygrounds(async (_helper, privateKey) => {
donor = await privateKey({filename: __filename});
@@ -53,7 +53,7 @@
clearEvents(ethEvents, subEvents);
}
{
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const result = await collectionHelper.methods.destroyCollection(collectionAddress).send({from:owner});
await helper.wait.newBlocks(1);
expect(result.events).to.containSubset({
@@ -71,9 +71,9 @@
async function testCollectionPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -112,8 +112,8 @@
async function testPropertyPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -121,8 +121,8 @@
const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['PropertyPermissionSet']}]);
await collection.methods.setTokenPropertyPermissions([
['A', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
]).send({from: owner});
@@ -143,8 +143,8 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const user = helper.ethCrossAccount.createAccount();
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any[] = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -185,8 +185,8 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const user = helper.ethCrossAccount.createAccount();
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -225,8 +225,8 @@
async function testCollectionLimitSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -252,8 +252,8 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const newOwner = helper.ethCrossAccount.createAccount();
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -278,8 +278,8 @@
async function testCollectionPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -319,8 +319,8 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.ethCrossAccount.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
collectionHelper.events.allEvents((_: any, event: any) => {
ethEvents.push(event);
@@ -373,14 +373,14 @@
async function testTokenPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const result = await collection.methods.mint(owner).send({from: owner});
const tokenId = result.events.Transfer.returnValues.tokenId;
await collection.methods.setTokenPropertyPermissions([
['A', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
]).send({from: owner});
@@ -431,23 +431,23 @@
itEth('CollectionChanged event for CollectionPropertySet and CollectionPropertyDeleted', async ({helper}) => {
await testCollectionPropertySetAndDeleted(helper, mode);
});
-
+
itEth('CollectionChanged event for AllowListAddressAdded, AllowListAddressRemoved', async ({helper}) => {
await testAllowListAddressAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionAdminAdded, CollectionAdminRemoved', async ({helper}) => {
await testCollectionAdminAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionLimitSet', async ({helper}) => {
await testCollectionLimitSet(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionOwnerChanged', async ({helper}) => {
await testCollectionOwnerChanged(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionPermissionSet', async ({helper}) => {
await testCollectionPermissionSet(helper, mode);
});
@@ -467,27 +467,27 @@
itEth('CollectionChanged event for CollectionPropertySet and CollectionPropertyDeleted', async ({helper}) => {
await testCollectionPropertySetAndDeleted(helper, mode);
});
-
+
itEth('CollectionChanged event for PropertyPermissionSet', async ({helper}) => {
await testPropertyPermissionSet(helper, mode);
});
-
+
itEth('CollectionChanged event for AllowListAddressAdded, AllowListAddressRemoved', async ({helper}) => {
await testAllowListAddressAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionAdminAdded, CollectionAdminRemoved', async ({helper}) => {
await testCollectionAdminAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionLimitSet', async ({helper}) => {
await testCollectionLimitSet(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionOwnerChanged', async ({helper}) => {
await testCollectionOwnerChanged(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionPermissionSet', async ({helper}) => {
await testCollectionPermissionSet(helper, mode);
});
@@ -495,7 +495,7 @@
itEth('CollectionChanged event for CollectionSponsorSet, SponsorshipConfirmed, CollectionSponsorRemoved', async ({helper}) => {
await testCollectionSponsorSetAndConfirmedAndThenRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for TokenPropertySet, TokenPropertyDeleted', async ({helper}) => {
await testTokenPropertySetAndDeleted(helper, mode);
});
@@ -518,27 +518,27 @@
itEth('CollectionChanged event for CollectionPropertySet and CollectionPropertyDeleted', async ({helper}) => {
await testCollectionPropertySetAndDeleted(helper, mode);
});
-
+
itEth('CollectionChanged event for PropertyPermissionSet', async ({helper}) => {
await testPropertyPermissionSet(helper, mode);
});
-
+
itEth('CollectionChanged event for AllowListAddressAdded, AllowListAddressRemoved', async ({helper}) => {
await testAllowListAddressAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionAdminAdded, CollectionAdminRemoved', async ({helper}) => {
await testCollectionAdminAddedAndRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionLimitSet', async ({helper}) => {
await testCollectionLimitSet(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionOwnerChanged', async ({helper}) => {
await testCollectionOwnerChanged(helper, mode);
});
-
+
itEth('CollectionChanged event for CollectionPermissionSet', async ({helper}) => {
await testCollectionPermissionSet(helper, mode);
});
@@ -546,7 +546,7 @@
itEth('CollectionChanged event for CollectionSponsorSet, SponsorshipConfirmed, CollectionSponsorRemoved', async ({helper}) => {
await testCollectionSponsorSetAndConfirmedAndThenRemoved(helper, mode);
});
-
+
itEth('CollectionChanged event for TokenPropertySet, TokenPropertyDeleted', async ({helper}) => {
await testTokenPropertySetAndDeleted(helper, mode);
});
tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -63,7 +63,7 @@
nftCollectionAddress: string, nftTokenId: number, rftTokenAddress: string
}> => {
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -93,7 +93,7 @@
const owner = await helper.eth.createAccountWithBalance(donor, 10n);
const fractionalizer = await deployContract(helper, owner);
const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');
- const rftContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
+ const rftContract = await helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);
await rftContract.methods.addCollectionAdminCross(fractionalizerAddressCross).send({from: owner});
@@ -148,7 +148,7 @@
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -168,7 +168,7 @@
});
const rftTokenAddress = result.events.Fractionalized.returnValues._rftToken;
- const rftTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress);
+ const rftTokenContract = await helper.ethNativeContract.rftToken(rftTokenAddress);
expect(await rftTokenContract.methods.balanceOf(owner).call()).to.equal('100');
});
@@ -181,7 +181,7 @@
const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);
const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId);
expect(rftCollectionAddress).to.be.equal(refungibleAddress);
- const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);
+ const refungibleTokenContract = await helper.ethNativeContract.rftToken(rftTokenAddress, owner);
await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner});
const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send({from: owner});
expect(result.events).to.be.like({
@@ -204,7 +204,7 @@
const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);
const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId);
expect(rftCollectionAddress).to.be.equal(refungibleAddress);
- const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);
+ const refungibleTokenContract = await helper.ethNativeContract.rftToken(rftTokenAddress, owner);
await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner});
const rft2nft = await fractionalizer.methods.rft2nftMapping(rftTokenAddress).call();
@@ -233,7 +233,7 @@
itEth('call setRFTCollection twice', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');
- const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
+ const refungibleContract = await helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
const fractionalizer = await deployContract(helper, owner);
const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);
@@ -247,7 +247,7 @@
itEth('call setRFTCollection with NFT collection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const fractionalizer = await deployContract(helper, owner);
const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);
@@ -282,7 +282,7 @@
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -297,7 +297,7 @@
const nftOwner = await helper.eth.createAccountWithBalance(donor, 10n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
await nftContract.methods.transfer(nftOwner, 1).send({from: owner});
@@ -314,7 +314,7 @@
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -329,7 +329,7 @@
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -345,7 +345,7 @@
const fractionalizer = await deployContract(helper, owner);
const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');
- const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
+ const refungibleContract = await helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
const mintResult = await refungibleContract.methods.mint(owner).send({from: owner});
const rftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -358,7 +358,7 @@
const {contract: fractionalizer} = await initContract(helper, owner);
const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');
- const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
+ const refungibleContract = await helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
const mintResult = await refungibleContract.methods.mint(owner).send({from: owner});
const rftTokenId = mintResult.events.Transfer.returnValues.tokenId;
@@ -369,7 +369,7 @@
itEth('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor, 20n);
const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');
- const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
+ const refungibleContract = await helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);
const fractionalizer = await deployContract(helper, owner);
@@ -392,7 +392,7 @@
const {rftTokenAddress} = await mintRFTToken(helper, owner, fractionalizer, 100n);
const {tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);
- const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);
+ const refungibleTokenContract = await helper.ethNativeContract.rftToken(rftTokenAddress, owner);
await refungibleTokenContract.methods.transfer(receiver, 50).send({from: owner});
await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send({from: receiver});
await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call({from: receiver}))
@@ -419,7 +419,7 @@
const {contract: fractionalizer} = await initContract(helper, owner);
await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner});
- const nftContract = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
await nftContract.methods.approve(fractionalizer.options.address, nftToken.tokenId).send({from: owner});
await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftToken.tokenId, 100).call())
.to.be.rejectedWith(/TransferNotAllowed$/g);
@@ -437,7 +437,7 @@
await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [rftCollection.collectionId, false], true);
const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');
- const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
+ const nftContract = await helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);
const mintResult = await nftContract.methods.mint(owner).send({from: owner});
const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;
tests/src/eth/fungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -33,7 +33,7 @@
const collection = await helper.ft.mintCollection(alice);
await collection.mint(alice, 200n);
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller);
const totalSupply = await contract.methods.totalSupply().call();
expect(totalSupply).to.equal('200');
});
@@ -43,7 +43,7 @@
const collection = await helper.ft.mintCollection(alice);
await collection.mint(alice, 200n, {Ethereum: caller});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller);
const balance = await contract.methods.balanceOf(caller).call();
expect(balance).to.equal('200');
});
@@ -68,17 +68,17 @@
await collection.addAdmin(alice, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
const result = await contract.methods.mint(receiver, 100).send();
-
+
const event = result.events.Transfer;
expect(event.address).to.equal(collectionAddress);
expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000');
expect(event.returnValues.to).to.equal(receiver);
expect(event.returnValues.value).to.equal('100');
});
-
+
[
'substrate' as const,
'ethereum' as const,
@@ -93,13 +93,13 @@
const ethOwner = await helper.eth.createAccountWithBalance(donor);
const collection = await helper.ft.mintCollection(alice);
await collection.addAdmin(alice, {Ethereum: ethOwner});
-
+
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'ft', ethOwner);
-
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', ethOwner);
+
// 2. Mint tokens:
const result = await collectionEvm.methods.mintCross(testCase === 'ethereum' ? receiverCrossEth : receiverCrossSub, 100).send();
-
+
const event = result.events.Transfer;
expect(event.address).to.equal(collectionAddress);
expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000');
@@ -123,7 +123,7 @@
await collection.addAdmin(alice, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
const result = await contract.methods.mintBulk(Array.from({length: bulkSize}, (_, i) => (
[receivers[i], (i + 1) * 10]
@@ -146,11 +146,11 @@
await collection.addAdmin(alice, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
await contract.methods.mint(receiver, 100).send();
const result = await contract.methods.burnFrom(receiver, 49).send({from: receiver});
-
+
const event = result.events.Transfer;
expect(event.address).to.equal(collectionAddress);
expect(event.returnValues.from).to.equal(receiver);
@@ -168,7 +168,7 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
{
const result = await contract.methods.approve(spender, 100).send({from: owner});
@@ -192,13 +192,13 @@
const spenderSub = (await helper.arrange.createAccounts([1n], donor))[0];
const spenderCrossEth = helper.ethCrossAccount.fromAddress(spender);
const spenderCrossSub = helper.ethCrossAccount.fromKeyringPair(spenderSub);
-
+
const collection = await helper.ft.mintCollection(alice);
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
{
const result = await contract.methods.approveCross(spenderCrossEth, 100).send({from: owner});
@@ -213,8 +213,8 @@
const allowance = await contract.methods.allowance(owner, spender).call();
expect(+allowance).to.equal(100);
}
-
-
+
+
{
const result = await contract.methods.approveCross(spenderCrossSub, 100).send({from: owner});
const event = result.events.Approval;
@@ -228,7 +228,7 @@
const allowance = await collection.getApprovedTokens({Ethereum: owner}, {Substrate: spenderSub.address});
expect(allowance).to.equal(100n);
}
-
+
{
//TO-DO expect with future allowanceCross(owner, spenderCrossEth).call()
}
@@ -242,7 +242,7 @@
await collection.mint(alice, 100n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
await expect(collectionEvm.methods.approveCross(nonOwnerCross, 20).call({from: nonOwner})).to.be.rejectedWith('CantApproveMoreThanOwned');
});
@@ -257,10 +257,10 @@
await collection.approveTokens(owner, {Ethereum: sender}, 100n);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'ft');
+ const contract = await helper.ethNativeContract.collection(address, 'ft');
const fromBalanceBefore = await collection.getBalance({Substrate: owner.address});
-
+
const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);
const result = await contract.methods.burnFromCross(ownerCross, 49).send({from: sender});
const events = result.events;
@@ -298,13 +298,13 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
await contract.methods.approve(spender, 100).send();
{
const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender});
-
+
let event = result.events.Transfer;
expect(event.address).to.be.equal(collectionAddress);
expect(event.returnValues.from).to.be.equal(owner);
@@ -338,7 +338,7 @@
await collection.mint(alice, 200n, {Ethereum: sender});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'ft', sender);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', sender);
{
// Can transferCross to ethereum address:
@@ -356,7 +356,7 @@
const receiverBalance = await collectionEvm.methods.balanceOf(receiverEth).call();
expect(+receiverBalance).to.equal(50);
}
-
+
{
// Can transferCross to substrate address:
const result = await collectionEvm.methods.transferCross(receiverCrossSub, 50).send({from: sender});
@@ -385,7 +385,7 @@
const collection = await helper.ft.mintCollection(alice);
await collection.mint(alice, BALANCE, {Ethereum: sender});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'ft', sender);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', sender);
// 1. Cannot transfer more than have
const receiver = testCase === 'transfer' ? receiverEth : receiverCrossEth;
@@ -393,8 +393,8 @@
// 2. Zero transfer allowed (EIP-20):
await collectionEvm.methods[testCase](receiver, 0n).send({from: sender});
}));
-
-
+
+
itEth('Can perform transfer()', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const receiver = await helper.eth.createAccountWithBalance(donor);
@@ -402,11 +402,11 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
{
const result = await contract.methods.transfer(receiver, 50).send({from: owner});
-
+
const event = result.events.Transfer;
expect(event.address).to.be.equal(collectionAddress);
expect(event.returnValues.from).to.be.equal(owner);
@@ -436,14 +436,14 @@
await collection.approveTokens(owner, {Ethereum: sender}, 100n);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'ft');
+ const contract = await helper.ethNativeContract.collection(address, 'ft');
const from = helper.ethCrossAccount.fromKeyringPair(owner);
const to = helper.ethCrossAccount.fromAddress(receiver);
const fromBalanceBefore = await collection.getBalance({Substrate: owner.address});
const toBalanceBefore = await collection.getBalance({Ethereum: receiver});
-
+
const result = await contract.methods.transferFromCross(from, to, 51).send({from: sender});
expect(result.events).to.be.like({
@@ -483,7 +483,7 @@
[alice] = await helper.arrange.createAccounts([20n], donor);
});
});
-
+
itEth('approve() call fee is less than 0.2UNQ', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const spender = helper.eth.createAccount();
@@ -491,7 +491,7 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, 100).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -504,7 +504,7 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
await contract.methods.approve(spender, 100).send({from: owner});
@@ -519,7 +519,7 @@
await collection.mint(alice, 200n, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, 100).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -544,13 +544,13 @@
await collection.mint(alice, 200n);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
events.push(event);
});
-
+
await collection.approveTokens(alice, {Ethereum: receiver}, 100n);
if (events.length == 0) await helper.wait.newBlocks(1);
const event = events[0];
@@ -570,7 +570,7 @@
await collection.approveTokens(alice, {Substrate: bob.address}, 100n);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -601,13 +601,13 @@
await collection.mint(alice, 200n);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'ft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
events.push(event);
});
-
+
await collection.transfer(alice, {Ethereum:receiver}, 51n);
if (events.length == 0) await helper.wait.newBlocks(1);
const event = events[0];
@@ -630,11 +630,11 @@
await collection.approveTokens(owner, {Ethereum: sender}, 100n);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'ft');
+ const contract = await helper.ethNativeContract.collection(address, 'ft');
const from = helper.ethCrossAccount.fromKeyringPair(owner);
const to = helper.ethCrossAccount.fromAddress(receiver);
-
+
const result = await contract.methods.transferFromCross(from, to, 51).send({from: sender});
expect(result.events).to.be.like({
tests/src/eth/helpersSmoke.test.tsdiffbeforeafterboth--- a/tests/src/eth/helpersSmoke.test.ts
+++ b/tests/src/eth/helpersSmoke.test.ts
@@ -25,13 +25,13 @@
donor = await privateKey({filename: __filename});
});
});
-
+
itEth('Contract owner is recorded', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const flipper = await helper.eth.deployFlipper(owner);
- expect(await helper.ethNativeContract.contractHelpers(owner).methods.contractOwner(flipper.options.address).call()).to.be.equal(owner);
+ expect(await (await helper.ethNativeContract.contractHelpers(owner)).methods.contractOwner(flipper.options.address).call()).to.be.equal(owner);
});
itEth('Flipper is working', async ({helper}) => {
tests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth--- a/tests/src/eth/marketplace/marketplace.test.ts
+++ b/tests/src/eth/marketplace/marketplace.test.ts
@@ -30,7 +30,7 @@
before(async () => {
await usingEthPlaygrounds(async (_helper, privateKey) => {
donor = await privateKey({filename: __filename});
- });
+ });
});
beforeEach(async () => {
@@ -50,17 +50,17 @@
const matcher = await helper.ethContract.deployByCode(matcherOwner, 'MarketPlace', (await readFile(`${__dirname}/MarketPlace.sol`)).toString(), [{solPath: 'api/UniqueNFT.sol', fsPath: `${__dirname}/../api/UniqueNFT.sol`}], helper.eth.DEFAULT_GAS * 2);
const sponsor = await helper.eth.createAccountWithBalance(donor);
- const helpers = helper.ethNativeContract.contractHelpers(matcherOwner);
+ const helpers = await helper.ethNativeContract.contractHelpers(matcherOwner);
await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner});
await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner});
-
+
await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});
await collection.confirmSponsorship(alice);
await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
- const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror);
await helpers.methods.toggleAllowed(matcher.options.address, aliceMirror, true).send({from: matcherOwner});
@@ -104,17 +104,17 @@
const sponsor = await helper.eth.createAccountWithBalance(donor);
const escrow = await helper.eth.createAccountWithBalance(donor);
await matcher.methods.setEscrow(escrow, true).send({from: matcherOwner});
- const helpers = helper.ethNativeContract.contractHelpers(matcherOwner);
+ const helpers = await helper.ethNativeContract.contractHelpers(matcherOwner);
await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner});
await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner});
-
+
await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});
await collection.confirmSponsorship(alice);
await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
- const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror);
@@ -168,10 +168,10 @@
await helper.eth.transferBalanceFromSubstrate(donor, matcher.options.address);
const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}});
- const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
await helper.balance.transferToSubstrate(donor, seller.address, 100_000_000_000_000_000_000n);
-
+
const token = await collection.mintToken(alice, {Ethereum: sellerMirror});
// Token is owned by seller initially
tests/src/eth/migration.seqtest.tsdiffbeforeafterboth--- a/tests/src/eth/migration.seqtest.ts
+++ b/tests/src/eth/migration.seqtest.ts
@@ -165,7 +165,7 @@
const collection = await helper.nft.mintCollection(superuser);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
const caller = await helper.eth.createAccountWithBalance(superuser);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
tests/src/eth/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/eth/nesting/nest.test.ts
+++ b/tests/src/eth/nesting/nest.test.ts
@@ -9,7 +9,7 @@
): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => {
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await contract.methods.setCollectionNesting(true).send({from: owner});
return {collectionId, collectionAddress, contract};
@@ -51,13 +51,13 @@
await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner});
expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
});
-
+
itEth('NFT: collectionNestingRestrictedCollectionIds() & collectionNestingPermissions', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionId: unnestedCollsectionId, collectionAddress: unnsetedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const unnestedContract = helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner);
+ const unnestedContract = await helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner);
expect(await unnestedContract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([false, []]);
-
+
const {contract} = await createNestingCollection(helper, owner);
expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, []]);
await contract.methods.setCollectionNesting(true, [unnsetedCollectionAddress]).send({from: owner});
@@ -66,7 +66,7 @@
await contract.methods.setCollectionNesting(false).send({from: owner});
expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', false]]);
});
-
+
itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -37,7 +37,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
const totalSupply = await contract.methods.totalSupply().call();
expect(totalSupply).to.equal('1');
@@ -51,7 +51,7 @@
await collection.mintToken(alice, {Ethereum: caller});
await collection.mintToken(alice, {Ethereum: caller});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
const balance = await contract.methods.balanceOf(caller).call();
expect(balance).to.equal('3');
@@ -63,7 +63,7 @@
const token = await collection.mintToken(alice, {Ethereum: caller});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
const owner = await contract.methods.ownerOf(token.tokenId).call();
@@ -74,7 +74,7 @@
const collection = await helper.nft.mintCollection(alice, {name: 'test', tokenPrefix: 'TEST'});
const caller = helper.eth.createAccount();
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
expect(await contract.methods.name().call()).to.equal('test');
expect(await contract.methods.symbol().call()).to.equal('TEST');
@@ -95,7 +95,7 @@
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', baseUri);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const result = await contract.methods.mint(receiver).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -155,7 +155,7 @@
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', '6', '6', '');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -173,7 +173,7 @@
// const tokenUri = await contract.methods.tokenURI(nextTokenId).call();
// expect(tokenUri).to.be.equal(`https://offchain-service.local/token-info/${nextTokenId}`);
});
-
+
// TODO combine all minting tests in one place
[
'substrate' as const,
@@ -205,9 +205,9 @@
tokenPropertyPermissions: permissions,
});
await collection.addAdmin(minter, {Ethereum: collectionAdmin});
-
+
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', collectionAdmin, true);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', collectionAdmin, true);
let expectedTokenId = await contract.methods.nextTokenId().call();
let result = await contract.methods.mintCross(testCase === 'ethereum' ? receiverCrossEth : receiverCrossSub, []).send();
let tokenId = result.events.Transfer.returnValues.tokenId;
@@ -218,7 +218,7 @@
expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
expect(event.returnValues.to).to.be.equal(testCase === 'ethereum' ? receiverEth : helper.address.substrateToEth(bob.address));
expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
-
+
expectedTokenId = await contract.methods.nextTokenId().call();
result = await contract.methods.mintCross(testCase === 'ethereum' ? receiverCrossEth : receiverCrossSub, properties).send();
event = result.events.Transfer;
@@ -226,14 +226,14 @@
expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
expect(event.returnValues.to).to.be.equal(testCase === 'ethereum' ? receiverEth : helper.address.substrateToEth(bob.address));
expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
-
+
tokenId = result.events.Transfer.returnValues.tokenId;
-
+
expect(tokenId).to.be.equal(expectedTokenId);
expect(await contract.methods.properties(tokenId, []).call()).to.be.like(properties
.map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));
-
+
expect(await helper.nft.getTokenOwner(collection.collectionId, tokenId))
.to.deep.eq(testCase === 'ethereum' ? {Ethereum: receiverEth.toLowerCase()} : {Substrate: receiverSub.address});
});
@@ -245,12 +245,12 @@
const collection = await helper.nft.mintCollection(minter);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft');
await expect(collectionEvm.methods.mintCross(nonOwnerCross, []).call({from: nonOwner}))
.to.be.rejectedWith('PublicMintingNotAllowed');
});
-
+
//TODO: CORE-302 add eth methods
itEth.skip('Can perform mintBulk()', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
@@ -260,7 +260,7 @@
await collection.addAdmin(minter, {Ethereum: caller});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
{
const bulkSize = 3;
const nextTokenId = await contract.methods.nextTokenId().call();
@@ -292,7 +292,7 @@
const {tokenId} = await collection.mintToken(minter, {Ethereum: caller});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
{
const result = await contract.methods.burn(tokenId).send({from: caller});
@@ -313,7 +313,7 @@
const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
{
const result = await contract.methods.approve(spender, tokenId).send({from: owner});
@@ -333,7 +333,7 @@
const collection = await helper.nft.mintCollection(minter, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const approvedBefore = await contract.methods.isApprovedForAll(owner, operator).call();
expect(approvedBefore).to.be.equal(false);
@@ -382,7 +382,7 @@
const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
{
await contract.methods.setApprovalForAll(operator, true).send({from: owner});
@@ -403,7 +403,7 @@
expect(await helper.nft.doesTokenExist(collection.collectionId, token.tokenId)).to.be.false;
});
-
+
itEth('Can perform transfer with ApprovalForAll', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
@@ -414,7 +414,7 @@
const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
{
await contract.methods.setApprovalForAll(operator, true).send({from: owner});
@@ -450,7 +450,7 @@
const token2 = await collection.mintToken(minter, {Ethereum: ownerEth});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft');
// Approve tokens from substrate and ethereum:
await token1.approve(ownerSub, {Ethereum: burnerEth});
@@ -464,7 +464,7 @@
// Check events for burnFromCross (substrate and ethereum):
[
- [events1, token1, helper.address.substrateToEth(ownerSub.address)],
+ [events1, token1, helper.address.substrateToEth(ownerSub.address)],
[events2, token2, ownerEth],
].map(burnData => {
expect(burnData[0]).to.be.like({
@@ -497,7 +497,7 @@
const token1 = await collection.mintToken(minter, {Ethereum: owner});
const token2 = await collection.mintToken(minter, {Ethereum: owner});
- const collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
// Can approveCross substrate and ethereum address:
const resultSub = await collectionEvm.methods.approveCross(recieverCrossSub, token1.tokenId).send({from: owner});
@@ -536,7 +536,7 @@
const nonOwnerCross = helper.ethCrossAccount.fromAddress(nonOwner);
const owner = await helper.eth.createAccountWithBalance(donor);
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
const token = await collection.mintToken(minter, {Ethereum: owner});
await expect(collectionEvm.methods.approveCross(nonOwnerCross, token.tokenId).call({from: nonOwner})).to.be.rejectedWith('CantApproveMoreThanOwned');
@@ -551,7 +551,7 @@
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
const token1 = await collection.mintToken(minter, {Ethereum: owner});
const token2 = await collection.mintToken(minter, {Ethereum: owner});
- const collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
+ const collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
// Can approve and reaffirm approved address:
await collectionEvm.methods.approveCross(receiver1Cross, token1.tokenId).send({from: owner});
@@ -579,7 +579,7 @@
const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await contract.methods.approve(spender, tokenId).send({from: owner});
@@ -613,7 +613,7 @@
const token = await collection.mintToken(minter, {Substrate: owner.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
await token.approve(owner, {Ethereum: spender});
@@ -644,7 +644,7 @@
const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
{
const result = await contract.methods.transfer(receiver, tokenId).send({from: owner});
@@ -666,18 +666,18 @@
expect(+balance).to.equal(1);
}
});
-
+
itEth('Can perform transferCross()', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {});
const owner = await helper.eth.createAccountWithBalance(donor);
const receiverEth = await helper.eth.createAccountWithBalance(donor);
const receiverCrossEth = helper.ethCrossAccount.fromAddress(receiverEth);
const receiverCrossSub = helper.ethCrossAccount.fromKeyringPair(minter);
-
+
const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
{
// Can transferCross to ethereum address:
@@ -688,7 +688,7 @@
expect(event.returnValues.from).to.be.equal(owner);
expect(event.returnValues.to).to.be.equal(receiverEth);
expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`);
-
+
// owner has balance = 0:
const ownerBalance = await collectionEvm.methods.balanceOf(owner).call();
expect(+ownerBalance).to.equal(0);
@@ -697,7 +697,7 @@
expect(+receiverBalance).to.equal(1);
expect(await helper.nft.getTokenOwner(collection.collectionId, tokenId)).to.deep.eq({Ethereum: receiverEth.toLowerCase()});
}
-
+
{
// Can transferCross to substrate address:
const substrateResult = await collectionEvm.methods.transferCross(receiverCrossSub, tokenId).send({from: receiverEth});
@@ -707,7 +707,7 @@
expect(event.returnValues.from).to.be.equal(receiverEth);
expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(minter.address));
expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`);
-
+
// owner has balance = 0:
const ownerBalance = await collectionEvm.methods.balanceOf(receiverEth).call();
expect(+ownerBalance).to.equal(0);
@@ -725,7 +725,7 @@
const collection = await helper.nft.mintCollection(minter, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', sender);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', sender);
await collection.mintToken(minter, {Ethereum: sender});
const nonSendersToken = await collection.mintToken(minter, {Ethereum: tokenOwner});
@@ -758,7 +758,7 @@
const collection = await helper.nft.mintCollection(alice, {});
const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, tokenId).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -771,7 +771,7 @@
const collection = await helper.nft.mintCollection(alice, {});
const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
await contract.methods.approve(spender, tokenId).send({from: owner});
@@ -790,7 +790,7 @@
const token = await collection.mintToken(collectionMinter, {Substrate: owner.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
await token.approve(owner, {Ethereum: spender});
@@ -820,7 +820,7 @@
const collection = await helper.nft.mintCollection(alice, {});
const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, tokenId).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -841,7 +841,7 @@
itEth('Events emitted for mint()', async ({helper}) => {
const collection = await helper.nft.mintCollection(alice, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -864,7 +864,7 @@
const token = await collection.mintToken(alice);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -889,7 +889,7 @@
const token = await collection.mintToken(alice);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -916,7 +916,7 @@
await token.approve(alice, {Substrate: bob.address});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -941,7 +941,7 @@
const token = await collection.mintToken(alice);
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft');
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -991,7 +991,7 @@
},
);
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
const name = await contract.methods.name().call();
expect(name).to.equal('oh River');
});
@@ -1016,7 +1016,7 @@
},
);
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller);
const symbol = await contract.methods.symbol().call();
expect(symbol).to.equal('CHANGE');
});
@@ -1043,7 +1043,7 @@
const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
const ownerCross = helper.ethCrossAccount.fromAddress(owner);
await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
@@ -1064,7 +1064,7 @@
const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft');
+ const contract = await helper.ethNativeContract.collection(address, 'nft');
const ownerCross = helper.ethCrossAccount.fromAddress(owner);
const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
@@ -1073,7 +1073,7 @@
await contract.methods.setApprovalForAll(spender, true).send({from: owner});
await contract.methods.setApprovalForAll(spender, false).send({from: owner});
-
+
await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
});
});
tests/src/eth/payable.test.tsdiffbeforeafterboth--- a/tests/src/eth/payable.test.ts
+++ b/tests/src/eth/payable.test.ts
@@ -175,7 +175,7 @@
const SMALL_FEE = 1n * helper.balance.getOneTokenNominal();
const BIG_FEE = 3n * helper.balance.getOneTokenNominal();
const caller = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(caller);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(caller);
await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
@@ -185,7 +185,7 @@
const SMALL_FEE = 1n * helper.balance.getOneTokenNominal();
const BIG_FEE = 3n * helper.balance.getOneTokenNominal();
const caller = await helper.eth.createAccountWithBalance(donor);
- const collectionHelper = helper.ethNativeContract.collectionHelpers(caller);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(caller);
await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
tests/src/eth/proxy/fungibleProxy.test.tsdiffbeforeafterboth--- a/tests/src/eth/proxy/fungibleProxy.test.ts
+++ b/tests/src/eth/proxy/fungibleProxy.test.ts
@@ -48,7 +48,7 @@
await collection.mint(alice, 200n, {Substrate: alice.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'ft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const totalSupply = await contract.methods.totalSupply().call();
@@ -62,7 +62,7 @@
await collection.mint(alice, 200n, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'ft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const balance = await contract.methods.balanceOf(caller).call();
@@ -87,7 +87,7 @@
const spender = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'ft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
await collection.mint(alice, 200n, {Ethereum: contract.options.address});
@@ -123,7 +123,7 @@
const receiver = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'ft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
await evmCollection.methods.approve(contract.options.address, 100).send({from: owner});
@@ -170,7 +170,7 @@
const receiver = await helper.eth.createAccountWithBalance(donor);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'ft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
await collection.mint(alice, 200n, {Ethereum: contract.options.address});
tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth--- a/tests/src/eth/proxy/nonFungibleProxy.test.ts
+++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts
@@ -48,7 +48,7 @@
await collection.mintToken(alice, {Substrate: alice.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const totalSupply = await contract.methods.totalSupply().call();
@@ -66,7 +66,7 @@
]);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const balance = await contract.methods.balanceOf(caller).call();
@@ -80,7 +80,7 @@
const {tokenId} = await collection.mintToken(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const owner = await contract.methods.ownerOf(tokenId).call();
@@ -106,8 +106,8 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
- const collectionEvmOwned = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', caller, true);
+ const collectionEvmOwned = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller, true);
const contract = await proxyWrap(helper, collectionEvm, donor);
await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();
@@ -141,8 +141,8 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
- const collectionEvmOwned = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
+ const collectionEvmOwned = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
const contract = await proxyWrap(helper, collectionEvm, donor);
const contractAddressCross = helper.ethCrossAccount.fromAddress(contract.options.address);
await collectionEvmOwned.methods.addCollectionAdminCross(contractAddressCross).send();
@@ -179,7 +179,7 @@
const receiver = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
await collection.addAdmin(donor, {Ethereum: contract.options.address});
@@ -237,7 +237,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address});
await collection.addAdmin(alice, {Ethereum: contract.options.address});
@@ -266,7 +266,7 @@
const spender = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address});
@@ -296,7 +296,7 @@
const receiver = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});
@@ -335,7 +335,7 @@
const receiver = helper.eth.createAccount();
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller);
+ const evmCollection = await helper.ethNativeContract.collection(address, 'nft', caller);
const contract = await proxyWrap(helper, evmCollection, donor);
const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address});
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -33,7 +33,7 @@
itEth('totalSupply', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'TotalSupply', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
await contract.methods.mint(caller).send();
@@ -44,7 +44,7 @@
itEth('balanceOf', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'BalanceOf', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
await contract.methods.mint(caller).send();
await contract.methods.mint(caller).send();
@@ -57,7 +57,7 @@
itEth('ownerOf', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -70,11 +70,11 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf-AfterBurn', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
- const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
+ const tokenContract = await helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
await tokenContract.methods.repartition(2).send();
await tokenContract.methods.transfer(receiver, 1).send();
@@ -89,11 +89,11 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Partial-OwnerOf', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
- const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
+ const tokenContract = await helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
await tokenContract.methods.repartition(2).send();
await tokenContract.methods.transfer(receiver, 1).send();
@@ -122,7 +122,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Minty', '6', '6', '');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send();
@@ -136,7 +136,7 @@
expect(await contract.methods.crossOwnerOf(tokenId).call()).to.be.like([receiver, '0']);
expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI');
});
-
+
[
'substrate' as const,
'ethereum' as const,
@@ -155,16 +155,16 @@
collectionAdmin: true,
mutable: false}};
});
-
-
+
+
const collection = await helper.rft.mintCollection(minter, {
tokenPrefix: 'ethp',
tokenPropertyPermissions: permissions,
});
await collection.addAdmin(minter, {Ethereum: collectionAdmin});
-
+
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', collectionAdmin, true);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', collectionAdmin, true);
let expectedTokenId = await contract.methods.nextTokenId().call();
let result = await contract.methods.mintCross(testCase === 'ethereum' ? receiverCrossEth : receiverCrossSub, []).send();
let tokenId = result.events.Transfer.returnValues.tokenId;
@@ -175,7 +175,7 @@
expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
expect(event.returnValues.to).to.be.equal(testCase === 'ethereum' ? receiverEth : helper.address.substrateToEth(bob.address));
expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
-
+
expectedTokenId = await contract.methods.nextTokenId().call();
result = await contract.methods.mintCross(testCase === 'ethereum' ? receiverCrossEth : receiverCrossSub, properties).send();
event = result.events.Transfer;
@@ -183,11 +183,11 @@
expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
expect(event.returnValues.to).to.be.equal(testCase === 'ethereum' ? receiverEth : helper.address.substrateToEth(bob.address));
expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
-
+
tokenId = result.events.Transfer.returnValues.tokenId;
expect(tokenId).to.be.equal(expectedTokenId);
-
+
expect(await contract.methods.properties(tokenId, []).call()).to.be.like(properties
.map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));
@@ -200,7 +200,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'MintBulky', '6', '6', '');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
{
const nextTokenId = await contract.methods.nextTokenId().call();
@@ -236,7 +236,7 @@
const collection = await helper.rft.mintCollection(minter, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const approvedBefore = await contract.methods.isApprovedForAll(owner, operator).call();
expect(approvedBefore).to.be.equal(false);
@@ -285,7 +285,7 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
{
await contract.methods.setApprovalForAll(operator, true).send({from: owner});
@@ -314,9 +314,9 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
- const rftToken = helper.ethNativeContract.rftTokenById(token.collectionId, token.tokenId, owner);
+ const rftToken = await helper.ethNativeContract.rftTokenById(token.collectionId, token.tokenId, owner);
{
await rftToken.methods.approve(operator, 15n).send({from: owner});
@@ -326,7 +326,7 @@
expect(allowance).to.be.equal('5');
}
});
-
+
itEth('Can perform transfer with ApprovalForAll', async ({helper}) => {
const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
@@ -337,7 +337,7 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
{
await contract.methods.setApprovalForAll(operator, true).send({from: owner});
@@ -362,7 +362,7 @@
itEth('Can perform burn()', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Burny', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -380,14 +380,14 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'TransferFromy', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId);
- const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller);
+ const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, caller);
await tokenContract.methods.repartition(15).send();
{
@@ -432,10 +432,10 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft', spender, true);
+ const contract = await helper.ethNativeContract.collection(address, 'rft', spender, true);
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);
- const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
await tokenContract.methods.repartition(15).send();
await tokenContract.methods.approve(spender, 15).send();
@@ -458,14 +458,14 @@
itEth('Can perform burnFromCross()', async ({helper}) => {
const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
-
+
const owner = bob;
const spender = await helper.eth.createAccountWithBalance(donor, 100n);
const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
await token.repartition(owner, 15n);
await token.approve(owner, {Ethereum: spender}, 15n);
@@ -498,7 +498,7 @@
const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
await token.repartition(owner, 15n);
await token.approve(owner, {Ethereum: spender}, 15n);
@@ -526,7 +526,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -551,7 +551,7 @@
expect(+balance).to.equal(1);
}
});
-
+
itEth('Can perform transferCross()', async ({helper}) => {
const sender = await helper.eth.createAccountWithBalance(donor);
const receiverEth = await helper.eth.createAccountWithBalance(donor);
@@ -560,7 +560,7 @@
const collection = await helper.rft.mintCollection(minter, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', sender);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'rft', sender);
const token = await collection.mintToken(minter, 50n, {Ethereum: sender});
@@ -582,7 +582,7 @@
expect(+receiverBalance).to.equal(1);
expect(await token.getBalance({Ethereum: receiverEth})).to.eq(50n);
}
-
+
{
// Can transferCross to substrate address:
const substrateResult = await collectionEvm.methods.transferCross(receiverCrossSub, token.tokenId).send({from: receiverEth});
@@ -611,7 +611,7 @@
const collection = await helper.rft.mintCollection(minter, {});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', sender);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'rft', sender);
await collection.mintToken(minter, 50n, {Ethereum: sender});
const nonSendersToken = await collection.mintToken(minter, 50n, {Ethereum: tokenOwner});
@@ -627,12 +627,12 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Partial-to-Full', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
- const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
+ const tokenContract = await helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
await tokenContract.methods.repartition(2).send();
await tokenContract.methods.transfer(receiver, 1).send();
@@ -656,12 +656,12 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Full-to-Partial', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
- const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
+ const tokenContract = await helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);
await tokenContract.methods.repartition(2).send();
@@ -696,7 +696,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer-From', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -710,7 +710,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -754,7 +754,7 @@
},
);
- const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller);
const name = await contract.methods.name().call();
expect(name).to.equal('Leviathan');
});
@@ -779,7 +779,7 @@
},
);
- const contract = helper.ethNativeContract.collectionById(collectionId, 'rft', caller);
+ const contract = await helper.ethNativeContract.collectionById(collectionId, 'rft', caller);
const symbol = await contract.methods.symbol().call();
expect(symbol).to.equal('12');
});
@@ -793,7 +793,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
-
+
donor = await privateKey({filename: __filename});
[minter, alice] = await helper.arrange.createAccounts([100n, 100n], donor);
});
@@ -808,7 +808,7 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
const ownerCross = helper.ethCrossAccount.fromAddress(owner);
@@ -830,16 +830,16 @@
const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'rft');
+ const contract = await helper.ethNativeContract.collection(address, 'rft');
const ownerCross = helper.ethCrossAccount.fromAddress(owner);
const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
-
+
await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
await contract.methods.setApprovalForAll(spender, true).send({from: owner});
await contract.methods.setApprovalForAll(spender, false).send({from: owner});
-
+
await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
});
});
tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -38,7 +38,7 @@
const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'});
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller});
- const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
+ const contract = await helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
const totalSupply = await contract.methods.totalSupply().call();
expect(totalSupply).to.equal('200');
});
@@ -48,7 +48,7 @@
const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'});
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller});
- const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
+ const contract = await helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
const balance = await contract.methods.balanceOf(caller).call();
expect(balance).to.equal('200');
});
@@ -58,7 +58,7 @@
const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'});
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller});
- const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
+ const contract = await helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller);
const decimals = await contract.methods.decimals().call();
expect(decimals).to.equal('0');
});
@@ -81,7 +81,7 @@
const receiver = helper.eth.createAccount();
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', baseUri);
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const result = await contract.methods.mint(receiver).send();
@@ -143,7 +143,7 @@
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
{
const result = await contract.methods.approve(spender, 100).send({from: owner});
@@ -159,20 +159,20 @@
expect(+allowance).to.equal(100);
}
});
-
+
itEth('Can perform approveCross()', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const spender = helper.eth.createAccount();
const spenderSub = (await helper.arrange.createAccounts([1n], donor))[0];
const spenderCrossEth = helper.ethCrossAccount.fromAddress(spender);
const spenderCrossSub = helper.ethCrossAccount.fromKeyringPair(spenderSub);
-
+
const collection = await helper.rft.mintCollection(alice);
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
{
const result = await contract.methods.approveCross(spenderCrossEth, 100).send({from: owner});
@@ -187,8 +187,8 @@
const allowance = await contract.methods.allowance(owner, spender).call();
expect(+allowance).to.equal(100);
}
-
-
+
+
{
const result = await contract.methods.approveCross(spenderCrossSub, 100).send({from: owner});
const event = result.events.Approval;
@@ -202,7 +202,7 @@
const allowance = await collection.getTokenApprovedPieces(tokenId, {Ethereum: owner}, {Substrate: spenderSub.address});
expect(allowance).to.equal(100n);
}
-
+
{
//TO-DO expect with future allowanceCross(owner, spenderCrossEth).call()
}
@@ -216,7 +216,7 @@
const token = await collection.mintToken(alice, 100n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);
- const tokenEvm = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const tokenEvm = await helper.ethNativeContract.rftToken(tokenAddress, owner);
await expect(tokenEvm.methods.approveCross(nonOwnerCross, 20).call({from: nonOwner})).to.be.rejectedWith('CantApproveMoreThanOwned');
});
@@ -224,7 +224,7 @@
[
'transferFrom',
'transferFromCross',
- ].map(testCase =>
+ ].map(testCase =>
itEth(`Can perform ${testCase}`, async ({helper}) => {
const isCross = testCase === 'transferFromCross';
const owner = await helper.eth.createAccountWithBalance(donor);
@@ -234,21 +234,21 @@
const receiverCrossEth = helper.ethCrossAccount.fromAddress(receiverEth);
const [receiverSub] = await helper.arrange.createAccounts([1n], donor);
const receiverCrossSub = helper.ethCrossAccount.fromKeyringPair(receiverSub);
-
+
const collection = await helper.rft.mintCollection(alice);
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
await contract.methods.approve(spender, 100).send({from: owner});
-
+
// 1. Can transfer from
// 1.1 Plain ethereum or cross address:
{
const result = await contract.methods[testCase](
isCross ? ownerCross : owner,
- isCross ? receiverCrossEth : receiverEth,
+ isCross ? receiverCrossEth : receiverEth,
49,
).send({from: spender});
@@ -272,7 +272,7 @@
expect(+receiverBalance).to.equal(49);
expect(+ownerBalance).to.equal(151);
}
-
+
// 1.2 Cross substrate address:
if (testCase === 'transferFromCross') {
const result = await contract.methods.transferFromCross(ownerCross, receiverCrossSub, 51).send({from: spender});
@@ -300,7 +300,7 @@
[
'transfer',
'transferCross',
- ].map(testCase =>
+ ].map(testCase =>
itEth(`Can perform ${testCase}()`, async ({helper}) => {
const isCross = testCase === 'transferCross';
const owner = await helper.eth.createAccountWithBalance(donor);
@@ -312,7 +312,7 @@
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
// 1. Can transfer to plain ethereum or cross-ethereum account:
{
@@ -329,8 +329,8 @@
expect(+ownerBalance).to.equal(150);
expect(+receiverBalance).to.equal(50);
}
-
- // 2. Can transfer to cross-substrate account:
+
+ // 2. Can transfer to cross-substrate account:
if(isCross) {
const result = await contract.methods.transferCross(receiverCrossSub, 50).send({from: owner});
// Check events:
@@ -350,7 +350,7 @@
[
'transfer',
'transferCross',
- ].map(testCase =>
+ ].map(testCase =>
itEth(`Cannot ${testCase}() non-owned token`, async ({helper}) => {
const isCross = testCase === 'transferCross';
const owner = await helper.eth.createAccountWithBalance(donor);
@@ -361,14 +361,14 @@
const rftOwner = await collection.mintToken(alice, 10n, {Ethereum: owner});
const rftReceiver = await collection.mintToken(alice, 10n, {Ethereum: receiverEth});
const tokenIdNonExist = 9999999;
-
+
const tokenAddress1 = helper.ethAddress.fromTokenId(collection.collectionId, rftOwner.tokenId);
const tokenAddress2 = helper.ethAddress.fromTokenId(collection.collectionId, rftReceiver.tokenId);
const tokenAddressNonExist = helper.ethAddress.fromTokenId(collection.collectionId, tokenIdNonExist);
- const tokenEvmOwner = helper.ethNativeContract.rftToken(tokenAddress1, owner);
- const tokenEvmReceiver = helper.ethNativeContract.rftToken(tokenAddress2, owner);
- const tokenEvmNonExist = helper.ethNativeContract.rftToken(tokenAddressNonExist, owner);
-
+ const tokenEvmOwner = await helper.ethNativeContract.rftToken(tokenAddress1, owner);
+ const tokenEvmReceiver = await helper.ethNativeContract.rftToken(tokenAddress2, owner);
+ const tokenEvmNonExist = await helper.ethNativeContract.rftToken(tokenAddressNonExist, owner);
+
// 1. Can transfer zero amount (EIP-20):
await tokenEvmOwner.methods[testCase](isCross ? receiverCrossEth : receiverEth, 0).send({from: owner});
// 2. Cannot transfer non-owned token:
@@ -397,7 +397,7 @@
const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
await contract.methods.repartition(200).send({from: owner});
expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(200);
@@ -422,7 +422,7 @@
const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
const result = await contract.methods.repartition(200).send();
@@ -439,7 +439,7 @@
const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
const result = await contract.methods.repartition(50).send();
const event = result.events.Transfer;
@@ -453,12 +453,12 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = await helper.eth.createAccountWithBalance(donor);
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Devastation', '6', '6');
- const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'rft', caller);
const result = await contract.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId);
- const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller);
+ const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, caller);
await tokenContract.methods.repartition(2).send();
await tokenContract.methods.transfer(receiver, 1).send();
@@ -476,26 +476,26 @@
expect(event.returnValues.to).to.be.equal(receiver);
expect(event.returnValues.tokenId).to.be.equal(tokenId);
});
-
+
itEth('Can perform burnFromCross()', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const ownerSub = (await helper.arrange.createAccounts([10n], donor))[0];
const ownerCross = helper.ethCrossAccount.fromAddress(owner);
const spender = await helper.eth.createAccountWithBalance(donor);
-
+
const spenderCrossEth = helper.ethCrossAccount.fromAddress(spender);
const ownerSubCross = helper.ethCrossAccount.fromKeyringPair(ownerSub);
const collection = await helper.rft.mintCollection(alice);
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
-
+
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
{
await contract.methods.approveCross(spenderCrossEth, 100).send({from: owner});
-
+
await expect(contract.methods.burnFromCross(ownerCross, 50).send({from: spender})).to.be.fulfilled;
await expect(contract.methods.burnFromCross(ownerCross, 100).send({from: spender})).to.be.rejected;
expect(await contract.methods.balanceOf(owner).call({from: owner})).to.be.equal('150');
@@ -504,8 +504,8 @@
const {tokenId} = await collection.mintToken(alice, 200n, {Substrate: ownerSub.address});
await collection.approveToken(ownerSub, tokenId, {Ethereum: spender}, 100n);
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
-
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
+
await expect(contract.methods.burnFromCross(ownerSubCross, 50).send({from: spender})).to.be.fulfilled;
await expect(contract.methods.burnFromCross(ownerSubCross, 100).send({from: spender})).to.be.rejected;
expect(await collection.getTokenBalance(tokenId, {Substrate: ownerSub.address})).to.be.equal(150n);
@@ -533,7 +533,7 @@
const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, 100).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -546,7 +546,7 @@
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
await contract.methods.approve(spender, 100).send({from: owner});
@@ -561,7 +561,7 @@
const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner});
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, 100).send({from: owner}));
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
@@ -587,7 +587,7 @@
const token = await collection.mintToken(alice, 200n);
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress);
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -613,7 +613,7 @@
await token.approve(alice, {Substrate: bob.address}, 100n);
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress);
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -644,7 +644,7 @@
const token = await collection.mintToken(alice, 200n);
const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);
- const contract = helper.ethNativeContract.rftToken(tokenAddress);
+ const contract = await helper.ethNativeContract.rftToken(tokenAddress);
const events: any = [];
contract.events.allEvents((_: any, event: any) => {
@@ -678,13 +678,13 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sands', '', 'GRAIN');
- const collectionContract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const collectionContract = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
const result = await collectionContract.methods.mint(owner).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId);
- const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, owner);
+ const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner);
expect(await tokenContract.methods.parentToken().call()).to.be.equal(collectionAddress);
expect(await tokenContract.methods.parentTokenId().call()).to.be.equal(tokenId);
tests/src/eth/sponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/sponsoring.test.ts
+++ b/tests/src/eth/sponsoring.test.ts
@@ -37,11 +37,11 @@
const flipper = await helper.eth.deployFlipper(owner);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
-
+
await helpers.methods.setSponsor(flipper.options.address, sponsor).send({from: owner});
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
@@ -71,7 +71,7 @@
const collector = await helper.eth.deployCollectorContract(owner);
- const helpers = helper.ethNativeContract.contractHelpers(owner);
+ const helpers = await helper.ethNativeContract.contractHelpers(owner);
await helpers.methods.toggleAllowlist(collector.options.address, true).send({from: owner});
await helpers.methods.toggleAllowed(collector.options.address, caller, true).send({from: owner});
tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -47,12 +47,12 @@
await collection.methods.setTokenPropertyPermissions([
['testKey', [
- [EthTokenPermissions.Mutable, mutable],
- [EthTokenPermissions.TokenOwner, tokenOwner],
+ [EthTokenPermissions.Mutable, mutable],
+ [EthTokenPermissions.TokenOwner, tokenOwner],
[EthTokenPermissions.CollectionAdmin, collectionAdmin]],
],
]).send({from: caller.eth});
-
+
expect(await helper[testCase.mode].getPropertyPermissions(collectionId)).to.be.deep.equal([{
key: 'testKey',
permission: {mutable, collectionAdmin, tokenOwner},
@@ -60,8 +60,8 @@
expect(await collection.methods.tokenPropertyPermissions().call({from: caller.eth})).to.be.like([
['testKey', [
- [EthTokenPermissions.Mutable.toString(), mutable],
- [EthTokenPermissions.TokenOwner.toString(), tokenOwner],
+ [EthTokenPermissions.Mutable.toString(), mutable],
+ [EthTokenPermissions.TokenOwner.toString(), tokenOwner],
[EthTokenPermissions.CollectionAdmin.toString(), collectionAdmin]],
],
]);
@@ -74,28 +74,28 @@
].map(testCase =>
itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions as owner`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await collection.methods.setTokenPropertyPermissions([
['testKey_0', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
['testKey_1', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, false],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, false],
[EthTokenPermissions.CollectionAdmin, true]],
],
['testKey_2', [
- [EthTokenPermissions.Mutable, false],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, false],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, false]],
],
]).send({from: owner});
-
+
expect(await helper[testCase.mode].getPropertyPermissions(collectionId)).to.be.deep.equal([
{
key: 'testKey_0',
@@ -113,18 +113,18 @@
expect(await collection.methods.tokenPropertyPermissions().call({from: owner})).to.be.like([
['testKey_0', [
- [EthTokenPermissions.Mutable.toString(), true],
- [EthTokenPermissions.TokenOwner.toString(), true],
+ [EthTokenPermissions.Mutable.toString(), true],
+ [EthTokenPermissions.TokenOwner.toString(), true],
[EthTokenPermissions.CollectionAdmin.toString(), true]],
],
['testKey_1', [
- [EthTokenPermissions.Mutable.toString(), true],
- [EthTokenPermissions.TokenOwner.toString(), false],
+ [EthTokenPermissions.Mutable.toString(), true],
+ [EthTokenPermissions.TokenOwner.toString(), false],
[EthTokenPermissions.CollectionAdmin.toString(), true]],
],
['testKey_2', [
- [EthTokenPermissions.Mutable.toString(), false],
- [EthTokenPermissions.TokenOwner.toString(), true],
+ [EthTokenPermissions.Mutable.toString(), false],
+ [EthTokenPermissions.TokenOwner.toString(), true],
[EthTokenPermissions.CollectionAdmin.toString(), false]],
],
]);
@@ -137,29 +137,29 @@
itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions as admin`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
-
+
const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await collection.methods.addCollectionAdminCross(caller).send({from: owner});
await collection.methods.setTokenPropertyPermissions([
['testKey_0', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
['testKey_1', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, false],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, false],
[EthTokenPermissions.CollectionAdmin, true]],
],
['testKey_2', [
- [EthTokenPermissions.Mutable, false],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, false],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, false]],
],
]).send({from: caller.eth});
-
+
expect(await helper[testCase.mode].getPropertyPermissions(collectionId)).to.be.deep.equal([
{
key: 'testKey_0',
@@ -177,22 +177,22 @@
expect(await collection.methods.tokenPropertyPermissions().call({from: caller.eth})).to.be.like([
['testKey_0', [
- [EthTokenPermissions.Mutable.toString(), true],
- [EthTokenPermissions.TokenOwner.toString(), true],
+ [EthTokenPermissions.Mutable.toString(), true],
+ [EthTokenPermissions.TokenOwner.toString(), true],
[EthTokenPermissions.CollectionAdmin.toString(), true]],
],
['testKey_1', [
- [EthTokenPermissions.Mutable.toString(), true],
- [EthTokenPermissions.TokenOwner.toString(), false],
+ [EthTokenPermissions.Mutable.toString(), true],
+ [EthTokenPermissions.TokenOwner.toString(), false],
[EthTokenPermissions.CollectionAdmin.toString(), true]],
],
['testKey_2', [
- [EthTokenPermissions.Mutable.toString(), false],
- [EthTokenPermissions.TokenOwner.toString(), true],
+ [EthTokenPermissions.Mutable.toString(), false],
+ [EthTokenPermissions.TokenOwner.toString(), true],
[EthTokenPermissions.CollectionAdmin.toString(), false]],
],
]);
-
+
}));
[
@@ -202,11 +202,11 @@
expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}],
},
{
- method: 'setProperty' /*Soft-deprecated*/,
+ method: 'setProperty' /*Soft-deprecated*/,
methodParams: ['testKey1', Buffer.from('testValue1')],
expectedProps: [{key: 'testKey1', value: 'testValue1'}],
},
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase.method}] Can be set`, async({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const collection = await helper.nft.mintCollection(alice, {
@@ -225,61 +225,61 @@
await collection.addAdmin(alice, {Ethereum: caller});
const token = await collection.mintToken(alice);
-
- const collectionEvm = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller, testCase.method === 'setProperty');
-
+
+ const collectionEvm = await helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller, testCase.method === 'setProperty');
+
await collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).send({from: caller});
-
+
const properties = await token.getProperties();
expect(properties).to.deep.equal(testCase.expectedProps);
}));
-
+
[
{mode: 'nft' as const, requiredPallets: []},
{mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`Can be multiple set/read for ${testCase.mode}`, testCase.requiredPallets, async({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
-
+
const properties = Array(5).fill(0).map((_, i) => { return {key: `key_${i}`, value: Buffer.from(`value_${i}`)}; });
const permissions: ITokenPropertyPermission[] = properties.map(p => { return {key: p.key, permission: {tokenOwner: true,
collectionAdmin: true,
mutable: true}}; });
-
+
const collection = await helper[testCase.mode].mintCollection(alice, {
tokenPrefix: 'ethp',
tokenPropertyPermissions: permissions,
}) as UniqueNFTCollection | UniqueRFTCollection;
-
+
const token = await collection.mintToken(alice);
-
+
const valuesBefore = await token.getProperties(properties.map(p => p.key));
expect(valuesBefore).to.be.deep.equal([]);
-
-
+
+
await collection.addAdmin(alice, {Ethereum: caller});
-
+
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, testCase.mode, caller);
-
+ const contract = await helper.ethNativeContract.collection(address, testCase.mode, caller);
+
expect(await contract.methods.properties(token.tokenId, []).call()).to.be.deep.equal([]);
-
+
await contract.methods.setProperties(token.tokenId, properties).send({from: caller});
-
+
const values = await token.getProperties(properties.map(p => p.key));
expect(values).to.be.deep.equal(properties.map(p => { return {key: p.key, value: p.value.toString()}; }));
-
+
expect(await contract.methods.properties(token.tokenId, []).call()).to.be.like(properties
.map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));
-
+
expect(await contract.methods.properties(token.tokenId, [properties[0].key]).call())
.to.be.like([helper.ethProperty.property(properties[0].key, properties[0].value.toString())]);
}));
-
+
[
{mode: 'nft' as const, requiredPallets: []},
{mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
- ].map(testCase =>
+ ].map(testCase =>
itEth.ifWithPallets(`Can be deleted for ${testCase.mode}`, testCase.requiredPallets, async({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const collection = await helper[testCase.mode].mintCollection(alice, {
@@ -298,7 +298,7 @@
},
}],
});
-
+
const token = await collection.mintToken(alice);
await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}, {key: 'testKey_1', value: 'testValue_1'}]);
expect(await token.getProperties()).to.has.length(2);
@@ -306,7 +306,7 @@
await collection.addAdmin(alice, {Ethereum: caller});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, testCase.mode, caller);
+ const contract = await helper.ethNativeContract.collection(address, testCase.mode, caller);
await contract.methods.deleteProperties(token.tokenId, ['testKey', 'testKey_1']).send({from: caller});
@@ -324,12 +324,12 @@
},
}],
});
-
+
const token = await collection.mintToken(alice);
await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]);
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+ const contract = await helper.ethNativeContract.collection(address, 'nft', caller);
const value = await contract.methods.property(token.tokenId, 'testKey').call();
expect(value).to.equal(helper.getWeb3().utils.toHex('testValue'));
@@ -371,10 +371,10 @@
collectionAdmin: true,
},
}],
- });
+ });
token = await aliceCollection.mintToken(alice);
await token.setProperties(alice, tokenProps);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
+ collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
});
});
@@ -384,7 +384,7 @@
].map(testCase =>
itEth(`[${testCase.method}] Cannot set properties of non-owned collection`, async ({helper}) => {
caller = await helper.eth.createAccountWithBalance(donor);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
+ collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
// Caller not an owner and not an admin, so he cannot set properties:
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).call({from: caller})).to.be.rejectedWith('NoPermission');
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).send({from: caller})).to.be.rejected;
@@ -401,7 +401,7 @@
].map(testCase =>
itEth(`[${testCase.method}] Cannot set non-existing properties`, async ({helper}) => {
caller = await helper.eth.createAccountWithBalance(donor);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
+ collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
await helper.collection.addAdmin(alice, aliceCollection.collectionId, {Ethereum: caller});
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).call({from: caller})).to.be.rejectedWith('NoPermission');
@@ -416,10 +416,10 @@
[
{method: 'deleteProperty', methodParams: ['testKey_2']},
{method: 'deleteProperties', methodParams: [['testKey_2']]},
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase.method}] Cannot delete properties of non-owned collection`, async ({helper}) => {
caller = await helper.eth.createAccountWithBalance(donor);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, testCase.method == 'deleteProperty');
+ collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, testCase.method == 'deleteProperty');
// Caller not an owner and not an admin, so he cannot set properties:
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).call({from: caller})).to.be.rejectedWith('NoPermission');
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).send({from: caller})).to.be.rejected;
@@ -429,14 +429,14 @@
const actualProps = await collectionEvm.methods.properties(token.tokenId, []).call();
expect(actualProps).to.deep.eq(expectedProps);
}));
-
+
[
{method: 'deleteProperty', methodParams: ['testKey_3']},
{method: 'deleteProperties', methodParams: [['testKey_3']]},
- ].map(testCase =>
+ ].map(testCase =>
itEth(`[${testCase.method}] Cannot delete non-existing properties`, async ({helper}) => {
caller = await helper.eth.createAccountWithBalance(donor);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, testCase.method == 'deleteProperty');
+ collectionEvm = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, testCase.method == 'deleteProperty');
await helper.collection.addAdmin(alice, aliceCollection.collectionId, {Ethereum: caller});
// Caller cannot delete non-existing properties:
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).call({from: caller})).to.be.rejectedWith('NoPermission');
@@ -454,17 +454,17 @@
itEth.ifWithPallets(`[${testCase.mode}] Cannot set token property permissions as non owner or admin`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
await expect(collection.methods.setTokenPropertyPermissions([
['testKey_0', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
- ]).call({from: caller})).to.be.rejectedWith('NoPermission');
+ ]).call({from: caller})).to.be.rejectedWith('NoPermission');
}));
[
@@ -473,18 +473,18 @@
].map(testCase =>
itEth.ifWithPallets(`[${testCase.mode}] Cannot set token property permissions with invalid character`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
await expect(collection.methods.setTokenPropertyPermissions([
// "Space" is invalid character
['testKey 0', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
- ]).call({from: owner})).to.be.rejectedWith('InvalidCharacterInPropertyKey');
+ ]).call({from: owner})).to.be.rejectedWith('InvalidCharacterInPropertyKey');
}));
[
@@ -493,25 +493,25 @@
].map(testCase =>
itEth.ifWithPallets(`[${testCase.mode}] Can reconfigure token property permissions to stricter ones`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
// 1. Owner sets strict property-permissions:
await collection.methods.setTokenPropertyPermissions([
['testKey', [
- [EthTokenPermissions.Mutable, true],
- [EthTokenPermissions.TokenOwner, true],
+ [EthTokenPermissions.Mutable, true],
+ [EthTokenPermissions.TokenOwner, true],
[EthTokenPermissions.CollectionAdmin, true]],
],
]).send({from: owner});
-
+
// 2. Owner can set stricter property-permissions:
for(const values of [[true, true, false], [true, false, false], [false, false, false]]) {
await collection.methods.setTokenPropertyPermissions([
['testKey', [
- [EthTokenPermissions.Mutable, values[0]],
- [EthTokenPermissions.TokenOwner, values[1]],
+ [EthTokenPermissions.Mutable, values[0]],
+ [EthTokenPermissions.TokenOwner, values[1]],
[EthTokenPermissions.CollectionAdmin, values[2]]],
],
]).send({from: owner});
@@ -529,15 +529,15 @@
].map(testCase =>
itEth.ifWithPallets(`[${testCase.mode}] Cannot reconfigure token property permissions to less strict ones`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
-
+
const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
- const collection = helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
-
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
// 1. Owner sets strict property-permissions:
await collection.methods.setTokenPropertyPermissions([
['testKey', [
- [EthTokenPermissions.Mutable, false],
- [EthTokenPermissions.TokenOwner, false],
+ [EthTokenPermissions.Mutable, false],
+ [EthTokenPermissions.TokenOwner, false],
[EthTokenPermissions.CollectionAdmin, false]],
],
]).send({from: owner});
@@ -546,8 +546,8 @@
for(const values of [[true, false, false], [false, true, false], [false, false, true]]) {
await expect(collection.methods.setTokenPropertyPermissions([
['testKey', [
- [EthTokenPermissions.Mutable, values[0]],
- [EthTokenPermissions.TokenOwner, values[1]],
+ [EthTokenPermissions.Mutable, values[0]],
+ [EthTokenPermissions.TokenOwner, values[1]],
[EthTokenPermissions.CollectionAdmin, values[2]]],
],
]).call({from: owner})).to.be.rejectedWith('NoPermission');
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -35,12 +35,42 @@
class EthGroupBase {
helper: EthUniqueHelper;
+ gasPrice?: string;
constructor(helper: EthUniqueHelper) {
this.helper = helper;
}
+ async getGasPrice() {
+ if (this.gasPrice)
+ return this.gasPrice;
+ this.gasPrice = await this.helper.getWeb3().eth.getGasPrice();
+ return this.gasPrice;
+ }
}
+function unlimitedMoneyHack<C>(_contract: C): C {
+ const contract = _contract as any;
+ // Hack: fight against gasPrice override
+ for (const method in contract.methods) {
+ const _method = contract.methods[method];
+ contract.methods[method] = function (...args: any) {
+ const encodedCall = _method.call(this, ...args);
+ const _call = encodedCall.call;
+ encodedCall.call = function (...args: any) {
+ if (args.length === 0) {
+ return _call.call(this, {gasPrice: '0'});
+ }
+ // No support for callback/defaultBlock, they may be placed as first argument
+ if (typeof args[0] !== 'object')
+ throw new Error('only options are supported');
+ args[0].gasPrice = '0';
+ return _call.call(this, ...args);
+ };
+ return encodedCall;
+ };
+ }
+ return contract;
+}
class ContractGroup extends EthGroupBase {
async findImports(imports?: ContractImports[]){
@@ -81,7 +111,7 @@
&& compiled.errors.some(function(err: any) {
return err.severity == 'error';
});
-
+
if (hasErrors) {
throw compiled.errors;
}
@@ -104,25 +134,34 @@
data: object,
from: signer,
gas: gas ?? this.helper.eth.DEFAULT_GAS,
+ gasPrice: await this.getGasPrice(),
});
- return await contract.deploy({data: object}).send({from: signer});
+ return unlimitedMoneyHack(await contract.deploy({data: object}).send({from: signer}));
}
}
class NativeContractGroup extends EthGroupBase {
- contractHelpers(caller: string): Contract {
+ async contractHelpers(caller: string): Promise<Contract> {
const web3 = this.helper.getWeb3();
- return new web3.eth.Contract(contractHelpersAbi as any, this.helper.getApi().consts.evmContractHelpers.contractAddress.toString(), {from: caller, gas: this.helper.eth.DEFAULT_GAS});
+ return unlimitedMoneyHack(new web3.eth.Contract(contractHelpersAbi as any, this.helper.getApi().consts.evmContractHelpers.contractAddress.toString(), {
+ from: caller,
+ gas: this.helper.eth.DEFAULT_GAS,
+ gasPrice: await this.getGasPrice(),
+ }));
}
- collectionHelpers(caller: string) {
+ async collectionHelpers(caller: string) {
const web3 = this.helper.getWeb3();
- return new web3.eth.Contract(collectionHelpersAbi as any, this.helper.getApi().consts.common.contractAddress.toString(), {from: caller, gas: this.helper.eth.DEFAULT_GAS});
+ return unlimitedMoneyHack(new web3.eth.Contract(collectionHelpersAbi as any, this.helper.getApi().consts.common.contractAddress.toString(), {
+ from: caller,
+ gas: this.helper.eth.DEFAULT_GAS,
+ gasPrice: await this.getGasPrice(),
+ }));
}
- collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false): Contract {
+ async collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false) {
let abi = {
'nft': nonFungibleAbi,
'rft': refungibleAbi,
@@ -137,19 +176,27 @@
abi = [...abi,...deprecated];
}
const web3 = this.helper.getWeb3();
- return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})});
+ return unlimitedMoneyHack(new web3.eth.Contract(abi as any, address, {
+ gas: this.helper.eth.DEFAULT_GAS,
+ gasPrice: await this.getGasPrice(),
+ ...(caller ? {from: caller} : {}),
+ }));
}
- collectionById(collectionId: number, mode: 'nft' | 'rft' | 'ft', caller?: string, mergeDeprecated = false): Contract {
+ collectionById(collectionId: number, mode: 'nft' | 'rft' | 'ft', caller?: string, mergeDeprecated = false) {
return this.collection(this.helper.ethAddress.fromCollectionId(collectionId), mode, caller, mergeDeprecated);
}
- rftToken(address: string, caller?: string): Contract {
+ async rftToken(address: string, caller?: string) {
const web3 = this.helper.getWeb3();
- return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})});
+ return unlimitedMoneyHack(new web3.eth.Contract(refungibleTokenAbi as any, address, {
+ gas: this.helper.eth.DEFAULT_GAS,
+ gasPrice: await this.getGasPrice(),
+ ...(caller ? {from: caller} : {}),
+ }));
}
- rftTokenById(collectionId: number, tokenId: number, caller?: string): Contract {
+ rftTokenById(collectionId: number, tokenId: number, caller?: string) {
return this.rftToken(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller);
}
}
@@ -177,7 +224,7 @@
}
async getCollectionCreationFee(signer: string) {
- const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
+ const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
return await collectionHelper.methods.collectionCreationFee().call();
}
@@ -210,7 +257,7 @@
async createCollection(mode: TCollectionMode, signer: string, name: string, description: string, tokenPrefix: string, decimals = 18): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice();
- const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
+ const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
const functionName: string = this.createCollectionMethodName(mode);
const functionParams = mode === 'ft' ? [name, decimals, description, tokenPrefix] : [name, description, tokenPrefix];
@@ -228,7 +275,7 @@
}
async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
- const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
+ const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
const {collectionId, collectionAddress, events} = await this.createCollection('nft', signer, name, description, tokenPrefix);
@@ -246,7 +293,7 @@
}
async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
- const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
+ const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
const {collectionId, collectionAddress, events} = await this.createCollection('rft', signer, name, description, tokenPrefix);
tests/src/maintenanceMode.seqtest.tsdiffbeforeafterboth--- a/tests/src/maintenanceMode.seqtest.ts
+++ b/tests/src/maintenanceMode.seqtest.ts
@@ -128,7 +128,7 @@
// Unable to mint an RFT when the MM is enabled
await expect(rftCollection.mintToken(superuser))
.to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);
-
+
await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);
expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;
@@ -191,7 +191,7 @@
// Schedule a transaction that should occur *during* the maintenance
await nftDuringMM.scheduleAfter(blocksToWait, {scheduledId: scheduledIdDuringMM})
.transfer(bob, {Substrate: superuser.address});
-
+
// Schedule a transaction that should occur *after* the maintenance
await nftDuringMM.scheduleAfter(blocksToWait * 2, {scheduledId: scheduledIdBunkerThroughMM})
.transfer(bob, {Substrate: superuser.address});
@@ -214,7 +214,7 @@
// Scheduling works after the maintenance
await nftAfterMM.scheduleAfter(blocksToWait, {scheduledId: scheduledIdAfterMM})
.transfer(bob, {Substrate: superuser.address});
-
+
await helper.wait.newBlocks(blocksToWait + 1);
expect(await nftAfterMM.getOwner()).to.be.deep.equal({Substrate: superuser.address});
@@ -225,14 +225,14 @@
itEth('Disallows Ethereum transactions to execute while in maintenance', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
-
+
const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'A', 'B', 'C', '');
// Set maintenance mode
await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);
expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;
- const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const tokenId = await contract.methods.nextTokenId().call();
expect(tokenId).to.be.equal('1');
tests/yarn.lockdiffbeforeafterboth--- a/tests/yarn.lock
+++ b/tests/yarn.lock
@@ -4811,7 +4811,7 @@
randombytes "^2.1.0"
utf8 "3.0.0"
-web3@^1.8.0:
+web3@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/web3/-/web3-1.8.1.tgz#8ea67215ef5f3a6f6d3381800b527242ea22885a"
integrity sha512-tAqFsQhGv340C9OgRJIuoScN7f7wa1tUvsnnDUMt9YE6J4gcm7TV2Uwv+KERnzvV+xgdeuULYpsioRRNKrUvoQ==